]> git.pld-linux.org Git - packages/sanlock.git/blob - sanlock.spec
- updated to 3.2.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.2.4
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:  567ab7aa5863ab56770c6f12ca4e41a3
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
91 %description devel
92 Header files for sanlock libraries.
93
94 %description devel -l pl.UTF-8
95 Pliki nagłówkowe bibliotek sanlock.
96
97 %package -n python-sanlock
98 Summary:        Python binding for sanlock library
99 Summary(pl.UTF-8):      Wiązanie Pythona do biblioteki sanlock
100 Group:          Libraries/Python
101 Requires:       %{name}-libs = %{version}-%{release}
102
103 %description -n python-sanlock
104 Python binding for sanlock library.
105
106 %description -n python-sanlock -l pl.UTF-8
107 Wiązanie Pythona do biblioteki sanlock.
108
109 %prep
110 %setup -q
111 %patch0 -p1
112 %patch1 -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 %{__make} -C python
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143
144 %{__make} -C wdmd install \
145         DESTDIR=$RPM_BUILD_ROOT \
146         LIBDIR=%{_libdir}
147
148 %{__make} -C src install \
149         DESTDIR=$RPM_BUILD_ROOT \
150         LIBDIR=%{_libdir}
151
152 %{__make} -C fence_sanlock install \
153         DESTDIR=$RPM_BUILD_ROOT \
154         LIBDIR=%{_libdir}
155
156 %{__make} -C reset install \
157         DESTDIR=$RPM_BUILD_ROOT
158
159 %{__make} -C python install \
160         DESTDIR=$RPM_BUILD_ROOT
161
162 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
163
164 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/rc.d/init.d}
165 install init.d/fence_sanlockd $RPM_BUILD_ROOT/etc/rc.d/init.d
166 install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
167 install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
168 for serv in sanlock wdmd fence_sanlockd ; do
169         sed -e "s,/lib/systemd/systemd-${serv},/etc/rc.d/init.d/${serv}," init.d/${serv}.service >$RPM_BUILD_ROOT%{systemdunitdir}/${serv}.service
170 done
171 cp -p init.d/sanlk-resetd.service $RPM_BUILD_ROOT%{systemdunitdir}
172
173 install -d $RPM_BUILD_ROOT/var/run/{sanlock,wdmd,fence_sanlock,fence_sanlockd}
174 install -d $RPM_BUILD_ROOT%{systemdtmpfilesdir}
175 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/sanlock.conf <<EOF
176 d /var/run/sanlock 0775 sanlock sanlock -
177 d /var/run/wdmd 0775 root sanlock -
178 EOF
179 cat >$RPM_BUILD_ROOT%{systemdtmpfilesdir}/fence_sanlock.conf <<EOF
180 d /var/run/fence_sanlock 0755 root root -
181 d /var/run/fence_sanlockd 0755 root root -
182 EOF
183
184 %clean
185 rm -rf $RPM_BUILD_ROOT
186
187 %pre
188 %groupadd -g 279 sanlock
189 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
190
191 %post
192 /sbin/chkconfig --add sanlock
193 /sbin/chkconfig --add wdmd
194 %service sanlock restart
195 %service wdmd restart
196
197 %preun
198 if [ "$1" = "0" ]; then
199         %service -q sanlock stop
200         %service -q wdmd stop
201         /sbin/chkconfig --del sanlock
202         /sbin/chkconfig --del wdmd
203 fi
204
205 %postun
206 if [ "$1" = "0" ]; then
207         %userremove sanlock
208         %groupremove sanlock
209 fi
210
211 %post -n fence-sanlock
212 /sbin/chkconfig --add fence_sanlock
213 %service fence_sanlock restart
214 if [ "$1" = "1" ]; then
215         ccs_update_schema >/dev/null 2>&1 || :
216 fi
217
218 %preun -n fence-sanlock
219 if [ "$1" = "0" ]; then
220         %service -q fence_sanlock stop
221         /sbin/chkconfig --del fence_sanlock
222 fi
223
224 %post   libs -p /sbin/ldconfig
225 %postun libs -p /sbin/ldconfig
226
227 %files
228 %defattr(644,root,root,755)
229 %doc README.license
230 %attr(755,root,root) %{_sbindir}/sanlock
231 %attr(755,root,root) %{_sbindir}/wdmd
232 %attr(754,root,root) /etc/rc.d/init.d/sanlock
233 %attr(754,root,root) /etc/rc.d/init.d/wdmd
234 %{systemdunitdir}/sanlock.service
235 %{systemdunitdir}/wdmd.service
236 %{systemdtmpfilesdir}/sanlock.conf
237 %attr(775,sanlock,sanlock) %dir /var/run/sanlock
238 %attr(775,root,sanlock) %dir /var/run/wdmd
239 %{_mandir}/man8/sanlock.8*
240 %{_mandir}/man8/wdmd.8*
241
242 %files reset
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_sbindir}/sanlk-reset
245 %attr(755,root,root) %{_sbindir}/sanlk-resetd
246 %{systemdunitdir}/sanlk-resetd.service
247 %{_mandir}/man8/sanlk-reset.8*
248 %{_mandir}/man8/sanlk-resetd.8*
249
250 %files -n fence-sanlock
251 %defattr(644,root,root,755)
252 %attr(755,root,root) %{_sbindir}/fence_sanlock
253 %attr(755,root,root) %{_sbindir}/fence_sanlockd
254 %attr(754,root,root) /etc/rc.d/init.d/fence_sanlockd
255 %{systemdunitdir}/fence_sanlockd.service
256 %{systemdtmpfilesdir}/fence_sanlock.conf
257 %dir /var/run/fence_sanlock
258 %dir /var/run/fence_sanlockd
259 %{_mandir}/man8/fence_sanlock.8*
260 %{_mandir}/man8/fence_sanlockd.8*
261
262 %files libs
263 %defattr(644,root,root,755)
264 %attr(755,root,root) %{_libdir}/libsanlock.so.*.*
265 %attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
266 %attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
267 %attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
268 %attr(755,root,root) %{_libdir}/libwdmd.so.*.*
269 %attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
270
271 %files devel
272 %defattr(644,root,root,755)
273 %attr(755,root,root) %{_libdir}/libsanlock.so
274 %attr(755,root,root) %{_libdir}/libsanlock_client.so
275 %attr(755,root,root) %{_libdir}/libwdmd.so
276 %{_includedir}/sanlock*.h
277 %{_includedir}/wdmd.h
278 %{_pkgconfigdir}/libsanlock.pc
279 %{_pkgconfigdir}/libsanlock_client.pc
280
281 %files -n python-sanlock
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{py_sitedir}/sanlock.so
284 %{py_sitedir}/sanlock_python-%{version}_-py*.egg-info
This page took 0.050497 seconds and 4 git commands to generate.