]> git.pld-linux.org Git - packages/sanlock.git/blame - sanlock.spec
rebuild with python 3.10
[packages/sanlock.git] / sanlock.spec
CommitLineData
95761a51
JB
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
5
a2f4ba26
JB
6Summary: Shared storage lock manager
7Summary(pl.UTF-8): Zarządca blokad dla współdzielonego składowania danych
8Name: sanlock
cd1291c6 9Version: 3.8.4
7ba55725 10Release: 3
a2f4ba26
JB
11License: LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
12Group: Networking
f0345fc4 13Source0: https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
cd1291c6 14# Source0-md5: c064756c07a86e83119cfdd7695cf449
f0345fc4 15Patch0: %{name}-init-pld.patch
e6d834ca 16URL: https://pagure.io/sanlock
a2f4ba26
JB
17BuildRequires: gcc >= 5:3.4
18BuildRequires: libaio-devel
19BuildRequires: libblkid-devel
20BuildRequires: libuuid-devel
95761a51
JB
21%{?with_python2:BuildRequires: python-devel >= 1:2.5}
22%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
c4ff6f07 23BuildRequires: rpmbuild(macros) >= 1.228
51fef094
JB
24BuildRequires: tar >= 1:1.22
25BuildRequires: xz
c4ff6f07 26Requires(post,preun): /sbin/chkconfig
95ab4ed0
JB
27Requires(postun): /usr/sbin/groupdel
28Requires(postun): /usr/sbin/userdel
29Requires(pre): /bin/id
30Requires(pre): /usr/bin/getgid
31Requires(pre): /usr/sbin/groupadd
32Requires(pre): /usr/sbin/useradd
a2f4ba26 33Requires: %{name}-libs = %{version}-%{release}
c4ff6f07
JB
34Provides: group(sanlock)
35Provides: user(sanlock)
a2f4ba26
JB
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39Shared storage lock manager.
40
41%description -l pl.UTF-8
42Zarządca blokad dla współdzielonego składowania danych.
43
51fef094
JB
44%package reset
45Summary: Host reset daemon and client using sanlock
46Summary(pl.UTF-8): Demon resetujący hosta oraz klient wykorzystujący sanlocka
47Group: Daemons
48Requires(post,preun): /sbin/chkconfig
49Requires: %{name} = %{version}-%{release}
50
51%description reset
52This package contains the reset daemon and client. A cooperating host
53running the daemon can be reset by a host running the client, so long
54as both maintain access to a common sanlock lockspace.
55
56%description reset -l pl.UTF-8
57Ten pakiet zawiera demona oraz klienta resetującego. Współpracujący
58host z działającym demonem może być zresetowany przez host z
59działającym klientem tak długo, jak oba mają dostęp do wspólnej
60przestrzeni blokad sanlock.
61
62%package -n fence-sanlock
63Summary: Fence agent using sanlock and wdmd
64Summary(pl.UTF-8): Agent barier wykorzystujący sanlocka oraz wdmd
65Group: Daemons
66Requires(post,preun): /sbin/chkconfig
67Requires: %{name} = %{version}-%{release}
68
69%description -n fence-sanlock
70This package contains the fence agent and daemon for using sanlock and
71wdmd as a cluster fence agent.
72
73%description -n fence-sanlock -l pl.UTF-8
74Ten pakiet zawiera agenta oraz demona barier do użytku z sanlockiem
75oraz wdmd jako agent barier w klastrze.
76
a2f4ba26
JB
77%package libs
78Summary: Sanlock libraries
79Summary(pl.UTF-8): Biblioteki sanlock
80Group: Libraries
81
82%description libs
83Sanlock libraries.
84
85%description libs -l pl.UTF-8
86Biblioteki sanlock.
87
88%package devel
89Summary: Header files for sanlock libraries
90Summary(pl.UTF-8): Pliki nagłówkowe bibliotek sanlock
91Group: Development/Libraries
92Requires: %{name}-libs = %{version}-%{release}
601aa86e
JB
93# for libsanlock
94Requires: libaio-devel
95Requires: libblkid-devel
96Requires: libuuid-devel
a2f4ba26
JB
97
98%description devel
99Header files for sanlock libraries.
100
101%description devel -l pl.UTF-8
102Pliki nagłówkowe bibliotek sanlock.
103
104%package -n python-sanlock
95761a51
JB
105Summary: Python 2 binding for sanlock library
106Summary(pl.UTF-8): Wiązanie Pythona 2 do biblioteki sanlock
a2f4ba26
JB
107Group: Libraries/Python
108Requires: %{name}-libs = %{version}-%{release}
109
110%description -n python-sanlock
95761a51 111Python 2 binding for sanlock library.
a2f4ba26
JB
112
113%description -n python-sanlock -l pl.UTF-8
95761a51
JB
114Wiązanie Pythona 2 do biblioteki sanlock.
115
116%package -n python3-sanlock
117Summary: Python 3 binding for sanlock library
118Summary(pl.UTF-8): Wiązanie Pythona 3 do biblioteki sanlock
119Group: Libraries/Python
120Requires: %{name}-libs = %{version}-%{release}
121
122%description -n python3-sanlock
123Python 3 binding for sanlock library.
124
125%description -n python3-sanlock -l pl.UTF-8
126Wiązanie Pythona 3 do biblioteki sanlock.
a2f4ba26
JB
127
128%prep
129%setup -q
c195fee2 130%patch0 -p1
a2f4ba26
JB
131
132%build
133export CFLAGS="%{rpmcflags}"
134
135CMD_LDFLAGS="%{rpmldflags}" \
136LIB_LDFLAGS="%{rpmldflags}" \
137%{__make} -C wdmd \
138 CC="%{__cc}"
139
140CMD_LDFLAGS="%{rpmldflags}" \
141LIB_CLIENT_LDFLAGS="%{rpmldflags}" \
142LIB_ENTIRE_LDFLAGS="%{rpmldflags}" \
143%{__make} -C src \
144 CC="%{__cc}"
145
51fef094
JB
146CFLAGS= \
147%{__make} -C fence_sanlock \
148 CC="%{__cc}" \
149 OPTIMIZE_FLAG="%{rpmcflags}"
150
151CFLAGS= \
152%{__make} -C reset \
153 CC="%{__cc}" \
154 LDFLAGS="%{rpmldflags}" \
155 OPTIMIZE_FLAG="%{rpmcflags}"
156
74dea56f 157cd python
95761a51 158%if %{with python2}
74dea56f 159%py_build
95761a51
JB
160%endif
161
162%if %{with python3}
163%py3_build
164%endif
74dea56f 165cd ..
a2f4ba26
JB
166
167%install
168rm -rf $RPM_BUILD_ROOT
169
170%{__make} -C wdmd install \
171 DESTDIR=$RPM_BUILD_ROOT \
172 LIBDIR=%{_libdir}
173
174%{__make} -C src install \
175 DESTDIR=$RPM_BUILD_ROOT \
176 LIBDIR=%{_libdir}
177
51fef094
JB
178%{__make} -C fence_sanlock install \
179 DESTDIR=$RPM_BUILD_ROOT \
180 LIBDIR=%{_libdir}
181
182%{__make} -C reset install \
183 DESTDIR=$RPM_BUILD_ROOT
184
74dea56f 185cd python
95761a51 186%if %{with python2}
74dea56f 187%py_install
95761a51
JB
188%endif
189
190%if %{with python3}
191%py3_install
192%endif
74dea56f 193cd ..
a2f4ba26
JB
194
195/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
196
51fef094
JB
197install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/rc.d/init.d}
198install init.d/fence_sanlockd $RPM_BUILD_ROOT/etc/rc.d/init.d
a2f4ba26
JB
199install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
200install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
51fef094
JB
201for serv in sanlock wdmd fence_sanlockd ; do
202 sed -e "s,/lib/systemd/systemd-${serv},/etc/rc.d/init.d/${serv}," init.d/${serv}.service >$RPM_BUILD_ROOT%{systemdunitdir}/${serv}.service
203done
204cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
205
206install -d $RPM_BUILD_ROOT/var/run/{sanlock,wdmd,fence_sanlock,fence_sanlockd}
207install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir}
208cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/sanlock.conf <<EOF
a9d7d0e7 209d /var/run/sanlock 0775 sanlock sanlock -
51fef094
JB
210d /var/run/wdmd 0775 root sanlock -
211EOF
212cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/fence_sanlock.conf <<EOF
213d /var/run/fence_sanlock 0755 root root -
214d /var/run/fence_sanlockd 0755 root root -
c195fee2
JB
215EOF
216
d9e2e3b0
JB
217# fix hardcoded libdir=${prefix}/lib64
218%{__sed} -i -e 's,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
219
a2f4ba26
JB
220%clean
221rm -rf $RPM_BUILD_ROOT
222
95ab4ed0
JB
223%pre
224%groupadd -g 279 sanlock
225%useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
226
c4ff6f07
JB
227%post
228/sbin/chkconfig --add sanlock
229/sbin/chkconfig --add wdmd
230%service sanlock restart
231%service wdmd restart
232
233%preun
234if [ "$1" = "0" ]; then
235 %service -q sanlock stop
236 %service -q wdmd stop
237 /sbin/chkconfig --del sanlock
238 /sbin/chkconfig --del wdmd
239fi
240
95ab4ed0
JB
241%postun
242if [ "$1" = "0" ]; then
243 %userremove sanlock
244 %groupremove sanlock
245fi
246
51fef094
JB
247%post -n fence-sanlock
248/sbin/chkconfig --add fence_sanlock
249%service fence_sanlock restart
250if [ "$1" = "1" ]; then
251 ccs_update_schema >/dev/null 2>&1 || :
252fi
253
254%preun -n fence-sanlock
255if [ "$1" = "0" ]; then
256 %service -q fence_sanlock stop
257 /sbin/chkconfig --del fence_sanlock
258fi
259
a2f4ba26
JB
260%post libs -p /sbin/ldconfig
261%postun libs -p /sbin/ldconfig
262
263%files
264%defattr(644,root,root,755)
265%doc README.license
266%attr(755,root,root) %{_sbindir}/sanlock
267%attr(755,root,root) %{_sbindir}/wdmd
268%attr(754,root,root) /etc/rc.d/init.d/sanlock
269%attr(754,root,root) /etc/rc.d/init.d/wdmd
51fef094
JB
270%{systemdunitdir}/sanlock.service
271%{systemdunitdir}/wdmd.service
272%{systemdtmpfilesdir}/sanlock.conf
95ab4ed0 273%attr(775,sanlock,sanlock) %dir /var/run/sanlock
51fef094 274%attr(775,root,sanlock) %dir /var/run/wdmd
a2f4ba26
JB
275%{_mandir}/man8/sanlock.8*
276%{_mandir}/man8/wdmd.8*
277
51fef094
JB
278%files reset
279%defattr(644,root,root,755)
280%attr(755,root,root) %{_sbindir}/sanlk-reset
281%attr(755,root,root) %{_sbindir}/sanlk-resetd
282%{systemdunitdir}/sanlk-resetd.service
283%{_mandir}/man8/sanlk-reset.8*
284%{_mandir}/man8/sanlk-resetd.8*
285
286%files -n fence-sanlock
287%defattr(644,root,root,755)
288%attr(755,root,root) %{_sbindir}/fence_sanlock
289%attr(755,root,root) %{_sbindir}/fence_sanlockd
290%attr(754,root,root) /etc/rc.d/init.d/fence_sanlockd
291%{systemdunitdir}/fence_sanlockd.service
292%{systemdtmpfilesdir}/fence_sanlock.conf
293%dir /var/run/fence_sanlock
294%dir /var/run/fence_sanlockd
295%{_mandir}/man8/fence_sanlock.8*
296%{_mandir}/man8/fence_sanlockd.8*
297
a2f4ba26
JB
298%files libs
299%defattr(644,root,root,755)
300%attr(755,root,root) %{_libdir}/libsanlock.so.*.*
301%attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
302%attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
303%attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
304%attr(755,root,root) %{_libdir}/libwdmd.so.*.*
305%attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
306
307%files devel
308%defattr(644,root,root,755)
309%attr(755,root,root) %{_libdir}/libsanlock.so
310%attr(755,root,root) %{_libdir}/libsanlock_client.so
311%attr(755,root,root) %{_libdir}/libwdmd.so
312%{_includedir}/sanlock*.h
313%{_includedir}/wdmd.h
51fef094
JB
314%{_pkgconfigdir}/libsanlock.pc
315%{_pkgconfigdir}/libsanlock_client.pc
a2f4ba26 316
95761a51 317%if %{with python2}
a2f4ba26
JB
318%files -n python-sanlock
319%defattr(644,root,root,755)
320%attr(755,root,root) %{py_sitedir}/sanlock.so
51fef094 321%{py_sitedir}/sanlock_python-%{version}_-py*.egg-info
95761a51
JB
322%endif
323
324%if %{with python3}
325%files -n python3-sanlock
326%defattr(644,root,root,755)
327%attr(755,root,root) %{py3_sitedir}/sanlock.cpython-*.so
328%{py3_sitedir}/sanlock_python-%{version}_-py*.egg-info
329%endif
This page took 0.148192 seconds and 4 git commands to generate.