1 Summary: Shared storage lock manager
2 Summary(pl.UTF-8): Zarządca blokad dla współdzielonego składowania danych
6 License: LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
8 # older releases: https://fedorahosted.org/releases/s/a/sanlock/%{name}-%{version}.tar.gz
9 #Source0Download: https://git.fedorahosted.org/cgit/sanlock.git/
10 Source0: https://git.fedorahosted.org/cgit/sanlock.git/snapshot/%{name}-%{version}.tar.xz
11 # Source0-md5: d882beb5f188abff545b64cc3cbe9c79
12 Patch0: %{name}-link.patch
13 Patch1: %{name}-init-pld.patch
14 URL: https://fedorahosted.org/sanlock/
15 BuildRequires: gcc >= 5:3.4
16 BuildRequires: libaio-devel
17 BuildRequires: libblkid-devel
18 BuildRequires: libuuid-devel
19 BuildRequires: python-devel
20 BuildRequires: rpmbuild(macros) >= 1.228
21 BuildRequires: tar >= 1:1.22
23 Requires(post,preun): /sbin/chkconfig
24 Requires(postun): /usr/sbin/groupdel
25 Requires(postun): /usr/sbin/userdel
26 Requires(pre): /bin/id
27 Requires(pre): /usr/bin/getgid
28 Requires(pre): /usr/sbin/groupadd
29 Requires(pre): /usr/sbin/useradd
30 Requires: %{name}-libs = %{version}-%{release}
31 Provides: group(sanlock)
32 Provides: user(sanlock)
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Shared storage lock manager.
38 %description -l pl.UTF-8
39 Zarządca blokad dla współdzielonego składowania danych.
42 Summary: Host reset daemon and client using sanlock
43 Summary(pl.UTF-8): Demon resetujący hosta oraz klient wykorzystujący sanlocka
45 Requires(post,preun): /sbin/chkconfig
46 Requires: %{name} = %{version}-%{release}
49 This package contains the reset daemon and client. A cooperating host
50 running the daemon can be reset by a host running the client, so long
51 as both maintain access to a common sanlock lockspace.
53 %description reset -l pl.UTF-8
54 Ten pakiet zawiera demona oraz klienta resetującego. Współpracujący
55 host z działającym demonem może być zresetowany przez host z
56 działającym klientem tak długo, jak oba mają dostęp do wspólnej
57 przestrzeni blokad sanlock.
59 %package -n fence-sanlock
60 Summary: Fence agent using sanlock and wdmd
61 Summary(pl.UTF-8): Agent barier wykorzystujący sanlocka oraz wdmd
63 Requires(post,preun): /sbin/chkconfig
64 Requires: %{name} = %{version}-%{release}
66 %description -n fence-sanlock
67 This package contains the fence agent and daemon for using sanlock and
68 wdmd as a cluster fence agent.
70 %description -n fence-sanlock -l pl.UTF-8
71 Ten pakiet zawiera agenta oraz demona barier do użytku z sanlockiem
72 oraz wdmd jako agent barier w klastrze.
75 Summary: Sanlock libraries
76 Summary(pl.UTF-8): Biblioteki sanlock
82 %description libs -l pl.UTF-8
86 Summary: Header files for sanlock libraries
87 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek sanlock
88 Group: Development/Libraries
89 Requires: %{name}-libs = %{version}-%{release}
91 Requires: libaio-devel
92 Requires: libblkid-devel
93 Requires: libuuid-devel
96 Header files for sanlock libraries.
98 %description devel -l pl.UTF-8
99 Pliki nagłówkowe bibliotek sanlock.
101 %package -n python-sanlock
102 Summary: Python binding for sanlock library
103 Summary(pl.UTF-8): Wiązanie Pythona do biblioteki sanlock
104 Group: Libraries/Python
105 Requires: %{name}-libs = %{version}-%{release}
107 %description -n python-sanlock
108 Python binding for sanlock library.
110 %description -n python-sanlock -l pl.UTF-8
111 Wiązanie Pythona do biblioteki sanlock.
119 export CFLAGS="%{rpmcflags}"
121 CMD_LDFLAGS="%{rpmldflags}" \
122 LIB_LDFLAGS="%{rpmldflags}" \
126 CMD_LDFLAGS="%{rpmldflags}" \
127 LIB_CLIENT_LDFLAGS="%{rpmldflags}" \
128 LIB_ENTIRE_LDFLAGS="%{rpmldflags}" \
133 %{__make} -C fence_sanlock \
135 OPTIMIZE_FLAG="%{rpmcflags}"
140 LDFLAGS="%{rpmldflags}" \
141 OPTIMIZE_FLAG="%{rpmcflags}"
143 # note (as of 3.3.0): python3 is not supported
149 rm -rf $RPM_BUILD_ROOT
151 %{__make} -C wdmd install \
152 DESTDIR=$RPM_BUILD_ROOT \
155 %{__make} -C src install \
156 DESTDIR=$RPM_BUILD_ROOT \
159 %{__make} -C fence_sanlock install \
160 DESTDIR=$RPM_BUILD_ROOT \
163 %{__make} -C reset install \
164 DESTDIR=$RPM_BUILD_ROOT
170 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
172 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/rc.d/init.d}
173 install init.d/fence_sanlockd $RPM_BUILD_ROOT/etc/rc.d/init.d
174 install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
175 install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
176 for serv in sanlock wdmd fence_sanlockd ; do
177 sed -e "s,/lib/systemd/systemd-${serv},/etc/rc.d/init.d/${serv}," init.d/${serv}.service >$RPM_BUILD_ROOT%{systemdunitdir}/${serv}.service
179 cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
181 install -d $RPM_BUILD_ROOT/var/run/{sanlock,wdmd,fence_sanlock,fence_sanlockd}
182 install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir}
183 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/sanlock.conf <<EOF
184 d /var/run/sanlock 0775 sanlock sanlock -
185 d /var/run/wdmd 0775 root sanlock -
187 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/fence_sanlock.conf <<EOF
188 d /var/run/fence_sanlock 0755 root root -
189 d /var/run/fence_sanlockd 0755 root root -
192 # fix hardcoded libdir=${prefix}/lib64
193 %{__sed} -i -e 's,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
196 rm -rf $RPM_BUILD_ROOT
199 %groupadd -g 279 sanlock
200 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
203 /sbin/chkconfig --add sanlock
204 /sbin/chkconfig --add wdmd
205 %service sanlock restart
206 %service wdmd restart
209 if [ "$1" = "0" ]; then
210 %service -q sanlock stop
211 %service -q wdmd stop
212 /sbin/chkconfig --del sanlock
213 /sbin/chkconfig --del wdmd
217 if [ "$1" = "0" ]; then
222 %post -n fence-sanlock
223 /sbin/chkconfig --add fence_sanlock
224 %service fence_sanlock restart
225 if [ "$1" = "1" ]; then
226 ccs_update_schema >/dev/null 2>&1 || :
229 %preun -n fence-sanlock
230 if [ "$1" = "0" ]; then
231 %service -q fence_sanlock stop
232 /sbin/chkconfig --del fence_sanlock
235 %post libs -p /sbin/ldconfig
236 %postun libs -p /sbin/ldconfig
239 %defattr(644,root,root,755)
241 %attr(755,root,root) %{_sbindir}/sanlock
242 %attr(755,root,root) %{_sbindir}/wdmd
243 %attr(754,root,root) /etc/rc.d/init.d/sanlock
244 %attr(754,root,root) /etc/rc.d/init.d/wdmd
245 %{systemdunitdir}/sanlock.service
246 %{systemdunitdir}/wdmd.service
247 %{systemdtmpfilesdir}/sanlock.conf
248 %attr(775,sanlock,sanlock) %dir /var/run/sanlock
249 %attr(775,root,sanlock) %dir /var/run/wdmd
250 %{_mandir}/man8/sanlock.8*
251 %{_mandir}/man8/wdmd.8*
254 %defattr(644,root,root,755)
255 %attr(755,root,root) %{_sbindir}/sanlk-reset
256 %attr(755,root,root) %{_sbindir}/sanlk-resetd
257 %{systemdunitdir}/sanlk-resetd.service
258 %{_mandir}/man8/sanlk-reset.8*
259 %{_mandir}/man8/sanlk-resetd.8*
261 %files -n fence-sanlock
262 %defattr(644,root,root,755)
263 %attr(755,root,root) %{_sbindir}/fence_sanlock
264 %attr(755,root,root) %{_sbindir}/fence_sanlockd
265 %attr(754,root,root) /etc/rc.d/init.d/fence_sanlockd
266 %{systemdunitdir}/fence_sanlockd.service
267 %{systemdtmpfilesdir}/fence_sanlock.conf
268 %dir /var/run/fence_sanlock
269 %dir /var/run/fence_sanlockd
270 %{_mandir}/man8/fence_sanlock.8*
271 %{_mandir}/man8/fence_sanlockd.8*
274 %defattr(644,root,root,755)
275 %attr(755,root,root) %{_libdir}/libsanlock.so.*.*
276 %attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
277 %attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
278 %attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
279 %attr(755,root,root) %{_libdir}/libwdmd.so.*.*
280 %attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_libdir}/libsanlock.so
285 %attr(755,root,root) %{_libdir}/libsanlock_client.so
286 %attr(755,root,root) %{_libdir}/libwdmd.so
287 %{_includedir}/sanlock*.h
288 %{_includedir}/wdmd.h
289 %{_pkgconfigdir}/libsanlock.pc
290 %{_pkgconfigdir}/libsanlock_client.pc
292 %files -n python-sanlock
293 %defattr(644,root,root,755)
294 %attr(755,root,root) %{py_sitedir}/sanlock.so
295 %{py_sitedir}/sanlock_python-%{version}_-py*.egg-info