]> git.pld-linux.org Git - packages/sanlock.git/blob - sanlock.spec
- updated to 3.8.4
[packages/sanlock.git] / sanlock.spec
1 Summary:        Shared storage lock manager
2 Summary(pl.UTF-8):      Zarządca blokad dla współdzielonego składowania danych
3 Name:           sanlock
4 Version:        3.8.4
5 Release:        1
6 License:        LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
7 Group:          Networking
8 Source0:        https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
9 # Source0-md5:  c064756c07a86e83119cfdd7695cf449
10 Patch0:         %{name}-init-pld.patch
11 URL:            https://pagure.io/sanlock
12 BuildRequires:  gcc >= 5:3.4
13 BuildRequires:  libaio-devel
14 BuildRequires:  libblkid-devel
15 BuildRequires:  libuuid-devel
16 BuildRequires:  python-devel
17 BuildRequires:  rpmbuild(macros) >= 1.228
18 BuildRequires:  tar >= 1:1.22
19 BuildRequires:  xz
20 Requires(post,preun):   /sbin/chkconfig
21 Requires(postun):       /usr/sbin/groupdel
22 Requires(postun):       /usr/sbin/userdel
23 Requires(pre):  /bin/id
24 Requires(pre):  /usr/bin/getgid
25 Requires(pre):  /usr/sbin/groupadd
26 Requires(pre):  /usr/sbin/useradd
27 Requires:       %{name}-libs = %{version}-%{release}
28 Provides:       group(sanlock)
29 Provides:       user(sanlock)
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 Shared storage lock manager.
34
35 %description -l pl.UTF-8
36 Zarządca blokad dla współdzielonego składowania danych.
37
38 %package reset
39 Summary:        Host reset daemon and client using sanlock
40 Summary(pl.UTF-8):      Demon resetujący hosta oraz klient wykorzystujący sanlocka
41 Group:          Daemons
42 Requires(post,preun):   /sbin/chkconfig
43 Requires:       %{name} = %{version}-%{release}
44
45 %description reset
46 This package contains the reset daemon and client. A cooperating host
47 running the daemon can be reset by a host running the client, so long
48 as both maintain access to a common sanlock lockspace.
49
50 %description reset -l pl.UTF-8
51 Ten pakiet zawiera demona oraz klienta resetującego. Współpracujący
52 host z działającym demonem może być zresetowany przez host z
53 działającym klientem tak długo, jak oba mają dostęp do wspólnej
54 przestrzeni blokad sanlock.
55
56 %package -n fence-sanlock
57 Summary:        Fence agent using sanlock and wdmd
58 Summary(pl.UTF-8):      Agent barier wykorzystujący sanlocka oraz wdmd
59 Group:          Daemons
60 Requires(post,preun):   /sbin/chkconfig
61 Requires:       %{name} = %{version}-%{release}
62
63 %description -n fence-sanlock
64 This package contains the fence agent and daemon for using sanlock and
65 wdmd as a cluster fence agent.
66
67 %description -n fence-sanlock -l pl.UTF-8
68 Ten pakiet zawiera agenta oraz demona barier do użytku z sanlockiem
69 oraz wdmd jako agent barier w klastrze.
70
71 %package libs
72 Summary:        Sanlock libraries
73 Summary(pl.UTF-8):      Biblioteki sanlock
74 Group:          Libraries
75
76 %description libs
77 Sanlock libraries.
78
79 %description libs -l pl.UTF-8
80 Biblioteki sanlock.
81
82 %package devel
83 Summary:        Header files for sanlock libraries
84 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek sanlock
85 Group:          Development/Libraries
86 Requires:       %{name}-libs = %{version}-%{release}
87 # for libsanlock
88 Requires:       libaio-devel
89 Requires:       libblkid-devel
90 Requires:       libuuid-devel
91
92 %description devel
93 Header files for sanlock libraries.
94
95 %description devel -l pl.UTF-8
96 Pliki nagłówkowe bibliotek sanlock.
97
98 %package -n python-sanlock
99 Summary:        Python binding for sanlock library
100 Summary(pl.UTF-8):      Wiązanie Pythona do biblioteki sanlock
101 Group:          Libraries/Python
102 Requires:       %{name}-libs = %{version}-%{release}
103
104 %description -n python-sanlock
105 Python binding for sanlock library.
106
107 %description -n python-sanlock -l pl.UTF-8
108 Wiązanie Pythona do biblioteki sanlock.
109
110 %prep
111 %setup -q
112 %patch0 -p1
113
114 %build
115 export CFLAGS="%{rpmcflags}"
116
117 CMD_LDFLAGS="%{rpmldflags}" \
118 LIB_LDFLAGS="%{rpmldflags}" \
119 %{__make} -C wdmd \
120         CC="%{__cc}"
121
122 CMD_LDFLAGS="%{rpmldflags}" \
123 LIB_CLIENT_LDFLAGS="%{rpmldflags}" \
124 LIB_ENTIRE_LDFLAGS="%{rpmldflags}" \
125 %{__make} -C src \
126         CC="%{__cc}"
127
128 CFLAGS= \
129 %{__make} -C fence_sanlock \
130         CC="%{__cc}" \
131         OPTIMIZE_FLAG="%{rpmcflags}"
132
133 CFLAGS= \
134 %{__make} -C reset \
135         CC="%{__cc}" \
136         LDFLAGS="%{rpmldflags}" \
137         OPTIMIZE_FLAG="%{rpmcflags}"
138
139 # note (as of 3.3.0): python3 is not supported
140 cd python
141 %py_build
142 cd ..
143
144 %install
145 rm -rf $RPM_BUILD_ROOT
146
147 %{__make} -C wdmd install \
148         DESTDIR=$RPM_BUILD_ROOT \
149         LIBDIR=%{_libdir}
150
151 %{__make} -C src install \
152         DESTDIR=$RPM_BUILD_ROOT \
153         LIBDIR=%{_libdir}
154
155 %{__make} -C fence_sanlock install \
156         DESTDIR=$RPM_BUILD_ROOT \
157         LIBDIR=%{_libdir}
158
159 %{__make} -C reset install \
160         DESTDIR=$RPM_BUILD_ROOT
161
162 cd python
163 %py_install
164 cd ..
165
166 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
167
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
174 done
175 cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
176
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 -
182 EOF
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 -
186 EOF
187
188 # fix hardcoded libdir=${prefix}/lib64
189 %{__sed} -i -e 's,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
190
191 %clean
192 rm -rf $RPM_BUILD_ROOT
193
194 %pre
195 %groupadd -g 279 sanlock
196 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
197
198 %post
199 /sbin/chkconfig --add sanlock
200 /sbin/chkconfig --add wdmd
201 %service sanlock restart
202 %service wdmd restart
203
204 %preun
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
210 fi
211
212 %postun
213 if [ "$1" = "0" ]; then
214         %userremove sanlock
215         %groupremove sanlock
216 fi
217
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 || :
223 fi
224
225 %preun -n fence-sanlock
226 if [ "$1" = "0" ]; then
227         %service -q fence_sanlock stop
228         /sbin/chkconfig --del fence_sanlock
229 fi
230
231 %post   libs -p /sbin/ldconfig
232 %postun libs -p /sbin/ldconfig
233
234 %files
235 %defattr(644,root,root,755)
236 %doc README.license
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*
248
249 %files reset
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*
256
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*
268
269 %files libs
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
277
278 %files devel
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
287
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
This page took 0.081487 seconds and 3 git commands to generate.