-
Notifications
You must be signed in to change notification settings - Fork 4
/
veos.spec.in
226 lines (197 loc) · 5.99 KB
/
veos.spec.in
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
Name: @PACKAGE@
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: VE Operating System
Group: System Environment/Daemons
License: GPLv2+ and (LGPLv2+ and BSD and MIT)
#URL:
Source0: @PACKAGE@-@[email protected]
Vendor: NEC Corporation
BuildArch: x86_64
BuildRequires: libved-devel >= 2.99.0 velayout-devel
BuildRequires: protobuf-c-devel log4c-devel systemd-devel libuuid-devel
BuildRequires: libcap-devel
BuildRequires: procps-ng-devel
BuildRequires: protobuf-compiler
BuildRequires: ve-memory-mapping-devel
BuildRequires: libdhash-devel
Requires: libved >= 2.99.0
Requires: velayout
Requires: protobuf-c log4c systemd-libs libuuid
Requires: libcap
Requires: procps-ng
Requires: libdhash
Requires(pre): systemd glibc
Requires(preun): systemd glibc
%if 0%{?rhel} == 8
Requires: python3-protobuf
%else
Requires: protobuf-python
%endif
%description
VEOS is a set of daemons and commands providing operating system
functionality to VE programs.
%package libveptrace
Summary: VE ptrace library
License: GPLv2+
%description libveptrace
This package contains the VE ptrace library.
%package devel
Summary: Headers for VEOS
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libveptrace = %{version}-%{release}
%description devel
This package contains the files required to build system software
which uses VEOS functionality.
This package is not required to build VE programs or libraries.
%package headers
License: MIT
Summary: Headers for VEOS
%description headers
This package contains the header files of definitions of VEOS.
VE programs or libraries include them if required.
%package libvepseudo-headers
License: LGPLv2+ and BSD
Summary: Headers for libvepseudo
Requires: %{name} = %{version}-%{release}
Requires: libved-devel >= 2.99.0 velayout-devel
%description libvepseudo-headers
This package contains the header files of definition of libvepseudo.
VH programs or libraries using internal functions in libvepseudo
include them.
%define _prefix @prefix@
%define _sysconfdir @sysconfdir@
%define _localstatedir @localstatedir@
%if 0%{?rhel} == 8
%define _veos_py0 %{_prefix}/lib/python%{python3_version}/site-packages/*
%else
%define _veos_py0 %{_prefix}/lib/python%{python2_version}/site-packages/*
%define _veos_py1 %{_prefix}/lib/python%{python2_version}/site-packages/*/*
%endif
%prep
%setup -q
%if 0%{?rhel} == 8
pathfix.py -pn -i /usr/bin/python3 $RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION/scripts \
$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION/scripts/ve_release_resource.in \
$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION/scripts/ve_delete_process.in \
$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION/scripts/ve_release_remote_resource.in \
$RPM_BUILD_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION/generate-arch_ops.py
%endif
%build
%configure \
--with-vemm-agent-includedir=@VEMM_AGENT_INCLUDEDIR@ \
--with-binfmtdir=@binfmtdir@ \
--with-limitsdir=@limitsdir@ \
--with-sysctldir=@sysctldir@ \
--with-veldconfdir=@veldconfdir@ \
--enable-memclear=@memclear@
make %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT
sh -c "rm -f ${RPM_BUILD_ROOT}%{_libdir}/lib*.a \
${RPM_BUILD_ROOT}%{_libdir}/lib*.la"
%pre
if [ $1 -gt 1 ] ; then
for dev in /dev/veslot*; do
if [ $dev == '/dev/veslot*' ]; then
break
fi
sysfs_path=/sys`/usr/bin/udevadm info -q path $dev`/os_state
os_state=`cat $sysfs_path`
if [ $os_state != "1" ]; then
echo "Error: OS state is not offline"
exit 1
fi
done
fi
%post
/sbin/ldconfig
if [ $1 -gt 1 ] ; then
if /usr/bin/systemctl is-active ve-ived.service >/dev/null 2>&1; then
/usr/bin/systemctl stop ve-ived.service
/usr/bin/systemctl start ve-ived.service
fi
fi
if [ $1 -ge 1 ] ; then
/usr/sbin/sysctl --system >/dev/null 2>&1
fi
if [ $1 -eq 1 ] ; then
/usr/bin/systemctl restart systemd-binfmt
fi
for no in `seq 0 7`; do
mkdir --mode=ugo+rwxt -p %{_localstatedir}/veos${no}-tmp
done
if [ `systemd-detect-virt` == 'kvm' ];then
if [ -e @ve_os_launcher_confdir@/veos_vm.options ];then
sed -i s/#ve-os-launcher@/ve-os-launcher@/ @ve_os_launcher_confdir@/veos_vm.options
fi
fi
%preun
for dev in /dev/veslot*; do
if [ $dev == '/dev/veslot*' ]; then
break
fi
sysfs_path=/sys`/usr/bin/udevadm info -q path $dev`/os_state
os_state=`cat $sysfs_path`
if [ $os_state != "1" ]; then
echo "Error: OS state is not offline"
exit 1
fi
done
%postun
/sbin/ldconfig
# During uninstall argument is received 0, so deleting the directories
# During upgrade argument is received 1
if [ $1 == 0 ]; then
for no in `seq 0 7`; do
rm -fr %{_localstatedir}/veos${no}-tmp
done
fi
%files
%config %{_sysconfdir}/log4crc
%config @binfmtdir@/ve.conf
%config @sysctldir@/10-veos.conf
%config @limitsdir@/10-veos.conf
%config @veldconfdir@/veos.conf
@ve_os_launcher_confdir@/ve-ived.options
@ve_os_launcher_confdir@/veos_timer.options
@ve_os_launcher_confdir@/veos_power_throttle.options
@ve_os_launcher_confdir@/veos_vm.options
%config(noreplace) @ve_os_launcher_confdir@/veswap.options
%config(noreplace) @ve_os_launcher_confdir@/vemodcode.options
%config(noreplace) %{_sysconfdir}/vemodcode.conf
%attr(0444,root,root) @prefix@/share/feature_list
@ve_bindir@/*
# GPLv2+
%{_sbindir}/*
@ve_libexecdir@/*
%{?_veos_py0}
%{?_veos_py1}
%{_libexecdir}/ve_coredump_helper
%{_libexecdir}/ve_release_resource
# LGPLv2+ and BSD and MIT
%{_libdir}/libvepseudo.so.*
%{_libexecdir}/ve_exec
%{_libdir}/libvhve.so.*
%{_libdir}/libveproductinfo.so.*
%doc
%files libveptrace
%{_libdir}/libveptrace.so.*
%files devel
%doc
%{_includedir}/*.h
%{_libdir}/*.so
%files headers
@ve_includedir@/*.h
@ve3_includedir@/*.h
%files libvepseudo-headers
# LGPLv2+
%{_includedir}/libvepseudo/*.h
%{_includedir}/libvepseudo/amm/*.h
%{_includedir}/libvepseudo/common/handle.h
%{_includedir}/libvepseudo/common/sys_common.h
%{_includedir}/libvepseudo/common/ve_syscall_no.h
%{_includedir}/libvepseudo/loader/loader.h
%{_includedir}/libvepseudo/psm/*.h
# BSD
%{_includedir}/libvepseudo/common/list.h