]> git.pld-linux.org Git - packages/sanlock.git/blob - sanlock.spec
- updated to 2.3
[packages/sanlock.git] / sanlock.spec
1 # TODO: systemd support (there are init.d/*.service, but they refer to unknown /lib/systemd/systemd-sanlock)
2 Summary:        Shared storage lock manager
3 Summary(pl.UTF-8):      Zarządca blokad dla współdzielonego składowania danych
4 Name:           sanlock
5 Version:        2.3
6 Release:        1
7 License:        LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
8 Group:          Networking
9 Source0:        https://fedorahosted.org/releases/s/a/sanlock/%{name}-%{version}.tar.gz
10 # Source0-md5:  17ddc7c7b9dfab30e82890b6d14cda57
11 Patch0:         %{name}-link.patch
12 Patch1:         %{name}-init-pld.patch
13 URL:            https://fedorahosted.org/sanlock/
14 BuildRequires:  gcc >= 5:3.4
15 BuildRequires:  libaio-devel
16 BuildRequires:  libblkid-devel
17 BuildRequires:  libuuid-devel
18 BuildRequires:  python-devel
19 BuildRequires:  rpmbuild(macros) >= 1.228
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 libs
39 Summary:        Sanlock libraries
40 Summary(pl.UTF-8):      Biblioteki sanlock
41 Group:          Libraries
42
43 %description libs
44 Sanlock libraries.
45
46 %description libs -l pl.UTF-8
47 Biblioteki sanlock.
48
49 %package devel
50 Summary:        Header files for sanlock libraries
51 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek sanlock
52 Group:          Development/Libraries
53 Requires:       %{name}-libs = %{version}-%{release}
54
55 %description devel
56 Header files for sanlock libraries.
57
58 %description devel -l pl.UTF-8
59 Pliki nagłówkowe bibliotek sanlock.
60
61 %package -n python-sanlock
62 Summary:        Python binding for sanlock library
63 Summary(pl.UTF-8):      Wiązanie Pythona do biblioteki sanlock
64 Group:          Libraries/Python
65 Requires:       %{name}-libs = %{version}-%{release}
66
67 %description -n python-sanlock
68 Python binding for sanlock library.
69
70 %description -n python-sanlock -l pl.UTF-8
71 Wiązanie Pythona do biblioteki sanlock.
72
73 %prep
74 %setup -q
75 %patch0 -p1
76 %patch1 -p1
77
78 %build
79 export CFLAGS="%{rpmcflags}"
80
81 CMD_LDFLAGS="%{rpmldflags}" \
82 LIB_LDFLAGS="%{rpmldflags}" \
83 %{__make} -C wdmd \
84         CC="%{__cc}"
85
86 CMD_LDFLAGS="%{rpmldflags}" \
87 LIB_CLIENT_LDFLAGS="%{rpmldflags}" \
88 LIB_ENTIRE_LDFLAGS="%{rpmldflags}" \
89 %{__make} -C src \
90         CC="%{__cc}"
91
92 %{__make} -C python
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96
97 %{__make} -C wdmd install \
98         DESTDIR=$RPM_BUILD_ROOT \
99         LIBDIR=%{_libdir}
100
101 %{__make} -C src install \
102         DESTDIR=$RPM_BUILD_ROOT \
103         LIBDIR=%{_libdir}
104
105 %{__make} -C python install \
106         DESTDIR=$RPM_BUILD_ROOT
107
108 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
109
110 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/run/{sanlock,wdmd}}
111 install init.d/sanlock $RPM_BUILD_ROOT/etc/rc.d/init.d
112 install init.d/wdmd $RPM_BUILD_ROOT/etc/rc.d/init.d
113
114 install -d $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
115 cat >$RPM_BUILD_ROOT/usr/lib/tmpfiles.d/sanlock.conf <<EOF
116 d /var/run/sanlock 0775 root root -
117 d /var/run/wdmd 0755 root root -
118 EOF
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %pre
124 %groupadd -g 279 sanlock
125 %useradd -u 279 -g 279 -d /usr/share/empty -s /bin/false -c 'SANlock user' sanlock
126
127 %post
128 /sbin/chkconfig --add sanlock
129 /sbin/chkconfig --add wdmd
130 %service sanlock restart
131 %service wdmd restart
132
133 %preun
134 if [ "$1" = "0" ]; then
135         %service -q sanlock stop
136         %service -q wdmd stop
137         /sbin/chkconfig --del sanlock
138         /sbin/chkconfig --del wdmd
139 fi
140
141 %postun
142 if [ "$1" = "0" ]; then
143         %userremove sanlock
144         %groupremove sanlock
145 fi
146
147 %post   libs -p /sbin/ldconfig
148 %postun libs -p /sbin/ldconfig
149
150 %files
151 %defattr(644,root,root,755)
152 %doc README.license
153 %attr(755,root,root) %{_sbindir}/sanlock
154 %attr(755,root,root) %{_sbindir}/wdmd
155 %attr(754,root,root) /etc/rc.d/init.d/sanlock
156 %attr(754,root,root) /etc/rc.d/init.d/wdmd
157 /usr/lib/tmpfiles.d/sanlock.conf
158 %attr(775,sanlock,sanlock) %dir /var/run/sanlock
159 %dir /var/run/wdmd
160 %{_mandir}/man8/sanlock.8*
161 %{_mandir}/man8/wdmd.8*
162
163 %files libs
164 %defattr(644,root,root,755)
165 %attr(755,root,root) %{_libdir}/libsanlock.so.*.*
166 %attr(755,root,root) %ghost %{_libdir}/libsanlock.so.1
167 %attr(755,root,root) %{_libdir}/libsanlock_client.so.*.*
168 %attr(755,root,root) %ghost %{_libdir}/libsanlock_client.so.1
169 %attr(755,root,root) %{_libdir}/libwdmd.so.*.*
170 %attr(755,root,root) %ghost %{_libdir}/libwdmd.so.1
171
172 %files devel
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{_libdir}/libsanlock.so
175 %attr(755,root,root) %{_libdir}/libsanlock_client.so
176 %attr(755,root,root) %{_libdir}/libwdmd.so
177 %{_includedir}/sanlock*.h
178 %{_includedir}/wdmd.h
179
180 %files -n python-sanlock
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{py_sitedir}/sanlock.so
183 %{py_sitedir}/Sanlock-1.0-py*.egg-info
This page took 0.055346 seconds and 4 git commands to generate.