]> git.pld-linux.org Git - packages/sanlock.git/blob - sanlock.spec
- updated to 3.4.0
[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.4.0
5 Release:        1
6 License:        LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
7 Group:          Networking
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:  d882beb5f188abff545b64cc3cbe9c79
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
22 BuildRequires:  xz
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)
34
35 %description
36 Shared storage lock manager.
37
38 %description -l pl.UTF-8
39 Zarządca blokad dla współdzielonego składowania danych.
40
41 %package reset
42 Summary:        Host reset daemon and client using sanlock
43 Summary(pl.UTF-8):      Demon resetujący hosta oraz klient wykorzystujący sanlocka
44 Group:          Daemons
45 Requires(post,preun):   /sbin/chkconfig
46 Requires:       %{name} = %{version}-%{release}
47
48 %description reset
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.
52
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.
58
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
62 Group:          Daemons
63 Requires(post,preun):   /sbin/chkconfig
64 Requires:       %{name} = %{version}-%{release}
65
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.
69
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.
73
74 %package libs
75 Summary:        Sanlock libraries
76 Summary(pl.UTF-8):      Biblioteki sanlock
77 Group:          Libraries
78
79 %description libs
80 Sanlock libraries.
81
82 %description libs -l pl.UTF-8
83 Biblioteki sanlock.
84
85 %package devel
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}
90 # for libsanlock
91 Requires:       libaio-devel
92 Requires:       libblkid-devel
93 Requires:       libuuid-devel
94
95 %description devel
96 Header files for sanlock libraries.
97
98 %description devel -l pl.UTF-8
99 Pliki nagłówkowe bibliotek sanlock.
100
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}
106
107 %description -n python-sanlock
108 Python binding for sanlock library.
109
110 %description -n python-sanlock -l pl.UTF-8
111 Wiązanie Pythona do biblioteki sanlock.
112
113 %prep
114 %setup -q
115 %patch0 -p1
116 %patch1 -p1
117
118 %build
119 export CFLAGS="%{rpmcflags}"
120
121 CMD_LDFLAGS="%{rpmldflags}" \
122 LIB_LDFLAGS="%{rpmldflags}" \
123 %{__make} -C wdmd \
124         CC="%{__cc}"
125
126 CMD_LDFLAGS="%{rpmldflags}" \
127 LIB_CLIENT_LDFLAGS="%{rpmldflags}" \
128 LIB_ENTIRE_LDFLAGS="%{rpmldflags}" \
129 %{__make} -C src \
130         CC="%{__cc}"
131
132 CFLAGS= \
133 %{__make} -C fence_sanlock \
134         CC="%{__cc}" \
135         OPTIMIZE_FLAG="%{rpmcflags}"
136
137 CFLAGS= \
138 %{__make} -C reset \
139         CC="%{__cc}" \
140         LDFLAGS="%{rpmldflags}" \
141         OPTIMIZE_FLAG="%{rpmcflags}"
142
143 # note (as of 3.3.0): python3 is not supported
144 cd python
145 %py_build
146 cd ..
147
148 %install
149 rm -rf $RPM_BUILD_ROOT
150
151 %{__make} -C wdmd install \
152         DESTDIR=$RPM_BUILD_ROOT \
153         LIBDIR=%{_libdir}
154
155 %{__make} -C src install \
156         DESTDIR=$RPM_BUILD_ROOT \
157         LIBDIR=%{_libdir}
158
159 %{__make} -C fence_sanlock install \
160         DESTDIR=$RPM_BUILD_ROOT \
161         LIBDIR=%{_libdir}
162
163 %{__make} -C reset install \
164         DESTDIR=$RPM_BUILD_ROOT
165
166 cd python
167 %py_install
168 cd ..
169
170 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
171
172 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/rc.d/init.d}
173 install init.d/fence_sanlockd $RPM_BUILD_ROOT/etc/rc.d/init.d
174 install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
175 install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
176 for serv in sanlock wdmd fence_sanlockd ; do
177         sed -e "s,/lib/systemd/systemd-${serv},/etc/rc.d/init.d/${serv}," init.d/${serv}.service >$RPM_BUILD_ROOT%{systemdunitdir}/${serv}.service
178 done
179 cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
180
181 install -d $RPM_BUILD_ROOT/var/run/{sanlock,wdmd,fence_sanlock,fence_sanlockd}
182 install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir}
183 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/sanlock.conf <<EOF
184 d /var/run/sanlock 0775 sanlock sanlock -
185 d /var/run/wdmd 0775 root sanlock -
186 EOF
187 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/fence_sanlock.conf <<EOF
188 d /var/run/fence_sanlock 0755 root root -
189 d /var/run/fence_sanlockd 0755 root root -
190 EOF
191
192 # fix hardcoded libdir=${prefix}/lib64
193 %{__sed} -i -e 's,^libdir=.*,libdir=%{_libdir},' $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %pre
199 %groupadd -g 279 sanlock
200 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
201
202 %post
203 /sbin/chkconfig --add sanlock
204 /sbin/chkconfig --add wdmd
205 %service sanlock restart
206 %service wdmd restart
207
208 %preun
209 if [ "$1" = "0" ]; then
210         %service -q sanlock stop
211         %service -q wdmd stop
212         /sbin/chkconfig --del sanlock
213         /sbin/chkconfig --del wdmd
214 fi
215
216 %postun
217 if [ "$1" = "0" ]; then
218         %userremove sanlock
219         %groupremove sanlock
220 fi
221
222 %post -n fence-sanlock
223 /sbin/chkconfig --add fence_sanlock
224 %service fence_sanlock restart
225 if [ "$1" = "1" ]; then
226         ccs_update_schema >/dev/null 2>&1 || :
227 fi
228
229 %preun -n fence-sanlock
230 if [ "$1" = "0" ]; then
231         %service -q fence_sanlock stop
232         /sbin/chkconfig --del fence_sanlock
233 fi
234
235 %post   libs -p /sbin/ldconfig
236 %postun libs -p /sbin/ldconfig
237
238 %files
239 %defattr(644,root,root,755)
240 %doc README.license
241 %attr(755,root,root) %{_sbindir}/sanlock
242 %attr(755,root,root) %{_sbindir}/wdmd
243 %attr(754,root,root) /etc/rc.d/init.d/sanlock
244 %attr(754,root,root) /etc/rc.d/init.d/wdmd
245 %{systemdunitdir}/sanlock.service
246 %{systemdunitdir}/wdmd.service
247 %{systemdtmpfilesdir}/sanlock.conf
248 %attr(775,sanlock,sanlock) %dir /var/run/sanlock
249 %attr(775,root,sanlock) %dir /var/run/wdmd
250 %{_mandir}/man8/sanlock.8*
251 %{_mandir}/man8/wdmd.8*
252
253 %files reset
254 %defattr(644,root,root,755)
255 %attr(755,root,root) %{_sbindir}/sanlk-reset
256 %attr(755,root,root) %{_sbindir}/sanlk-resetd
257 %{systemdunitdir}/sanlk-resetd.service
258 %{_mandir}/man8/sanlk-reset.8*
259 %{_mandir}/man8/sanlk-resetd.8*
260
261 %files -n fence-sanlock
262 %defattr(644,root,root,755)
263 %attr(755,root,root) %{_sbindir}/fence_sanlock
264 %attr(755,root,root) %{_sbindir}/fence_sanlockd
265 %attr(754,root,root) /etc/rc.d/init.d/fence_sanlockd
266 %{systemdunitdir}/fence_sanlockd.service
267 %{systemdtmpfilesdir}/fence_sanlock.conf
268 %dir /var/run/fence_sanlock
269 %dir /var/run/fence_sanlockd
270 %{_mandir}/man8/fence_sanlock.8*
271 %{_mandir}/man8/fence_sanlockd.8*
272
273 %files libs
274 %defattr(644,root,root,755)
275 %attr(755,root,root) %{_libdir}/libsanlock.so.*.*
276 %attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
277 %attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
278 %attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
279 %attr(755,root,root) %{_libdir}/libwdmd.so.*.*
280 %attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
281
282 %files devel
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_libdir}/libsanlock.so
285 %attr(755,root,root) %{_libdir}/libsanlock_client.so
286 %attr(755,root,root) %{_libdir}/libwdmd.so
287 %{_includedir}/sanlock*.h
288 %{_includedir}/wdmd.h
289 %{_pkgconfigdir}/libsanlock.pc
290 %{_pkgconfigdir}/libsanlock_client.pc
291
292 %files -n python-sanlock
293 %defattr(644,root,root,755)
294 %attr(755,root,root) %{py_sitedir}/sanlock.so
295 %{py_sitedir}/sanlock_python-%{version}_-py*.egg-info
This page took 0.099159 seconds and 3 git commands to generate.