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}
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}"
146 rm -rf $RPM_BUILD_ROOT
148 %{__make} -C wdmd install \
149 DESTDIR=$RPM_BUILD_ROOT \
152 %{__make} -C src install \
153 DESTDIR=$RPM_BUILD_ROOT \
156 %{__make} -C fence_sanlock install \
157 DESTDIR=$RPM_BUILD_ROOT \
160 %{__make} -C reset install \
161 DESTDIR=$RPM_BUILD_ROOT
163 %{__make} -C python install \
164 DESTDIR=$RPM_BUILD_ROOT
166 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
168 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/rc.d/init.d}
169 install init.d/fence_sanlockd $RPM_BUILD_ROOT/etc/rc.d/init.d
170 install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
171 install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
172 for serv in sanlock wdmd fence_sanlockd ; do
173 sed -e "s,/lib/systemd/systemd-${serv},/etc/rc.d/init.d/${serv}," init.d/${serv}.service >$RPM_BUILD_ROOT%{systemdunitdir}/${serv}.service
175 cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
177 install -d $RPM_BUILD_ROOT/var/run/{sanlock,wdmd,fence_sanlock,fence_sanlockd}
178 install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir}
179 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/sanlock.conf <<EOF
180 d /var/run/sanlock 0775 sanlock sanlock -
181 d /var/run/wdmd 0775 root sanlock -
183 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/fence_sanlock.conf <<EOF
184 d /var/run/fence_sanlock 0755 root root -
185 d /var/run/fence_sanlockd 0755 root root -
188 # fix hardcoded libdir=${prefix}/lib64
189 %{__sed} -i -e 's,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
192 rm -rf $RPM_BUILD_ROOT
195 %groupadd -g 279 sanlock
196 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
199 /sbin/chkconfig --add sanlock
200 /sbin/chkconfig --add wdmd
201 %service sanlock restart
202 %service wdmd restart
205 if [ "$1" = "0" ]; then
206 %service -q sanlock stop
207 %service -q wdmd stop
208 /sbin/chkconfig --del sanlock
209 /sbin/chkconfig --del wdmd
213 if [ "$1" = "0" ]; then
218 %post -n fence-sanlock
219 /sbin/chkconfig --add fence_sanlock
220 %service fence_sanlock restart
221 if [ "$1" = "1" ]; then
222 ccs_update_schema >/dev/null 2>&1 || :
225 %preun -n fence-sanlock
226 if [ "$1" = "0" ]; then
227 %service -q fence_sanlock stop
228 /sbin/chkconfig --del fence_sanlock
231 %post libs -p /sbin/ldconfig
232 %postun libs -p /sbin/ldconfig
235 %defattr(644,root,root,755)
237 %attr(755,root,root) %{_sbindir}/sanlock
238 %attr(755,root,root) %{_sbindir}/wdmd
239 %attr(754,root,root) /etc/rc.d/init.d/sanlock
240 %attr(754,root,root) /etc/rc.d/init.d/wdmd
241 %{systemdunitdir}/sanlock.service
242 %{systemdunitdir}/wdmd.service
243 %{systemdtmpfilesdir}/sanlock.conf
244 %attr(775,sanlock,sanlock) %dir /var/run/sanlock
245 %attr(775,root,sanlock) %dir /var/run/wdmd
246 %{_mandir}/man8/sanlock.8*
247 %{_mandir}/man8/wdmd.8*
250 %defattr(644,root,root,755)
251 %attr(755,root,root) %{_sbindir}/sanlk-reset
252 %attr(755,root,root) %{_sbindir}/sanlk-resetd
253 %{systemdunitdir}/sanlk-resetd.service
254 %{_mandir}/man8/sanlk-reset.8*
255 %{_mandir}/man8/sanlk-resetd.8*
257 %files -n fence-sanlock
258 %defattr(644,root,root,755)
259 %attr(755,root,root) %{_sbindir}/fence_sanlock
260 %attr(755,root,root) %{_sbindir}/fence_sanlockd
261 %attr(754,root,root) /etc/rc.d/init.d/fence_sanlockd
262 %{systemdunitdir}/fence_sanlockd.service
263 %{systemdtmpfilesdir}/fence_sanlock.conf
264 %dir /var/run/fence_sanlock
265 %dir /var/run/fence_sanlockd
266 %{_mandir}/man8/fence_sanlock.8*
267 %{_mandir}/man8/fence_sanlockd.8*
270 %defattr(644,root,root,755)
271 %attr(755,root,root) %{_libdir}/libsanlock.so.*.*
272 %attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
273 %attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
274 %attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
275 %attr(755,root,root) %{_libdir}/libwdmd.so.*.*
276 %attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_libdir}/libsanlock.so
281 %attr(755,root,root) %{_libdir}/libsanlock_client.so
282 %attr(755,root,root) %{_libdir}/libwdmd.so
283 %{_includedir}/sanlock*.h
284 %{_includedir}/wdmd.h
285 %{_pkgconfigdir}/libsanlock.pc
286 %{_pkgconfigdir}/libsanlock_client.pc
288 %files -n python-sanlock
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{py_sitedir}/sanlock.so
291 %{py_sitedir}/sanlock_python-%{version}_-py*.egg-info