summaryrefslogtreecommitdiff
path: root/umdk-urma.spec
blob: a5ac5f53153929c40f1ff92e6f1da7a20aaeb200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# add --with transport_service_disable option, i.e. enable TPS by default
%bcond_with transport_service_disable

# add --with hw_disable option, i.e. enable HW by default
%bcond_with hw_disable

%if %{defined kernel_version}
    %define kernel_build_path /lib/modules/%{kernel_version}/build
%else
    %define kernel_version %(uname -r)
    %define kernel_build_path /lib/modules/%{kernel_version}/build
%endif
%define kernel_requires_version %(echo %{kernel_version} | awk -F"." 'OFS="."{$NF="";print}' | sed 's/\.$//g')

%if %{undefined rpm_version}
    %define rpm_version 1.3.0
%endif

%if %{undefined rpm_release}
    %define rpm_release B016
%endif

Name          : umdk-urma
Summary       : Unified memory development kit
Version       : %{rpm_version}
Release       : %{rpm_release}
Group         : nStack
License       : GPL-2.0-only
Provides      : Huawei Technologies Co., Ltd
Source0       : %{name}-%{version}.tar.gz
BuildRoot     : %{_buildirootdir}/%{name}-%{version}-build
BuildArch     : x86_64 aarch64
ExclusiveArch : aarch64
BuildRequires : rpm-build, make, cmake, gcc, gcc-c++, glibc-devel
BuildRequires : glib2-devel, systemd, libnl3-devel, openssl-devel
Requires: glibc, glib2
%if %{with asan}
Requires: libasan
%endif

%description
A new system interconnect architecture

%package lib
Summary:        Basic URMA libraries of UMDK

%description lib
This package contains basic URMA libraries of UMDK, such as liburma.so.

%if %{without hw_disable}
%package compat-hns-lib
Summary:	Libraries of hns

%description compat-hns-lib
This pachage contains libraries of hns, such as liburma-hns3.so.
%endif

%package devel
Summary:        Include Files and Libraries mandatory for URMA
Requires:       umdk-urma-lib = %{version}
AutoReqProv:    on

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require the provided includes and
libraries.

%package tools
Summary:        tools of urma
Requires:       umdk-urma-lib = %{version}
%description tools
tools of urma, contains  urma_perftest, urma_admin.

%if %{without transport_service_disable}
%package bin
Summary:        binary file of urma
BuildRequires:  gcc
Requires:       glibc
%description bin
binary file of urma, contains tpsa_daemon, uvs_admin
%endif

%prep
%setup -c -n %{name}-%{version}

%build
    cmake ./ -DCMAKE_INSTALL_PREFIX=/usr \
%if %{with transport_service_disable}
    -DTPS="disable" \
%endif
%if %{with hw_disable}
    -DHW="disable" \
%endif
%if %{defined kernel_version}
    -DKERNEL_RELEASE=%{kernel_version} \
    -DKERNEL_PATH=%{kernel_build_path} \
%endif

make %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot}

%clean
%{__rm} -rf %{buildroot}

%files lib
%defattr(-,root,root)
    %{_libdir}/liburma.so
    %{_libdir}/liburma.so.0
    %{_libdir}/liburma.so.0.0.1
    %{_libdir}/liburma_common.so
    %{_libdir}/liburma_common.so.0
    %{_libdir}/liburma_common.so.0.0.1
    /etc/rsyslog.d/urma.conf
    /etc/logrotate.d/urma

%post lib
if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then
    %{_bindir}/systemctl restart rsyslog >/dev/null  2>&1
fi

%if %{without hw_disable}
%files compat-hns-lib
%defattr(-,root,root)
    %dir %{_libdir}/urma
    %{_libdir}/urma/liburma-hns3.so
%endif

%files devel
%defattr(-,root,root)
    %dir %{_includedir}/umdk
    %dir %{_includedir}/umdk/common
    %{_includedir}/umdk/urma_*.h
    %{_includedir}/umdk/ub_errno.h
    %{_includedir}/umdk/urma_provider.h
    %{_includedir}/umdk/common/ub_*.h
    %{_includedir}/umdk/common/urma_*.h

%files tools
%defattr(-,root,root)
    %{_bindir}/urma_perftest
    %{_bindir}/urma_admin
    /etc/rsyslog.d/urma_admin.conf

%post tools
if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then
    %{_bindir}/systemctl restart rsyslog >/dev/null  2>&1
fi

%if %{without transport_service_disable}
%files bin
%defattr(-,root,root)
    %{_sbindir}/tpsa_daemon
    %{_sbindir}/uvs_daemon
    %attr(0700,-,-) %{_bindir}/uvs_admin
    /etc/rsyslog.d/tpsa.conf
    /etc/rsyslog.d/uvs_admin.conf
    /etc/logrotate.d/tpsa
    %dir /etc/tpsa
    %{_libdir}/libtpsa.so
    %{_libdir}/libtpsa.so.0
    %{_libdir}/libtpsa.so.0.0.1
    %attr(0644,-,-) %{_unitdir}/uvsd.service
%config(noreplace) /etc/tpsa/tpsa.ini
%post bin
if [ -x %{_bindir}/systemctl ]; then
    %{_bindir}/systemctl daemon-reload >/dev/null  2>&1
fi
if [ -x %{_bindir}/systemctl ] && [ -x %{_sbindir}/rsyslogd ]; then
    %{_bindir}/systemctl restart rsyslog >/dev/null  2>&1
fi
%endif

%changelog
* Mon Oct 14 2024 Chen Yutao <884071658@qq.com> - 1.3.0-B016
- Bugfix: Do not show cc_alg in tp_mode_flag of vport_table

* Tue Sep 24 2024 Weibo Zhao <zhaoweibo3@huawei.com> - 1.3.0-B015
- Bugfix: add prefix of hns3 to udma

* Tue Aug 27 2024 Weibo Zhao <zhaoweibo3@huawei.com> - 1.3.0-B014
- Bugfix: support dynamic qp function

* Thu Jul 18 2024 Weibo Zhao <zhaoweibo3@huawei.com> - 1.3.0-B013
- Bugfix: add log for udma

* Thu Jun 20 2024 Weibo Zhao <zhaoweibo3@huawei.com> - 1.3.0-B012
- Bugfix: hns3 add rq mode for um

* Thu Jun 20 2024 WenChen <chenwen54@huawei.com> - 1.3.0-B011
- Bugfix: urma tool information error

* Wed Jun 5 2024 WenChen <chenwen54@huawei.com> - 1.3.0-B010
- fix bugs urma_perftest init

* Wed May 22 2024 WenChen <chenwen54@huawei.com> - 1.3.0-B009
- add sync urma_tag

* Fri Mar 22 2024 panchenbo <panchenbo@kylinsec.com.cn> - 1.3.0-B008
- add BuildRequires:systemd for %{_unitdir} Macros

* Wed Nov 29 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B007
- Type:bugfix
- DESC:modify SO_REUSEADDR to SO_REUSEPORT

* Tue Nov 28 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B006
- Type:bugfix
- DESC:fix bugs detected in urma 

* Thu Nov 23 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B005
- Type:feature
- DESC:add new feature for urma. 

* Fri Oct 13 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B004
- Type:feature
- DESC:update source code, add hw hns3 lib

* Wed Oct 11 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B003
- Type:bugfix
- DESC:change name of spec to umdk-urma

* Wed Oct 11 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B002
- Type:bugfix
- DESC:change name of spec to umdk; change arch that only support aarch64

* Tue Oct 10 2023 Yizhen Fan <fanyizhen@huawei.com> - 1.3.0-B001
- Package init