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