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