]>
Commit | Line | Data |
---|---|---|
e3a928dc | 1 | # TODO |
e3a928dc | 2 | # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted) |
dab0ac18 JB |
3 | # - internal vs shared for cluster,snapshots,mirrors,thin,cache ? |
4 | # note: dmeventd requires mirrors=internal) | |
1b67453e | 5 | # |
99958222 | 6 | # Conditional build: |
e2727f8c | 7 | # - initrd stuff |
54ec8eef | 8 | %bcond_with initrd # build initrd version |
54ec8eef | 9 | # - functionality |
bac719c6 | 10 | %bcond_without cluster # disable all cluster support (cmirrord) |
e2727f8c JB |
11 | %bcond_without lvmdbusd # lvmdbusd |
12 | %bcond_without lvmpolld # lvmpolld (and lvmlockd) | |
13 | %bcond_without lvmlockd # lvmlockd | |
54ec8eef | 14 | %bcond_with sanlock # sanlock support in lvmlockd |
54ec8eef JB |
15 | # - additional features |
16 | %bcond_without selinux # SELinux support | |
17 | # - bindings | |
e2727f8c JB |
18 | %bcond_without python # Python bindings |
19 | %bcond_without python2 # Python 2 binding | |
20 | %bcond_without python3 # Python 3 binding and lvmdbusd | |
c70b42f6 | 21 | |
bac719c6 AM |
22 | # lvmlockd requires lvmpolld |
23 | %if %{without lvmpolld} | |
54ec8eef | 24 | %undefine with_lvmpolld |
66800f6a | 25 | %endif |
c70b42f6 | 26 | |
e2727f8c JB |
27 | # for convenience |
28 | %if %{without python} | |
29 | %undefine with_python2 | |
30 | %undefine with_python3 | |
31 | %endif | |
32 | %if %{without python3} | |
33 | %undefine with_lvmdbusd | |
34 | %endif | |
f1e27504 | 35 | |
5672aa67 | 36 | Summary: The new version of Logical Volume Manager for Linux |
6536e848 | 37 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa |
7e72c866 | 38 | Name: lvm2 |
560fdb5f | 39 | Version: 2.03.08 |
761db061 | 40 | Release: 1 |
0a81c260 | 41 | License: GPL v2 and LGPL v2.1 |
7e72c866 | 42 | Group: Applications/System |
b1b9ab67 | 43 | Source0: ftp://sourceware.org/pub/lvm2/LVM2.%{version}.tgz |
560fdb5f | 44 | # Source0-md5: 92691c782db85150a05f2452ab10825c |
e2c3c533 JP |
45 | Patch0: device-mapper-dmsetup-export.patch |
46 | Patch1: %{name}-pld_init.patch | |
47 | Patch2: device-mapper-dmsetup-deps-export.patch | |
48 | Patch3: %{name}-thin.patch | |
d3e9e60b | 49 | Patch4: paths.patch |
35a842cf | 50 | URL: http://www.sourceware.org/lvm2/ |
e2727f8c | 51 | BuildRequires: autoconf >= 2.69 |
7e72c866 | 52 | BuildRequires: automake |
54ec8eef JB |
53 | # for /run detection |
54 | BuildRequires: filesystem >= 3.0-43 | |
dab0ac18 | 55 | BuildRequires: libaio-devel |
35a842cf | 56 | BuildRequires: libblkid-devel >= 2.24 |
0dc2b8f2 | 57 | %{?with_selinux:BuildRequires: libselinux-devel >= 1.10} |
e4a12efb | 58 | %{?with_selinux:BuildRequires: libsepol-devel} |
5f0ee085 | 59 | BuildRequires: ncurses-devel |
3657a56d | 60 | BuildRequires: pkgconfig |
e2727f8c JB |
61 | %{?with_python2:BuildRequires: python-devel >= 2} |
62 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
63 | %if %{with lvmdbusd} | |
64 | BuildRequires: python3-dbus | |
3f157960 | 65 | BuildRequires: python3-pyudev |
e2727f8c | 66 | %endif |
5f0ee085 | 67 | BuildRequires: readline-devel |
b5640c74 | 68 | BuildRequires: rpmbuild(macros) >= 1.647 |
e2727f8c | 69 | %{?with_sanlock:BuildRequires: sanlock-devel >= 3.3.0} |
b7318447 | 70 | BuildRequires: systemd-devel >= 1:221 |
35a842cf | 71 | BuildRequires: udev-devel >= 1:176 |
1ccfba6c | 72 | %if %{with initrd} |
b64b85c5 ER |
73 | %{?with_selinux:BuildRequires: libselinux-static} |
74 | %{?with_selinux:BuildRequires: libsepol-static} | |
bac719c6 | 75 | BuildRequires: glibc-static |
8a4b1939 AM |
76 | %else |
77 | Obsoletes: lvm2-initrd | |
1ccfba6c | 78 | %endif |
7e873dd0 | 79 | %if %{with cluster} |
5f0ee085 | 80 | BuildRequires: corosync-devel |
4cb4934b | 81 | BuildRequires: dlm-devel >= 3.99.5 |
5f0ee085 | 82 | %endif |
b5640c74 | 83 | Requires(post,preun,postun): systemd-units >= 38 |
0a81c260 | 84 | Requires(post,postun): /sbin/chkconfig |
b167057a | 85 | Requires: device-mapper >= %{version}-%{release} |
0dc2b8f2 | 86 | %{?with_selinux:Requires: libselinux >= 1.10} |
b5640c74 | 87 | Requires: systemd-units >= 38 |
1534f04d ER |
88 | # doesn't work with 2.4 kernels |
89 | Requires: uname(release) >= 2.6 | |
54ec8eef | 90 | Suggests: thin-provisioning-tools >= 0.5.4 |
25b6b609 | 91 | Obsoletes: lvm |
761db061 | 92 | Obsoletes: lvm2-clvmd |
c35cea65 | 93 | Obsoletes: lvm2-systemd |
7e72c866 JR |
94 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
95 | ||
96 | %define _sbindir /sbin | |
9ab13f24 | 97 | %define _usrsbindir /usr/sbin |
7e72c866 | 98 | |
0fbd6aae ER |
99 | # changing CFLAGS in the middle confuses confcache |
100 | %undefine configure_cache | |
101 | ||
87a7d834 ER |
102 | # borken on AC |
103 | %define filterout_ld -Wl,--as-needed | |
104 | ||
4cb4934b JK |
105 | # causes: undefined reference to `__stack_chk_fail_local' |
106 | %define filterout_c -fstack-protector | |
107 | ||
bac719c6 | 108 | %define skip_post_check_so '.*libdevmapper-event-lvm2.so.*' 'liblvm2cmd.so.*' |
f8fa85d0 | 109 | |
7e72c866 JR |
110 | %description |
111 | This package includes a number of utilities for creating, checking, | |
112 | and repairing logical volumes. | |
113 | ||
68d45726 JR |
114 | %description -l pl.UTF-8 |
115 | Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania | |
116 | logicznych wolumenów dyskowych (LVM2). | |
7e72c866 | 117 | |
7e72c866 | 118 | %package initrd |
5672aa67 | 119 | Summary: The new version of Logical Volume Manager for Linux - initrd version |
6536e848 | 120 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd |
7e72c866 | 121 | Group: Base |
16ddcbd0 | 122 | Conflicts: geninitrd < 10000.18 |
7e72c866 JR |
123 | |
124 | %description initrd | |
125 | This package includes a number of utilities for creating, checking, | |
126 | and repairing logical volumes - staticaly linked for initrd. | |
127 | ||
68d45726 JR |
128 | %description initrd -l pl.UTF-8 |
129 | Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania | |
130 | logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na | |
7e72c866 JR |
131 | potrzeby initrd. |
132 | ||
7e873dd0 JK |
133 | %package cmirrord |
134 | Summary: Cluster mirror log daemon | |
41c3aabb | 135 | Summary(pl.UTF-8): Demon śledzący log lustrzany w klastrze |
7e873dd0 | 136 | Group: Applications/System |
1aa2f585 | 137 | Requires: %{name} = %{version}-%{release} |
7e873dd0 JK |
138 | |
139 | %description cmirrord | |
4cb4934b JK |
140 | cmirrord is the daemon that tracks mirror log information in a |
141 | cluster. It is specific to device-mapper based mirrors (and by | |
142 | extension, LVM cluster mirrors). Cluster mirrors are not possible | |
143 | without this daemon running. | |
7e873dd0 | 144 | |
4cb4934b JK |
145 | This daemon relies on the cluster infrastructure provided by the |
146 | Cluster MANager (CMAN), which must be set up and running in order for | |
147 | cmirrord to function. | |
7e873dd0 | 148 | |
35a842cf JB |
149 | %description cmirrord |
150 | cmirrord to demon śledzący informacje logu lustrzanego w klastrze. | |
151 | Jest specyficzny dla klastrów lustrzanych opartych na device-mapperze | |
152 | (oraz, poprzez rozszerzenie, klastrów lustrzanych LVM). W klastrach | |
153 | lustrzanych ten demon jest niezbędny. | |
154 | ||
155 | Ten demon polega na infrastrukturze klastra dostarczanej przez CMAN | |
156 | (Cluster MANager), który musi być skonfigurowany i działający, aby | |
157 | działał cmirrord. | |
158 | ||
e2727f8c JB |
159 | %package dbusd |
160 | Summary: LVM2 D-Bus daemon | |
161 | Summary(pl.UTF-8): Demon LVM2 D-Bus | |
162 | Group: Daemons | |
163 | Requires(post,preun,postun): systemd-units >= 38 | |
164 | Requires: %{name} = %{version}-%{release} | |
165 | Requires: python3-dbus | |
e2727f8c | 166 | Requires: python3-pygobject3 >= 3 |
15eca5aa | 167 | Requires: python3-pyudev |
e2727f8c JB |
168 | |
169 | %description dbusd | |
170 | Daemon for access to LVM2 functionality through a D-Bus interface. | |
171 | ||
172 | %description dbusd -l pl.UTF-8 | |
173 | Demon umożliwiający dostęp do funkcjonalności LVM2 poprzez interfejs | |
174 | D-Bus. | |
175 | ||
176 | %package lockd | |
177 | Summary: LVM2 locking daemon | |
178 | Summary(pl.UTF-8): Demon blokad LVM2 | |
179 | Group: Daemons | |
180 | Requires(post,preun,postun): systemd-units >= 38 | |
181 | Requires: %{name} = %{version}-%{release} | |
e2727f8c | 182 | %{?with_cluster:Requires: dlm-libs >= 3.99.5} |
15eca5aa | 183 | %{?with_sanlock:Requires: sanlock-libs >= 3.3.0} |
e2727f8c JB |
184 | |
185 | %description lockd | |
186 | LVM commands use lvmlockd to coordinate access to shared storage. | |
187 | ||
188 | %description lockd -l pl.UTF-8 | |
189 | Polecenia LVM wykorzystują lvmlockd do koordynowania dostępu do | |
190 | współdzielonej pamięci masowej. | |
191 | ||
e55d5c02 JB |
192 | %package resource-agents |
193 | Summary: OCF Resource Agents for LVM2 processes | |
194 | Summary(pl.UTF-8): Agenci OCF do monitorowania procesów LVM2 | |
195 | Group: Applications/System | |
196 | Requires: %{name} = %{version}-%{release} | |
197 | Requires: resource-agents | |
198 | ||
199 | %description resource-agents | |
200 | OCF Resource Agents for LVM2 processes. | |
201 | ||
202 | %description resource-agents -l pl.UTF-8 | |
203 | Agenci OCF do monitorowania procesów LVM2. | |
204 | ||
35a842cf | 205 | %package -n python-lvm |
e2727f8c JB |
206 | Summary: Python 2 interface to LVM2 |
207 | Summary(pl.UTF-8): Interfejs Pythona 2 do LVM2 | |
35a842cf JB |
208 | Group: Libraries/Python |
209 | Requires: device-mapper-libs = %{version}-%{release} | |
210 | ||
211 | %description -n python-lvm | |
e2727f8c | 212 | Python 2 interface to LVM2. |
35a842cf JB |
213 | |
214 | %description -n python-lvm -l pl.UTF-8 | |
e2727f8c JB |
215 | Interfejs Pythona 2 do LVM2. |
216 | ||
217 | %package -n python3-lvm | |
218 | Summary: Python 3 interface to LVM2 | |
219 | Summary(pl.UTF-8): Interfejs Pythona 3 do LVM2 | |
220 | Group: Libraries/Python | |
221 | Requires: device-mapper-libs = %{version}-%{release} | |
222 | ||
223 | %description -n python3-lvm | |
224 | Python 3 interface to LVM2. | |
225 | ||
226 | %description -n python3-lvm -l pl.UTF-8 | |
227 | Interfejs Pythona 3 do LVM2. | |
35a842cf | 228 | |
b167057a AM |
229 | %package -n device-mapper |
230 | Summary: Userspace support for the device-mapper | |
231 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika | |
232 | Group: Base | |
e7dd8435 | 233 | Requires(post,postun): /sbin/ldconfig |
798d7327 | 234 | Requires(post,preun,postun): systemd-units >= 38 |
35a842cf | 235 | Requires: device-mapper-libs = %{version}-%{release} |
b5640c74 | 236 | Requires: systemd-units >= 38 |
b167057a AM |
237 | |
238 | %description -n device-mapper | |
239 | The goal of this driver is to support volume management. The driver | |
240 | enables the definition of new block devices composed of ranges of | |
241 | sectors of existing devices. This can be used to define disk | |
242 | partitions - or logical volumes. This light-weight kernel component | |
243 | can support user-space tools for logical volume management. | |
244 | ||
245 | %description -n device-mapper -l pl.UTF-8 | |
246 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
247 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
248 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
249 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
250 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
251 | narzędzia do zarządzania logicznymi wolumenami. | |
252 | ||
35a842cf JB |
253 | %package -n device-mapper-libs |
254 | Summary: Device-mapper shared libraries | |
255 | Summary(pl.UTF-8): Biblioteki współdzielone device-mappera | |
256 | Group: Libraries | |
35a842cf JB |
257 | Requires: libblkid >= 2.24 |
258 | Requires: udev-libs >= 1:176 | |
15eca5aa | 259 | Conflicts: device-mapper < 2.02.119-1 |
35a842cf JB |
260 | |
261 | %description -n device-mapper-libs | |
262 | Device-mapper shared libraries. | |
263 | ||
264 | %description -n device-mapper-libs -l pl.UTF-8 | |
265 | Biblioteki współdzielone device-mappera. | |
266 | ||
b167057a | 267 | %package -n device-mapper-devel |
35a842cf JB |
268 | Summary: Header files for device-mapper libraries |
269 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek device-mappera | |
b167057a | 270 | Group: Development/Libraries |
35a842cf JB |
271 | Requires: device-mapper-libs = %{version}-%{release} |
272 | Requires: libblkid-devel >= 2.24 | |
b167057a AM |
273 | %if %{with selinux} |
274 | Requires: libselinux-devel | |
275 | Requires: libsepol-devel | |
276 | %endif | |
35a842cf | 277 | Requires: udev-devel >= 1:176 |
b167057a AM |
278 | |
279 | %description -n device-mapper-devel | |
35a842cf | 280 | Header files for device-mapper libraries. |
b167057a AM |
281 | |
282 | %description -n device-mapper-devel -l pl.UTF-8 | |
35a842cf | 283 | Pliki nagłówkowe bibliotek device-mappera. |
b167057a AM |
284 | |
285 | %package -n device-mapper-static | |
286 | Summary: Static devmapper library | |
287 | Summary(pl.UTF-8): Statyczna biblioteka devmapper | |
288 | License: LGPL v2.1 | |
289 | Group: Development/Libraries | |
dc900ced | 290 | Requires: device-mapper-devel = %{version}-%{release} |
b167057a AM |
291 | |
292 | %description -n device-mapper-static | |
293 | Static devmapper library. | |
294 | ||
295 | %description -n device-mapper-static -l pl.UTF-8 | |
296 | Statyczna biblioteka devmapper. | |
297 | ||
4a323c26 JR |
298 | %package -n device-mapper-initrd |
299 | Summary: Userspace support for the device-mapper - initrd version | |
300 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd | |
301 | Group: Base | |
302 | Obsoletes: device-mapper-initrd-devel | |
1f7434e8 | 303 | Conflicts: geninitrd < 10000.10 |
4a323c26 JR |
304 | |
305 | %description -n device-mapper-initrd | |
306 | The goal of this driver is to support volume management. The driver | |
307 | enables the definition of new block devices composed of ranges of | |
308 | sectors of existing devices. This can be used to define disk | |
309 | partitions - or logical volumes. This light-weight kernel component | |
310 | can support user-space tools for logical volume management. | |
311 | ||
312 | This package contains dmsetup program linked staticaly for use in | |
313 | initrd. | |
314 | ||
315 | %description -n device-mapper-initrd -l pl.UTF-8 | |
316 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
317 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
318 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
319 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
320 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
321 | narzędzia do zarządzania logicznymi wolumenami. | |
322 | ||
323 | Ten pakiet zawiera program dmsetup skonsolidowany statycznie na | |
324 | potrzeby initrd. | |
325 | ||
7e72c866 | 326 | %prep |
ec2de926 | 327 | %setup -q -n LVM2.%{version} |
bac719c6 | 328 | %patch0 -p1 |
c70b42f6 | 329 | %patch1 -p1 |
9a00e98a | 330 | %patch2 -p1 |
f0dab9f1 | 331 | %patch3 -p1 |
d3e9e60b | 332 | %patch4 -p1 |
b5eb9717 | 333 | |
7e72c866 | 334 | %build |
242ffb9a | 335 | cp -f /usr/share/automake/config.sub autoconf |
7e72c866 JR |
336 | %{__aclocal} |
337 | %{__autoconf} | |
338 | ||
99958222 | 339 | %if %{with initrd} |
6c31051f | 340 | |
9bdab2f4 | 341 | %configure \ |
4c78aede | 342 | %{?debug:--enable-debug} \ |
43435358 JB |
343 | --disable-nls \ |
344 | --disable-readline \ | |
bac719c6 | 345 | --enable-selinux \ |
9bdab2f4 | 346 | --enable-static_link \ |
43435358 | 347 | --with-optimisation="%{rpmcflags} -Os" |
4c78aede ER |
348 | |
349 | %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h | |
0402cba0 | 350 | %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h |
ec2de926 | 351 | |
dab0ac18 JB |
352 | %{__make} -j1 -C include V=1 |
353 | %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB= V=1 | |
354 | %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB= V=1 | |
355 | %{__make} -j1 -C libdaemon/client LIB_SHARED= VERSIONED_SHLIB= V=1 | |
bac719c6 | 356 | %{__make} -j1 -C tools dmsetup.static lvm.static V=1 |
e2727f8c JB |
357 | %{__mv} tools/lvm.static initrd-lvm |
358 | %{__mv} tools/dmsetup.static initrd-dmsetup | |
7cef5d95 AM |
359 | |
360 | # check if tools works | |
361 | for tool in initrd-lvm initrd-dmsetup; do | |
cfa41a73 | 362 | LVM_SYSTEM_DIR=$(pwd) ./$tool help && rc=$? || rc=$? |
7cef5d95 | 363 | if [ $rc -gt 127 ]; then |
cfa41a73 | 364 | echo >&2 "Unexpected failure (exit status: $rc) from $tool. Does this tool work?!" |
7cef5d95 AM |
365 | exit 1 |
366 | fi | |
367 | done | |
368 | ||
9bdab2f4 | 369 | %{__make} clean |
6c31051f PS |
370 | |
371 | unset CC | |
7e72c866 JR |
372 | %endif |
373 | ||
9d0d1d5f | 374 | %configure \ |
6e7a47a9 | 375 | --enable-applib \ |
e2727f8c | 376 | --enable-cache_check_needs_check \ |
b167057a | 377 | --enable-cmdlib \ |
761db061 | 378 | %{?with_lvmdbusd:--enable-dbus-service --enable-notify-dbus} \ |
43435358 | 379 | %{?debug:--enable-debug} \ |
b167057a | 380 | --enable-dmeventd \ |
761db061 | 381 | --enable-dmfilemapd \ |
43435358 | 382 | --enable-fsadm \ |
98a8fd15 | 383 | --with-default-locking-dir=/var/lock/lvm \ |
54ec8eef | 384 | %if %{with lvmlockd} |
ef739509 JB |
385 | %{?with_cluster:--enable-lvmlockd-dlm} \ |
386 | %{?with_sanlock:--enable-lvmlockd-sanlock} \ | |
54ec8eef | 387 | %endif |
ef739509 | 388 | --enable-lvmpolld \ |
e55d5c02 | 389 | --enable-ocf \ |
e2727f8c JB |
390 | %{?with_python2:--enable-python2_bindings} \ |
391 | %{?with_python3:--enable-python3_bindings} \ | |
43435358 JB |
392 | --enable-readline \ |
393 | %{!?with_selinux:--disable-selinux} \ | |
b167057a | 394 | --enable-pkgconfig \ |
e2727f8c | 395 | --enable-thin_check_needs_check \ |
5f0ee085 JB |
396 | --enable-udev_sync \ |
397 | --enable-udev_rules \ | |
35a842cf | 398 | --with-cache=internal \ |
54ec8eef JB |
399 | --with-cache-check=/usr/sbin/cache_check \ |
400 | --with-cache-dump=/usr/sbin/cache_dump \ | |
401 | --with-cache-repair=/usr/sbin/cache_repair \ | |
402 | --with-cache-restore=/usr/sbin/cache_restore \ | |
43435358 | 403 | --with-cluster=internal \ |
7e873dd0 | 404 | %if %{with cluster} |
4cb4934b | 405 | --enable-cmirrord \ |
5cf18a89 | 406 | %endif |
43435358 JB |
407 | --with-dmeventd-path=%{_sbindir}/dmeventd \ |
408 | --with-interface=ioctl \ | |
607d2229 | 409 | --with-lvm1=internal \ |
43435358 JB |
410 | --with-mirrors=internal \ |
411 | --with-optimisation="%{rpmcflags}" \ | |
607d2229 | 412 | --with-snapshots=internal \ |
43435358 | 413 | --with-systemdsystemunitdir=%{systemdunitdir} \ |
35a842cf | 414 | --with-tmpfilesdir=%{systemdtmpfilesdir} \ |
b5640c74 | 415 | --with-thin=internal \ |
54ec8eef JB |
416 | --with-thin-check=/usr/sbin/thin_check \ |
417 | --with-thin-dump=/usr/sbin/thin_dump \ | |
418 | --with-thin-repair=/usr/sbin/thin_repair \ | |
419 | --with-thin-restore=/usr/sbin/thin_restore \ | |
589f4db4 | 420 | --with-udev-prefix=/ \ |
761db061 | 421 | --with-vdo=internal --with-vdo-format=%{_bindir}/vdoformat \ |
30965682 | 422 | --with-writecache=internal \ |
43435358 | 423 | --with-usrlibdir=%{_libdir} |
589f4db4 | 424 | |
b7318447 JB |
425 | # use bash because of "set -o pipefail" |
426 | %{__make} -j1 \ | |
dab0ac18 JB |
427 | SHELL=/bin/bash \ |
428 | V=1 | |
b7318447 | 429 | %{__make} -j1 -C libdm \ |
dab0ac18 JB |
430 | LIB_STATIC=libdevmapper.a \ |
431 | V=1 | |
7e72c866 JR |
432 | |
433 | %install | |
434 | rm -rf $RPM_BUILD_ROOT | |
41571565 | 435 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig,/var/lock/lvm/subsys} |
7e72c866 | 436 | |
761db061 | 437 | %{__make} install install_system_dirs install_systemd_units install_systemd_generators install_initscripts install_tmpfiles_configuration \ |
7e72c866 | 438 | DESTDIR=$RPM_BUILD_ROOT \ |
1ccfba6c | 439 | OWNER="" \ |
bcbf274d | 440 | GROUP="" \ |
dab0ac18 | 441 | V=1 \ |
bcbf274d | 442 | python3dir=%{py3_sitescriptdir} |
7e72c866 | 443 | |
35a842cf JB |
444 | %{__make} -C scripts install_tmpfiles_configuration \ |
445 | DESTDIR=$RPM_BUILD_ROOT \ | |
dab0ac18 | 446 | V=1 |
9b82b6a5 | 447 | |
bcbf274d | 448 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
b167057a AM |
449 | for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do |
450 | lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g") | |
451 | slib=$(basename $lib | sed -e 's#\.so\..*#.so#g') | |
452 | ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib | |
453 | done | |
454 | ||
1cfc154f JR |
455 | touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf |
456 | ||
88c67b5b JR |
457 | %if %{with initrd} |
458 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd | |
a3569314 ER |
459 | install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm |
460 | install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup | |
1306038e | 461 | %endif |
c70b42f6 | 462 | |
a3569314 | 463 | cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir} |
b167057a | 464 | |
7e72c866 JR |
465 | %clean |
466 | rm -rf $RPM_BUILD_ROOT | |
467 | ||
6e7a47a9 AM |
468 | %post |
469 | /sbin/chkconfig --add lvm2-monitor | |
470 | %service lvm2-monitor restart | |
c35cea65 | 471 | %systemd_post lvm2-monitor.service |
4cb4934b JK |
472 | /sbin/chkconfig --add blk-availability |
473 | # no service blk-availability restart | |
474 | %systemd_post blk-availability.service | |
e2727f8c JB |
475 | %if %{with lvmpolld} |
476 | %systemd_post lvm2-lvmpolld.socket | |
477 | %endif | |
c35cea65 JR |
478 | |
479 | %preun | |
480 | %systemd_preun lvm2-monitor.service | |
4cb4934b | 481 | %systemd_preun blk-availability.service |
e2727f8c JB |
482 | %if %{with lvmpolld} |
483 | %systemd_preun lvm2-lvmpolld.socket | |
484 | %endif | |
6e7a47a9 AM |
485 | |
486 | %postun | |
487 | if [ "$1" = "0" ]; then | |
488 | %service lvm2-monitor stop | |
489 | /sbin/chkconfig --del lvm2-monitor | |
4cb4934b JK |
490 | #no service blk-availability stop |
491 | /sbin/chkconfig --del blk-availability | |
6e7a47a9 | 492 | fi |
c35cea65 | 493 | %systemd_reload |
6e7a47a9 | 494 | |
c35cea65 JR |
495 | %triggerpostun -- %{name} < 2.02.94-1 |
496 | %systemd_trigger lvm2-monitor.service | |
b167057a | 497 | |
c35cea65 | 498 | %post -n device-mapper |
c35cea65 | 499 | %systemd_post dm-event.socket |
9b82b6a5 | 500 | |
c35cea65 JR |
501 | %preun -n device-mapper |
502 | %systemd_preun dm-event.socket dm-event.service | |
9b82b6a5 | 503 | |
c35cea65 | 504 | %postun -n device-mapper |
9b82b6a5 BZ |
505 | %systemd_reload |
506 | ||
c35cea65 JR |
507 | %triggerpostun -n device-mapper -- device-mapper < 2.02.94-1 |
508 | %systemd_trigger dm-event.socket | |
509 | ||
35a842cf JB |
510 | %post -n device-mapper-libs -p /sbin/ldconfig |
511 | %postun -n device-mapper-libs -p /sbin/ldconfig | |
512 | ||
e2727f8c JB |
513 | %post dbusd |
514 | %systemd_post lvm2-lvmdbusd.service | |
515 | ||
516 | %preun dbusd | |
517 | %systemd_preun lvm2-lvmdbusd.service | |
518 | ||
519 | %postun dbusd | |
520 | %systemd_reload | |
521 | ||
522 | %post lockd | |
523 | %systemd_post lvm2-lvmlockd.service lvm2-lvmlocking.service | |
524 | ||
525 | %preun lockd | |
526 | %systemd_preun lvm2-lvmlockd.service lvm2-lvmlocking.service | |
527 | ||
528 | %postun lockd | |
161d6a19 JK |
529 | %systemd_reload |
530 | ||
7e72c866 JR |
531 | %files |
532 | %defattr(644,root,root,755) | |
e6ac7970 | 533 | %doc README WHATS_NEW doc/* |
4cb4934b | 534 | %attr(755,root,root) %{_sbindir}/blkdeactivate |
86418c14 | 535 | %attr(755,root,root) %{_sbindir}/fsadm |
e2727f8c JB |
536 | %attr(755,root,root) %{_sbindir}/lvchange |
537 | %attr(755,root,root) %{_sbindir}/lvconvert | |
538 | %attr(755,root,root) %{_sbindir}/lvcreate | |
539 | %attr(755,root,root) %{_sbindir}/lvdisplay | |
540 | %attr(755,root,root) %{_sbindir}/lvextend | |
541 | %attr(755,root,root) %{_sbindir}/lvm | |
bac719c6 | 542 | #%attr(755,root,root) %{_sbindir}/lvmconf |
e2727f8c JB |
543 | %attr(755,root,root) %{_sbindir}/lvmconfig |
544 | %attr(755,root,root) %{_sbindir}/lvmdiskscan | |
545 | %attr(755,root,root) %{_sbindir}/lvmdump | |
546 | %attr(755,root,root) %{_sbindir}/lvmsadc | |
547 | %attr(755,root,root) %{_sbindir}/lvmsar | |
548 | %attr(755,root,root) %{_sbindir}/lvreduce | |
549 | %attr(755,root,root) %{_sbindir}/lvremove | |
550 | %attr(755,root,root) %{_sbindir}/lvrename | |
551 | %attr(755,root,root) %{_sbindir}/lvresize | |
552 | %attr(755,root,root) %{_sbindir}/lvs | |
553 | %attr(755,root,root) %{_sbindir}/lvscan | |
554 | %attr(755,root,root) %{_sbindir}/pvchange | |
555 | %attr(755,root,root) %{_sbindir}/pvck | |
556 | %attr(755,root,root) %{_sbindir}/pvcreate | |
557 | %attr(755,root,root) %{_sbindir}/pvdisplay | |
558 | %attr(755,root,root) %{_sbindir}/pvmove | |
559 | %attr(755,root,root) %{_sbindir}/pvremove | |
560 | %attr(755,root,root) %{_sbindir}/pvresize | |
561 | %attr(755,root,root) %{_sbindir}/pvs | |
562 | %attr(755,root,root) %{_sbindir}/pvscan | |
563 | %attr(755,root,root) %{_sbindir}/vgcfgbackup | |
564 | %attr(755,root,root) %{_sbindir}/vgcfgrestore | |
565 | %attr(755,root,root) %{_sbindir}/vgchange | |
566 | %attr(755,root,root) %{_sbindir}/vgck | |
567 | %attr(755,root,root) %{_sbindir}/vgconvert | |
568 | %attr(755,root,root) %{_sbindir}/vgcreate | |
569 | %attr(755,root,root) %{_sbindir}/vgdisplay | |
570 | %attr(755,root,root) %{_sbindir}/vgexport | |
571 | %attr(755,root,root) %{_sbindir}/vgextend | |
572 | %attr(755,root,root) %{_sbindir}/vgimport | |
573 | %attr(755,root,root) %{_sbindir}/vgimportclone | |
574 | %attr(755,root,root) %{_sbindir}/vgmerge | |
575 | %attr(755,root,root) %{_sbindir}/vgmknodes | |
576 | %attr(755,root,root) %{_sbindir}/vgreduce | |
577 | %attr(755,root,root) %{_sbindir}/vgremove | |
578 | %attr(755,root,root) %{_sbindir}/vgrename | |
579 | %attr(755,root,root) %{_sbindir}/vgs | |
580 | %attr(755,root,root) %{_sbindir}/vgscan | |
581 | %attr(755,root,root) %{_sbindir}/vgsplit | |
86418c14 | 582 | %{_mandir}/man5/lvm.conf.5* |
a4dcdce5 | 583 | %{_mandir}/man7/lvmcache.7* |
2b146638 JB |
584 | %{_mandir}/man7/lvmraid.7* |
585 | %{_mandir}/man7/lvmreport.7* | |
35a842cf | 586 | %{_mandir}/man7/lvmsystemid.7* |
0442bdaf | 587 | %{_mandir}/man7/lvmthin.7* |
4cb4934b | 588 | %{_mandir}/man8/blkdeactivate.8* |
86418c14 | 589 | %{_mandir}/man8/fsadm.8* |
e2727f8c JB |
590 | %{_mandir}/man8/lvchange.8* |
591 | %{_mandir}/man8/lvconvert.8* | |
592 | %{_mandir}/man8/lvcreate.8* | |
593 | %{_mandir}/man8/lvdisplay.8* | |
594 | %{_mandir}/man8/lvextend.8* | |
761db061 | 595 | %{_mandir}/man8/lvm2-activation-generator.8* |
2b146638 JB |
596 | %{_mandir}/man8/lvm-config.8* |
597 | %{_mandir}/man8/lvm-dumpconfig.8* | |
598 | %{_mandir}/man8/lvm-fullreport.8* | |
e2727f8c JB |
599 | %{_mandir}/man8/lvm-lvpoll.8* |
600 | %{_mandir}/man8/lvm.8* | |
bac719c6 | 601 | #%{_mandir}/man8/lvmconf.8* |
e2727f8c JB |
602 | %{_mandir}/man8/lvmconfig.8* |
603 | %{_mandir}/man8/lvmdiskscan.8* | |
604 | %{_mandir}/man8/lvmdump.8* | |
605 | %{_mandir}/man8/lvmsadc.8* | |
606 | %{_mandir}/man8/lvmsar.8* | |
607 | %{_mandir}/man8/lvreduce.8* | |
608 | %{_mandir}/man8/lvremove.8* | |
609 | %{_mandir}/man8/lvrename.8* | |
610 | %{_mandir}/man8/lvresize.8* | |
611 | %{_mandir}/man8/lvs.8* | |
612 | %{_mandir}/man8/lvscan.8* | |
613 | %{_mandir}/man8/pvchange.8* | |
614 | %{_mandir}/man8/pvck.8* | |
615 | %{_mandir}/man8/pvcreate.8* | |
616 | %{_mandir}/man8/pvdisplay.8* | |
617 | %{_mandir}/man8/pvmove.8* | |
618 | %{_mandir}/man8/pvremove.8* | |
619 | %{_mandir}/man8/pvresize.8* | |
620 | %{_mandir}/man8/pvs.8* | |
621 | %{_mandir}/man8/pvscan.8* | |
622 | %{_mandir}/man8/vgcfgbackup.8* | |
623 | %{_mandir}/man8/vgcfgrestore.8* | |
624 | %{_mandir}/man8/vgchange.8* | |
625 | %{_mandir}/man8/vgck.8* | |
626 | %{_mandir}/man8/vgconvert.8* | |
627 | %{_mandir}/man8/vgcreate.8* | |
628 | %{_mandir}/man8/vgdisplay.8* | |
629 | %{_mandir}/man8/vgexport.8* | |
630 | %{_mandir}/man8/vgextend.8* | |
631 | %{_mandir}/man8/vgimport.8* | |
632 | %{_mandir}/man8/vgimportclone.8* | |
633 | %{_mandir}/man8/vgmerge.8* | |
634 | %{_mandir}/man8/vgmknodes.8* | |
635 | %{_mandir}/man8/vgreduce.8* | |
636 | %{_mandir}/man8/vgremove.8* | |
637 | %{_mandir}/man8/vgrename.8* | |
638 | %{_mandir}/man8/vgs.8* | |
639 | %{_mandir}/man8/vgscan.8* | |
640 | %{_mandir}/man8/vgsplit.8* | |
99958222 | 641 | %attr(750,root,root) %dir %{_sysconfdir}/lvm |
2316bf4d | 642 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf |
35a842cf | 643 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvmlocal.conf |
e55d5c02 | 644 | %attr(750,root,root) %dir %{_sysconfdir}/lvm/profile |
54ec8eef JB |
645 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/cache-mq.profile |
646 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/cache-smq.profile | |
bfc9ab17 JB |
647 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/command_profile_template.profile |
648 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/metadata_profile_template.profile | |
649 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/thin-generic.profile | |
ac328eef | 650 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/thin-performance.profile |
bac719c6 | 651 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/vdo-small.profile |
35a842cf | 652 | %{systemdtmpfilesdir}/lvm2.conf |
4cb4934b | 653 | %{systemdunitdir}/blk-availability.service |
e2727f8c JB |
654 | %{systemdunitdir}/lvm2-monitor.service |
655 | %{systemdunitdir}/lvm2-pvscan@.service | |
761db061 | 656 | %attr(755,root,root) /lib/systemd/system-generators/lvm2-activation-generator |
e2727f8c JB |
657 | %dir %{_sysconfdir}/lvm/cache |
658 | %ghost %{_sysconfdir}/lvm/cache/.cache | |
659 | %attr(754,root,root) /etc/rc.d/init.d/blk-availability | |
660 | %attr(754,root,root) /etc/rc.d/init.d/lvm2-monitor | |
661 | %attr(700,root,root) %dir /run/lvm | |
662 | %attr(700,root,root) %dir /var/lock/lvm | |
41571565 | 663 | %attr(700,root,root) %dir /var/lock/lvm/subsys |
54ec8eef | 664 | %if %{with lvmlockd} |
e2727f8c JB |
665 | %attr(755,root,root) %{_sbindir}/lvmlockctl |
666 | %attr(755,root,root) %{_sbindir}/lvmlockd | |
bac719c6 AM |
667 | %{systemdunitdir}/lvmlockd.service |
668 | %{systemdunitdir}/lvmlocks.service | |
e2727f8c JB |
669 | %{_mandir}/man8/lvmlockctl.8* |
670 | %{_mandir}/man8/lvmlockd.8* | |
54ec8eef JB |
671 | %endif |
672 | %if %{with lvmpolld} | |
e2727f8c JB |
673 | %attr(755,root,root) %{_sbindir}/lvmpolld |
674 | %attr(754,root,root) /etc/rc.d/init.d/lvm2-lvmpolld | |
54ec8eef JB |
675 | %{systemdunitdir}/lvm2-lvmpolld.service |
676 | %{systemdunitdir}/lvm2-lvmpolld.socket | |
e2727f8c | 677 | %{_mandir}/man8/lvmpolld.8* |
54ec8eef | 678 | %endif |
7e873dd0 JK |
679 | |
680 | %if %{with cluster} | |
7e873dd0 JK |
681 | %files cmirrord |
682 | %defattr(644,root,root,755) | |
683 | %attr(755,root,root) %{_usrsbindir}/cmirrord | |
7e873dd0 | 684 | %attr(754,root,root) /etc/rc.d/init.d/cmirrord |
0442bdaf JB |
685 | %{systemdunitdir}/lvm2-cmirrord.service |
686 | %{_mandir}/man8/cmirrord.8* | |
7e873dd0 | 687 | %endif |
7e72c866 | 688 | |
e2727f8c JB |
689 | %if %{with lvmdbusd} |
690 | %files dbusd | |
691 | %defattr(644,root,root,755) | |
692 | %attr(755,root,root) %{_sbindir}/lvmdbusd | |
98a8fd15 | 693 | %{py3_sitescriptdir}/lvmdbusd |
2b146638 | 694 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/lvmdbusd.profile |
e2727f8c JB |
695 | %config(noreplace) %verify(not md5 mtime size) /etc/dbus-1/system.d/com.redhat.lvmdbus1.conf |
696 | %{_datadir}/dbus-1/system-services/com.redhat.lvmdbus1.service | |
697 | %{systemdunitdir}/lvm2-lvmdbusd.service | |
698 | %{_mandir}/man8/lvmdbusd.8* | |
699 | %endif | |
700 | ||
e55d5c02 JB |
701 | %files resource-agents |
702 | %defattr(644,root,root,755) | |
703 | %dir %{_prefix}/lib/ocf/resource.d/lvm2 | |
704 | %attr(755,root,root) %{_prefix}/lib/ocf/resource.d/lvm2/VolumeGroup | |
705 | ||
e2727f8c | 706 | %if %{with python2} |
35a842cf JB |
707 | %files -n python-lvm |
708 | %defattr(644,root,root,755) | |
bac719c6 AM |
709 | #%attr(755,root,root) %{py_sitedir}/lvm.so |
710 | #%{py_sitedir}/lvm-%{version}_*-py*.egg-info | |
35a842cf JB |
711 | %endif |
712 | ||
e2727f8c JB |
713 | %if %{with python3} |
714 | %files -n python3-lvm | |
715 | %defattr(644,root,root,755) | |
bac719c6 AM |
716 | #%attr(755,root,root) %{py3_sitedir}/lvm.cpython-*.so |
717 | #%{py3_sitedir}/lvm-%{version}_*-py*.egg-info | |
e2727f8c JB |
718 | %endif |
719 | ||
b167057a AM |
720 | %files -n device-mapper |
721 | %defattr(644,root,root,755) | |
722 | %doc *_DM | |
c35cea65 JR |
723 | %{systemdunitdir}/dm-event.service |
724 | %{systemdunitdir}/dm-event.socket | |
589f4db4 JR |
725 | /lib/udev/rules.d/10-dm.rules |
726 | /lib/udev/rules.d/11-dm-lvm.rules | |
727 | /lib/udev/rules.d/13-dm-disk.rules | |
728 | /lib/udev/rules.d/95-dm-notify.rules | |
bac719c6 | 729 | /lib/udev/rules.d/69-dm-lvm-metad.rules |
b167057a | 730 | %attr(755,root,root) %{_sbindir}/dmeventd |
761db061 | 731 | %attr(755,root,root) %{_sbindir}/dmfilemapd |
b167057a | 732 | %attr(755,root,root) %{_sbindir}/dmsetup |
54ec8eef | 733 | %attr(755,root,root) %{_sbindir}/dmstats |
e2727f8c JB |
734 | %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2mirror.so |
735 | %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2raid.so | |
736 | %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2snapshot.so | |
737 | %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2thin.so | |
dab0ac18 | 738 | %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2vdo.so |
1306038e | 739 | %dir %{_libdir}/device-mapper |
e2727f8c JB |
740 | %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2mirror.so |
741 | %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2raid.so | |
742 | %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2snapshot.so | |
743 | %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2thin.so | |
dab0ac18 | 744 | %attr(755,root,root) %{_libdir}/device-mapper/libdevmapper-event-lvm2vdo.so |
bac719c6 | 745 | %{_mandir}/man7/lvmvdo.7* |
761db061 | 746 | %{_mandir}/man8/dmfilemapd.8* |
b167057a | 747 | %{_mandir}/man8/dmsetup.8* |
54ec8eef | 748 | %{_mandir}/man8/dmstats.8* |
f0dab9f1 | 749 | %{_mandir}/man8/dmeventd.8* |
b167057a | 750 | |
35a842cf JB |
751 | %files -n device-mapper-libs |
752 | %defattr(644,root,root,755) | |
753 | %attr(755,root,root) /%{_lib}/libdevmapper.so.*.* | |
754 | %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.* | |
755 | %attr(755,root,root) /%{_lib}/libdevmapper-event-lvm2.so.*.* | |
35a842cf JB |
756 | %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.* |
757 | ||
b167057a AM |
758 | %files -n device-mapper-devel |
759 | %defattr(644,root,root,755) | |
bece12dd JR |
760 | %attr(755,root,root) %{_libdir}/libdevmapper.so |
761 | %attr(755,root,root) %{_libdir}/libdevmapper-event.so | |
e2727f8c | 762 | %attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2.so |
b167057a | 763 | %attr(755,root,root) %{_libdir}/liblvm2cmd.so |
35a842cf JB |
764 | %{_includedir}/libdevmapper.h |
765 | %{_includedir}/libdevmapper-event.h | |
b167057a | 766 | %{_includedir}/lvm2cmd.h |
35a842cf JB |
767 | %{_pkgconfigdir}/devmapper.pc |
768 | %{_pkgconfigdir}/devmapper-event.pc | |
b167057a AM |
769 | |
770 | %files -n device-mapper-static | |
771 | %defattr(644,root,root,755) | |
35a842cf | 772 | %{_libdir}/libdevmapper.a |
b167057a | 773 | |
1306038e | 774 | %if %{with initrd} |
4a323c26 JR |
775 | %files -n device-mapper-initrd |
776 | %defattr(644,root,root,755) | |
88c67b5b | 777 | %attr(755,root,root) %{_libdir}/initrd/dmsetup |
4a323c26 | 778 | |
7e72c866 JR |
779 | %files initrd |
780 | %defattr(644,root,root,755) | |
88c67b5b | 781 | %attr(755,root,root) %{_libdir}/initrd/lvm |
7e72c866 | 782 | %endif |