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