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