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: 567ab7aa5863ab56770c6f12ca4e41a3
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}
92 Header files for sanlock libraries.
94 %description devel -l pl.UTF-8
95 Pliki nagłówkowe bibliotek sanlock.
97 %package -n python-sanlock
98 Summary: Python binding for sanlock library
99 Summary(pl.UTF-8): Wiązanie Pythona do biblioteki sanlock
100 Group: Libraries/Python
101 Requires: %{name}-libs = %{version}-%{release}
103 %description -n python-sanlock
104 Python binding for sanlock library.
106 %description -n python-sanlock -l pl.UTF-8
107 Wiązanie Pythona do biblioteki sanlock.
115 export CFLAGS="%{rpmcflags}"
117 CMD_LDFLAGS="%{rpmldflags}" \
118 LIB_LDFLAGS="%{rpmldflags}" \
122 CMD_LDFLAGS="%{rpmldflags}" \
123 LIB_CLIENT_LDFLAGS="%{rpmldflags}" \
124 LIB_ENTIRE_LDFLAGS="%{rpmldflags}" \
129 %{__make} -C fence_sanlock \
131 OPTIMIZE_FLAG="%{rpmcflags}"
136 LDFLAGS="%{rpmldflags}" \
137 OPTIMIZE_FLAG="%{rpmcflags}"
142 rm -rf $RPM_BUILD_ROOT
144 %{__make} -C wdmd install \
145 DESTDIR=$RPM_BUILD_ROOT \
148 %{__make} -C src install \
149 DESTDIR=$RPM_BUILD_ROOT \
152 %{__make} -C fence_sanlock install \
153 DESTDIR=$RPM_BUILD_ROOT \
156 %{__make} -C reset install \
157 DESTDIR=$RPM_BUILD_ROOT
159 %{__make} -C python install \
160 DESTDIR=$RPM_BUILD_ROOT
162 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
164 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/rc.d/init.d}
165 install init.d/fence_sanlockd $RPM_BUILD_ROOT/etc/rc.d/init.d
166 install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
167 install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
168 for serv in sanlock wdmd fence_sanlockd ; do
169 sed -e "s,/lib/systemd/systemd-${serv},/etc/rc.d/init.d/${serv}," init.d/${serv}.service >$RPM_BUILD_ROOT%{systemdunitdir}/${serv}.service
171 cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
173 install -d $RPM_BUILD_ROOT/var/run/{sanlock,wdmd,fence_sanlock,fence_sanlockd}
174 install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir}
175 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/sanlock.conf <<EOF
176 d /var/run/sanlock 0775 sanlock sanlock -
177 d /var/run/wdmd 0775 root sanlock -
179 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/fence_sanlock.conf <<EOF
180 d /var/run/fence_sanlock 0755 root root -
181 d /var/run/fence_sanlockd 0755 root root -
185 rm -rf $RPM_BUILD_ROOT
188 %groupadd -g 279 sanlock
189 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
192 /sbin/chkconfig --add sanlock
193 /sbin/chkconfig --add wdmd
194 %service sanlock restart
195 %service wdmd restart
198 if [ "$1" = "0" ]; then
199 %service -q sanlock stop
200 %service -q wdmd stop
201 /sbin/chkconfig --del sanlock
202 /sbin/chkconfig --del wdmd
206 if [ "$1" = "0" ]; then
211 %post -n fence-sanlock
212 /sbin/chkconfig --add fence_sanlock
213 %service fence_sanlock restart
214 if [ "$1" = "1" ]; then
215 ccs_update_schema >/dev/null 2>&1 || :
218 %preun -n fence-sanlock
219 if [ "$1" = "0" ]; then
220 %service -q fence_sanlock stop
221 /sbin/chkconfig --del fence_sanlock
224 %post libs -p /sbin/ldconfig
225 %postun libs -p /sbin/ldconfig
228 %defattr(644,root,root,755)
230 %attr(755,root,root) %{_sbindir}/sanlock
231 %attr(755,root,root) %{_sbindir}/wdmd
232 %attr(754,root,root) /etc/rc.d/init.d/sanlock
233 %attr(754,root,root) /etc/rc.d/init.d/wdmd
234 %{systemdunitdir}/sanlock.service
235 %{systemdunitdir}/wdmd.service
236 %{systemdtmpfilesdir}/sanlock.conf
237 %attr(775,sanlock,sanlock) %dir /var/run/sanlock
238 %attr(775,root,sanlock) %dir /var/run/wdmd
239 %{_mandir}/man8/sanlock.8*
240 %{_mandir}/man8/wdmd.8*
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_sbindir}/sanlk-reset
245 %attr(755,root,root) %{_sbindir}/sanlk-resetd
246 %{systemdunitdir}/sanlk-resetd.service
247 %{_mandir}/man8/sanlk-reset.8*
248 %{_mandir}/man8/sanlk-resetd.8*
250 %files -n fence-sanlock
251 %defattr(644,root,root,755)
252 %attr(755,root,root) %{_sbindir}/fence_sanlock
253 %attr(755,root,root) %{_sbindir}/fence_sanlockd
254 %attr(754,root,root) /etc/rc.d/init.d/fence_sanlockd
255 %{systemdunitdir}/fence_sanlockd.service
256 %{systemdtmpfilesdir}/fence_sanlock.conf
257 %dir /var/run/fence_sanlock
258 %dir /var/run/fence_sanlockd
259 %{_mandir}/man8/fence_sanlock.8*
260 %{_mandir}/man8/fence_sanlockd.8*
263 %defattr(644,root,root,755)
264 %attr(755,root,root) %{_libdir}/libsanlock.so.*.*
265 %attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
266 %attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
267 %attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
268 %attr(755,root,root) %{_libdir}/libwdmd.so.*.*
269 %attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
272 %defattr(644,root,root,755)
273 %attr(755,root,root) %{_libdir}/libsanlock.so
274 %attr(755,root,root) %{_libdir}/libsanlock_client.so
275 %attr(755,root,root) %{_libdir}/libwdmd.so
276 %{_includedir}/sanlock*.h
277 %{_includedir}/wdmd.h
278 %{_pkgconfigdir}/libsanlock.pc
279 %{_pkgconfigdir}/libsanlock_client.pc
281 %files -n python-sanlock
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{py_sitedir}/sanlock.so
284 %{py_sitedir}/sanlock_python-%{version}_-py*.egg-info