]>
Commit | Line | Data |
---|---|---|
e3a928dc | 1 | # TODO |
e3a928dc | 2 | # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted) |
5f0ee085 | 3 | # - --with-replicators (=internal/shared/none, default is none)? |
1b67453e | 4 | # |
99958222 | 5 | # Conditional build: |
54ec8eef JB |
6 | # - initrf stuff |
7 | %bcond_with initrd # build initrd version | |
fe052975 JR |
8 | %bcond_without uClibc # link initrd version with uClibc |
9 | %bcond_with dietlibc # link initrd version with dietlibc | |
5f0ee085 | 10 | %bcond_with glibc # link initrd version with static GLIBC |
54ec8eef | 11 | # - functionality |
7e873dd0 | 12 | %bcond_without cluster # disable all cluster support (clvmd&cmirrord) |
54ec8eef JB |
13 | %bcond_without lvmetad # disable lvmetad (and lvmlockd) |
14 | %bcond_without lvmpolld # disable lvmpolld (and lvmlockd) | |
15 | %bcond_without lvmlockd # disable lvmlockd | |
16 | %bcond_with sanlock # sanlock support in lvmlockd | |
17 | %bcond_with replicator # internal replicator support | |
18 | # - additional features | |
19 | %bcond_without selinux # SELinux support | |
20 | # - bindings | |
35a842cf | 21 | %bcond_without python # Python binding |
c70b42f6 | 22 | |
54ec8eef JB |
23 | # lvmlockd requires lvmetad and lvmpolld |
24 | %if %{without lvmetad} || %{without lvmpolld} | |
25 | %undefine with_lvmpolld | |
66800f6a | 26 | %endif |
c70b42f6 | 27 | |
54ec8eef JB |
28 | # only glibc possible on SPARC |
29 | %ifarch sparc sparcv9 sparc64 | |
30 | %define with_glibc 1 | |
31 | %endif | |
c70b42f6 JR |
32 | # if one of the *libc is enabled disable default dietlibc |
33 | %if %{with dietlibc} && %{with uClibc} | |
34 | %undefine with_dietlibc | |
35 | %endif | |
f1e27504 | 36 | # with glibc disables default dietlibc |
c70b42f6 JR |
37 | %if %{with glibc} && %{with dietlibc} |
38 | %undefine with_dietlibc | |
39 | %endif | |
f1e27504 ER |
40 | # fallback is glibc if neither alternatives are enabled |
41 | %if %{without dietlibc} && %{without uClibc} | |
42 | %define with_glibc 1 | |
43 | %endif | |
44 | ||
5672aa67 | 45 | Summary: The new version of Logical Volume Manager for Linux |
6536e848 | 46 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa |
7e72c866 | 47 | Name: lvm2 |
54ec8eef | 48 | Version: 2.02.130 |
35a842cf | 49 | Release: 1 |
0a81c260 | 50 | License: GPL v2 and LGPL v2.1 |
7e72c866 | 51 | Group: Applications/System |
dc5d0e77 | 52 | Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz |
54ec8eef | 53 | # Source0-md5: e7ae07e413120713549cc6dd2a558c75 |
0d673991 JK |
54 | Source2: clvmd.service |
55 | Source3: clvmd.sysconfig | |
7210a095 | 56 | Patch0: %{name}-selinux.patch |
c70b42f6 | 57 | Patch1: %{name}-diet.patch |
9a00e98a | 58 | Patch2: device-mapper-dmsetup-export.patch |
4cb4934b | 59 | Patch3: %{name}-pld_init.patch |
b747c17a | 60 | Patch4: dl-dlsym.patch |
4cb4934b | 61 | Patch6: %{name}-lvm_path.patch |
7d8cfaa5 | 62 | Patch7: %{name}-sd_notify.patch |
105f82c3 | 63 | Patch8: %{name}-clvmd_cmd_timeout.patch |
14fc1988 | 64 | Patch9: device-mapper-dmsetup-deps-export.patch |
35a842cf | 65 | URL: http://www.sourceware.org/lvm2/ |
5f0ee085 | 66 | BuildRequires: autoconf >= 2.61 |
7e72c866 | 67 | BuildRequires: automake |
54ec8eef JB |
68 | # for /run detection |
69 | BuildRequires: filesystem >= 3.0-43 | |
35a842cf | 70 | BuildRequires: libblkid-devel >= 2.24 |
0dc2b8f2 | 71 | %{?with_selinux:BuildRequires: libselinux-devel >= 1.10} |
e4a12efb | 72 | %{?with_selinux:BuildRequires: libsepol-devel} |
5f0ee085 | 73 | BuildRequires: ncurses-devel |
3657a56d | 74 | BuildRequires: pkgconfig |
35a842cf | 75 | %{?with_python:BuildRequires: python-devel >= 2} |
5f0ee085 | 76 | BuildRequires: readline-devel |
b5640c74 | 77 | BuildRequires: rpmbuild(macros) >= 1.647 |
54ec8eef | 78 | %{?with_sanlock:BuildRequires: sanlock-devel >= 3.2.4} |
35a842cf JB |
79 | BuildRequires: systemd-devel >= 1:205 |
80 | BuildRequires: udev-devel >= 1:176 | |
1ccfba6c | 81 | %if %{with initrd} |
fa9e8aeb | 82 | %if %{with dietlibc} |
39c8d1d5 | 83 | BuildRequires: dietlibc-static >= 2:0.32-7 |
fa9e8aeb AM |
84 | BuildConflicts: device-mapper-dietlibc |
85 | %endif | |
b64b85c5 ER |
86 | %if %{with glibc} |
87 | %{?with_selinux:BuildRequires: libselinux-static} | |
88 | %{?with_selinux:BuildRequires: libsepol-static} | |
89 | %endif | |
c70b42f6 JR |
90 | %{?with_glibc:BuildRequires: glibc-static} |
91 | %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29} | |
1ccfba6c | 92 | %endif |
7e873dd0 | 93 | %if %{with cluster} |
5f0ee085 | 94 | BuildRequires: corosync-devel |
4cb4934b | 95 | BuildRequires: dlm-devel >= 3.99.5 |
5f0ee085 | 96 | %endif |
b5640c74 | 97 | Requires(post,preun,postun): systemd-units >= 38 |
0a81c260 | 98 | Requires(post,postun): /sbin/chkconfig |
b167057a | 99 | Requires: device-mapper >= %{version}-%{release} |
0dc2b8f2 | 100 | %{?with_selinux:Requires: libselinux >= 1.10} |
b5640c74 | 101 | Requires: systemd-units >= 38 |
1534f04d ER |
102 | # doesn't work with 2.4 kernels |
103 | Requires: uname(release) >= 2.6 | |
54ec8eef | 104 | Suggests: thin-provisioning-tools >= 0.5.4 |
25b6b609 | 105 | Obsoletes: lvm |
c35cea65 | 106 | Obsoletes: lvm2-systemd |
7e72c866 JR |
107 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
108 | ||
109 | %define _sbindir /sbin | |
9ab13f24 | 110 | %define _usrsbindir /usr/sbin |
7e72c866 | 111 | |
0fbd6aae ER |
112 | # changing CFLAGS in the middle confuses confcache |
113 | %undefine configure_cache | |
114 | ||
87a7d834 ER |
115 | # borken on AC |
116 | %define filterout_ld -Wl,--as-needed | |
117 | ||
4cb4934b JK |
118 | # causes: undefined reference to `__stack_chk_fail_local' |
119 | %define filterout_c -fstack-protector | |
120 | ||
c70b42f6 JR |
121 | # for some reason known only to rpm there must be "\\|" not "\|" here |
122 | %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/') | |
123 | %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch} | |
124 | ||
f8fa85d0 PS |
125 | %define skip_post_check_so '.*libdevmapper-event-lvm2.so.*' |
126 | ||
7e72c866 JR |
127 | %description |
128 | This package includes a number of utilities for creating, checking, | |
129 | and repairing logical volumes. | |
130 | ||
68d45726 JR |
131 | %description -l pl.UTF-8 |
132 | Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania | |
133 | logicznych wolumenów dyskowych (LVM2). | |
7e72c866 | 134 | |
7e72c866 | 135 | %package initrd |
5672aa67 | 136 | Summary: The new version of Logical Volume Manager for Linux - initrd version |
6536e848 | 137 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd |
7e72c866 | 138 | Group: Base |
16ddcbd0 | 139 | Conflicts: geninitrd < 10000.18 |
7e72c866 JR |
140 | |
141 | %description initrd | |
142 | This package includes a number of utilities for creating, checking, | |
143 | and repairing logical volumes - staticaly linked for initrd. | |
144 | ||
68d45726 JR |
145 | %description initrd -l pl.UTF-8 |
146 | Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania | |
147 | logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na | |
7e72c866 JR |
148 | potrzeby initrd. |
149 | ||
7e873dd0 JK |
150 | %package clvmd |
151 | Summary: Cluster LVM daemon | |
152 | Summary(pl.UTF-8): Demon clustra LVM | |
153 | Group: Applications/System | |
1aa2f585 | 154 | Requires: %{name} = %{version}-%{release} |
7e873dd0 JK |
155 | |
156 | %description clvmd | |
4cb4934b JK |
157 | clvmd is the daemon that distributes LVM metadata updates around a |
158 | cluster. It must be running on all nodes in the cluster and will give | |
159 | an error if a node in the cluster does not have this daemon running. | |
7e873dd0 JK |
160 | |
161 | %description clvmd -l pl.UTF-8 | |
162 | clvmd to demon który rozprowadza zmiany meta-danych LVM po klastrze. | |
4cb4934b JK |
163 | Mysi działać na wszystkich węzłach klastra i zgłosi błąd gdy jakiś |
164 | węzeł w klastrze nie ma tego demona uruchomionego. | |
7e873dd0 JK |
165 | |
166 | %package cmirrord | |
167 | Summary: Cluster mirror log daemon | |
41c3aabb | 168 | Summary(pl.UTF-8): Demon śledzący log lustrzany w klastrze |
7e873dd0 | 169 | Group: Applications/System |
1aa2f585 | 170 | Requires: %{name} = %{version}-%{release} |
7e873dd0 JK |
171 | |
172 | %description cmirrord | |
4cb4934b JK |
173 | cmirrord is the daemon that tracks mirror log information in a |
174 | cluster. It is specific to device-mapper based mirrors (and by | |
175 | extension, LVM cluster mirrors). Cluster mirrors are not possible | |
176 | without this daemon running. | |
7e873dd0 | 177 | |
4cb4934b JK |
178 | This daemon relies on the cluster infrastructure provided by the |
179 | Cluster MANager (CMAN), which must be set up and running in order for | |
180 | cmirrord to function. | |
7e873dd0 | 181 | |
35a842cf JB |
182 | %description cmirrord |
183 | cmirrord to demon śledzący informacje logu lustrzanego w klastrze. | |
184 | Jest specyficzny dla klastrów lustrzanych opartych na device-mapperze | |
185 | (oraz, poprzez rozszerzenie, klastrów lustrzanych LVM). W klastrach | |
186 | lustrzanych ten demon jest niezbędny. | |
187 | ||
188 | Ten demon polega na infrastrukturze klastra dostarczanej przez CMAN | |
189 | (Cluster MANager), który musi być skonfigurowany i działający, aby | |
190 | działał cmirrord. | |
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 JB |
205 | %package -n python-lvm |
206 | Summary: Python interface to LVM2 | |
207 | Summary(pl.UTF-8): Interfejs Pythona do LVM2 | |
208 | Group: Libraries/Python | |
209 | Requires: device-mapper-libs = %{version}-%{release} | |
210 | ||
211 | %description -n python-lvm | |
212 | Python interface to LVM2. | |
213 | ||
214 | %description -n python-lvm -l pl.UTF-8 | |
215 | Interfejs Pythona do LVM2. | |
216 | ||
b167057a AM |
217 | %package -n device-mapper |
218 | Summary: Userspace support for the device-mapper | |
219 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika | |
220 | Group: Base | |
e7dd8435 | 221 | Requires(post,postun): /sbin/ldconfig |
798d7327 | 222 | Requires(post,preun,postun): systemd-units >= 38 |
35a842cf | 223 | Requires: device-mapper-libs = %{version}-%{release} |
b5640c74 | 224 | Requires: systemd-units >= 38 |
b167057a AM |
225 | |
226 | %description -n device-mapper | |
227 | The goal of this driver is to support volume management. The driver | |
228 | enables the definition of new block devices composed of ranges of | |
229 | sectors of existing devices. This can be used to define disk | |
230 | partitions - or logical volumes. This light-weight kernel component | |
231 | can support user-space tools for logical volume management. | |
232 | ||
233 | %description -n device-mapper -l pl.UTF-8 | |
234 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
235 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
236 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
237 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
238 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
239 | narzędzia do zarządzania logicznymi wolumenami. | |
240 | ||
35a842cf JB |
241 | %package -n device-mapper-libs |
242 | Summary: Device-mapper shared libraries | |
243 | Summary(pl.UTF-8): Biblioteki współdzielone device-mappera | |
244 | Group: Libraries | |
245 | Conflicts: device-mapper < 2.02.119-1 | |
246 | Requires: libblkid >= 2.24 | |
247 | Requires: udev-libs >= 1:176 | |
248 | ||
249 | %description -n device-mapper-libs | |
250 | Device-mapper shared libraries. | |
251 | ||
252 | %description -n device-mapper-libs -l pl.UTF-8 | |
253 | Biblioteki współdzielone device-mappera. | |
254 | ||
b167057a | 255 | %package -n device-mapper-devel |
35a842cf JB |
256 | Summary: Header files for device-mapper libraries |
257 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek device-mappera | |
b167057a | 258 | Group: Development/Libraries |
35a842cf JB |
259 | Requires: device-mapper-libs = %{version}-%{release} |
260 | Requires: libblkid-devel >= 2.24 | |
b167057a AM |
261 | %if %{with selinux} |
262 | Requires: libselinux-devel | |
263 | Requires: libsepol-devel | |
264 | %endif | |
35a842cf | 265 | Requires: udev-devel >= 1:176 |
b167057a AM |
266 | |
267 | %description -n device-mapper-devel | |
35a842cf | 268 | Header files for device-mapper libraries. |
b167057a AM |
269 | |
270 | %description -n device-mapper-devel -l pl.UTF-8 | |
35a842cf | 271 | Pliki nagłówkowe bibliotek device-mappera. |
b167057a AM |
272 | |
273 | %package -n device-mapper-static | |
274 | Summary: Static devmapper library | |
275 | Summary(pl.UTF-8): Statyczna biblioteka devmapper | |
276 | License: LGPL v2.1 | |
277 | Group: Development/Libraries | |
dc900ced | 278 | Requires: device-mapper-devel = %{version}-%{release} |
b167057a AM |
279 | |
280 | %description -n device-mapper-static | |
281 | Static devmapper library. | |
282 | ||
283 | %description -n device-mapper-static -l pl.UTF-8 | |
284 | Statyczna biblioteka devmapper. | |
285 | ||
c70b42f6 JR |
286 | %package -n device-mapper-dietlibc |
287 | Summary: Static devmapper library built with dietlibc | |
288 | Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc | |
289 | License: LGPL v2.1 | |
290 | Group: Development/Libraries | |
291 | Requires: device-mapper-devel = %{version}-%{release} | |
292 | ||
293 | %description -n device-mapper-dietlibc | |
294 | Static devmapper library built with dietlibc. | |
295 | ||
296 | %description -n device-mapper-dietlibc -l pl.UTF-8 | |
297 | Statyczna biblioteka devmapper zbudowana z dietlibc. | |
298 | ||
4a323c26 JR |
299 | %package -n device-mapper-initrd |
300 | Summary: Userspace support for the device-mapper - initrd version | |
301 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd | |
302 | Group: Base | |
303 | Obsoletes: device-mapper-initrd-devel | |
1f7434e8 | 304 | Conflicts: geninitrd < 10000.10 |
4a323c26 JR |
305 | |
306 | %description -n device-mapper-initrd | |
307 | The goal of this driver is to support volume management. The driver | |
308 | enables the definition of new block devices composed of ranges of | |
309 | sectors of existing devices. This can be used to define disk | |
310 | partitions - or logical volumes. This light-weight kernel component | |
311 | can support user-space tools for logical volume management. | |
312 | ||
313 | This package contains dmsetup program linked staticaly for use in | |
314 | initrd. | |
315 | ||
316 | %description -n device-mapper-initrd -l pl.UTF-8 | |
317 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
318 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
319 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
320 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
321 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
322 | narzędzia do zarządzania logicznymi wolumenami. | |
323 | ||
324 | Ten pakiet zawiera program dmsetup skonsolidowany statycznie na | |
325 | potrzeby initrd. | |
326 | ||
7e72c866 | 327 | %prep |
ec2de926 | 328 | %setup -q -n LVM2.%{version} |
7210a095 | 329 | %{?with_selinux:%patch0 -p1} |
c70b42f6 | 330 | %patch1 -p1 |
9a00e98a | 331 | %patch2 -p1 |
f0dab9f1 | 332 | %patch3 -p1 |
b747c17a | 333 | %patch4 -p1 |
eaa437a5 | 334 | %patch6 -p1 |
7d8cfaa5 | 335 | %patch7 -p1 |
105f82c3 | 336 | %patch8 -p1 |
14fc1988 | 337 | %patch9 -p1 |
b167057a | 338 | |
39c8d1d5 | 339 | # do not force --export-symbol linker option for e.g. statically linked executables |
b5eb9717 PS |
340 | # -rdynamic compiler option drives linker in the right way. |
341 | %{__sed} -i -e 's#-Wl,--export-dynamic#-rdynamic#g' configure.in | |
342 | ||
7e72c866 | 343 | %build |
87a7d834 ER |
344 | %if %{with initrd} |
345 | echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd | |
346 | %endif | |
242ffb9a | 347 | cp -f /usr/share/automake/config.sub autoconf |
7e72c866 JR |
348 | %{__aclocal} |
349 | %{__autoconf} | |
350 | ||
99958222 | 351 | %if %{with initrd} |
6c31051f PS |
352 | %{?with_glibc:export CC="%{__cc}"} |
353 | %{?with_uClibc:export CC="%{_target_cpu}-uclibc-gcc"} | |
4cbea9f4 | 354 | %{?with_dietlibc:cc="%{__cc}"; export CC="diet ${cc#ccache }"} |
6c31051f | 355 | |
9bdab2f4 | 356 | %configure \ |
a5702977 | 357 | ac_cv_lib_dl_dlopen=no \ |
eaa437a5 | 358 | %{?with_uClibc:ac_cv_func_siginterrupt=no} \ |
4c78aede | 359 | %{?debug:--enable-debug} \ |
43435358 JB |
360 | --disable-nls \ |
361 | --disable-readline \ | |
362 | --enable-selinux%{!?with_glibc:=no} \ | |
9bdab2f4 | 363 | --enable-static_link \ |
69688a46 | 364 | --with-lvm1=internal \ |
43435358 | 365 | --with-optimisation="%{rpmcflags} -Os" |
c70b42f6 | 366 | # glibc version links with normal static libdevicemapper which has selinux enabled |
260d6858 | 367 | # and we need to keep these in sync between device-mapper and lvm2 |
4c78aede ER |
368 | |
369 | %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h | |
0402cba0 | 370 | %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h |
ec2de926 | 371 | |
c7bbf0c8 AM |
372 | %{__make} -j1 -C include |
373 | %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB= | |
374 | %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB= | |
4cb4934b | 375 | %{__make} -j1 -C libdaemon/client LIB_SHARED= VERSIONED_SHLIB= |
2afef789 | 376 | %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"} |
69688a46 | 377 | mv -f tools/lvm.static initrd-lvm |
4a323c26 | 378 | mv -f tools/dmsetup.static initrd-dmsetup |
7cef5d95 AM |
379 | |
380 | # check if tools works | |
381 | for tool in initrd-lvm initrd-dmsetup; do | |
cfa41a73 | 382 | LVM_SYSTEM_DIR=$(pwd) ./$tool help && rc=$? || rc=$? |
7cef5d95 | 383 | if [ $rc -gt 127 ]; then |
cfa41a73 | 384 | echo >&2 "Unexpected failure (exit status: $rc) from $tool. Does this tool work?!" |
7cef5d95 AM |
385 | exit 1 |
386 | fi | |
387 | done | |
388 | ||
c70b42f6 | 389 | %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a} |
9bdab2f4 | 390 | %{__make} clean |
6c31051f PS |
391 | |
392 | unset CC | |
7e72c866 JR |
393 | %endif |
394 | ||
9d0d1d5f | 395 | %configure \ |
6e7a47a9 | 396 | --enable-applib \ |
b167057a | 397 | --enable-cmdlib \ |
43435358 | 398 | %{?debug:--enable-debug} \ |
b167057a | 399 | --enable-dmeventd \ |
43435358 | 400 | --enable-fsadm \ |
54ec8eef JB |
401 | %if %{with lvmlockd} |
402 | %{?with_cluster:--enable-lockd-dlm} \ | |
403 | %{?with_sanlock:--enable-lockd-sanlock} \ | |
404 | %endif | |
43435358 | 405 | %{?with_lvmetad:--enable-lvmetad} \ |
e55d5c02 | 406 | --enable-ocf \ |
35a842cf | 407 | %{?with_python:--enable-python_bindings} \ |
43435358 JB |
408 | --enable-readline \ |
409 | %{!?with_selinux:--disable-selinux} \ | |
b167057a | 410 | --enable-pkgconfig \ |
5f0ee085 JB |
411 | --enable-udev_sync \ |
412 | --enable-udev_rules \ | |
35a842cf | 413 | --with-cache=internal \ |
54ec8eef JB |
414 | --with-cache-check=/usr/sbin/cache_check \ |
415 | --with-cache-dump=/usr/sbin/cache_dump \ | |
416 | --with-cache-repair=/usr/sbin/cache_repair \ | |
417 | --with-cache-restore=/usr/sbin/cache_restore \ | |
43435358 | 418 | --with-cluster=internal \ |
7e873dd0 | 419 | %if %{with cluster} |
4cb4934b JK |
420 | --with-clvmd=corosync \ |
421 | --enable-cmirrord \ | |
5cf18a89 | 422 | %endif |
43435358 JB |
423 | --with-dmeventd-path=%{_sbindir}/dmeventd \ |
424 | --with-interface=ioctl \ | |
607d2229 | 425 | --with-lvm1=internal \ |
43435358 JB |
426 | --with-mirrors=internal \ |
427 | --with-optimisation="%{rpmcflags}" \ | |
607d2229 | 428 | --with-pool=internal \ |
54ec8eef | 429 | %{?with_replicator:--with-replicators=internal} \ |
607d2229 | 430 | --with-snapshots=internal \ |
43435358 | 431 | --with-systemdsystemunitdir=%{systemdunitdir} \ |
35a842cf | 432 | --with-tmpfilesdir=%{systemdtmpfilesdir} \ |
b5640c74 | 433 | --with-thin=internal \ |
54ec8eef JB |
434 | --with-thin-check=/usr/sbin/thin_check \ |
435 | --with-thin-dump=/usr/sbin/thin_dump \ | |
436 | --with-thin-repair=/usr/sbin/thin_repair \ | |
437 | --with-thin-restore=/usr/sbin/thin_restore \ | |
589f4db4 | 438 | --with-udev-prefix=/ \ |
43435358 | 439 | --with-usrlibdir=%{_libdir} |
589f4db4 | 440 | |
b167057a | 441 | %{__make} -j1 |
c7bbf0c8 | 442 | %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a |
7e72c866 JR |
443 | |
444 | %install | |
445 | rm -rf $RPM_BUILD_ROOT | |
0d673991 | 446 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm,/etc/sysconfig} |
c70b42f6 | 447 | %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}} |
7e72c866 | 448 | |
35a842cf | 449 | %{__make} install install_system_dirs install_systemd_units install_initscripts install_tmpfiles_configuration \ |
7e72c866 | 450 | DESTDIR=$RPM_BUILD_ROOT \ |
1ccfba6c AM |
451 | OWNER="" \ |
452 | GROUP="" | |
7e72c866 | 453 | |
35a842cf JB |
454 | %{__make} -C scripts install_tmpfiles_configuration \ |
455 | DESTDIR=$RPM_BUILD_ROOT \ | |
9b82b6a5 | 456 | |
0d673991 | 457 | %if %{with cluster} |
798d7327 ER |
458 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/clvmd.service |
459 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/clvmd | |
0d673991 JK |
460 | %endif |
461 | ||
b167057a AM |
462 | mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
463 | for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do | |
464 | lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g") | |
465 | slib=$(basename $lib | sed -e 's#\.so\..*#.so#g') | |
466 | ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib | |
467 | done | |
468 | ||
1cfc154f JR |
469 | touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf |
470 | ||
88c67b5b JR |
471 | %if %{with initrd} |
472 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd | |
a3569314 ER |
473 | install -p initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm |
474 | install -p initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup | |
7e72c866 | 475 | |
a3569314 | 476 | %{?with_dietlibc:cp -a diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a} |
1306038e | 477 | %endif |
c70b42f6 | 478 | |
a3569314 | 479 | cp -a libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir} |
b167057a | 480 | |
7e72c866 JR |
481 | %clean |
482 | rm -rf $RPM_BUILD_ROOT | |
483 | ||
6e7a47a9 AM |
484 | %post |
485 | /sbin/chkconfig --add lvm2-monitor | |
486 | %service lvm2-monitor restart | |
c35cea65 | 487 | %systemd_post lvm2-monitor.service |
4cb4934b JK |
488 | /sbin/chkconfig --add blk-availability |
489 | # no service blk-availability restart | |
490 | %systemd_post blk-availability.service | |
c35cea65 JR |
491 | |
492 | %preun | |
493 | %systemd_preun lvm2-monitor.service | |
4cb4934b | 494 | %systemd_preun blk-availability.service |
6e7a47a9 AM |
495 | |
496 | %postun | |
497 | if [ "$1" = "0" ]; then | |
498 | %service lvm2-monitor stop | |
499 | /sbin/chkconfig --del lvm2-monitor | |
4cb4934b JK |
500 | #no service blk-availability stop |
501 | /sbin/chkconfig --del blk-availability | |
6e7a47a9 | 502 | fi |
c35cea65 | 503 | %systemd_reload |
6e7a47a9 | 504 | |
c35cea65 JR |
505 | %triggerpostun -- %{name} < 2.02.94-1 |
506 | %systemd_trigger lvm2-monitor.service | |
b167057a | 507 | |
c35cea65 | 508 | %post -n device-mapper |
c35cea65 | 509 | %systemd_post dm-event.socket |
9b82b6a5 | 510 | |
c35cea65 JR |
511 | %preun -n device-mapper |
512 | %systemd_preun dm-event.socket dm-event.service | |
9b82b6a5 | 513 | |
c35cea65 | 514 | %postun -n device-mapper |
9b82b6a5 BZ |
515 | %systemd_reload |
516 | ||
c35cea65 JR |
517 | %triggerpostun -n device-mapper -- device-mapper < 2.02.94-1 |
518 | %systemd_trigger dm-event.socket | |
519 | ||
35a842cf JB |
520 | %post -n device-mapper-libs -p /sbin/ldconfig |
521 | %postun -n device-mapper-libs -p /sbin/ldconfig | |
522 | ||
161d6a19 JK |
523 | %post clvmd |
524 | /sbin/chkconfig --add clvmd | |
525 | # no service restart - it breaks current locks! | |
526 | export NORESTART=1 | |
527 | %systemd_post clvmd.service | |
528 | # re-exec instead | |
529 | /usr/sbin/clvmd -S 2>/dev/null || : | |
530 | ||
531 | %preun clvmd | |
532 | %systemd_preun clvmd.service | |
533 | ||
534 | %postun clvmd | |
535 | if [ "$1" = "0" ]; then | |
536 | %service clvmd stop | |
537 | /sbin/chkconfig --del clvmd | |
538 | fi | |
539 | %systemd_reload | |
540 | ||
7e72c866 JR |
541 | %files |
542 | %defattr(644,root,root,755) | |
e6ac7970 | 543 | %doc README WHATS_NEW doc/* |
4cb4934b | 544 | %attr(755,root,root) %{_sbindir}/blkdeactivate |
86418c14 JB |
545 | %attr(755,root,root) %{_sbindir}/fsadm |
546 | %attr(755,root,root) %{_sbindir}/lv* | |
547 | %attr(755,root,root) %{_sbindir}/pv* | |
548 | %attr(755,root,root) %{_sbindir}/vg* | |
86418c14 | 549 | %{_mandir}/man5/lvm.conf.5* |
a4dcdce5 | 550 | %{_mandir}/man7/lvmcache.7* |
35a842cf | 551 | %{_mandir}/man7/lvmsystemid.7* |
0442bdaf | 552 | %{_mandir}/man7/lvmthin.7* |
4cb4934b | 553 | %{_mandir}/man8/blkdeactivate.8* |
86418c14 JB |
554 | %{_mandir}/man8/fsadm.8* |
555 | %{_mandir}/man8/lv*.8* | |
556 | %{_mandir}/man8/pv*.8* | |
557 | %{_mandir}/man8/vg*.8* | |
99958222 | 558 | %attr(750,root,root) %dir %{_sysconfdir}/lvm |
2316bf4d | 559 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf |
35a842cf | 560 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvmlocal.conf |
e55d5c02 | 561 | %attr(750,root,root) %dir %{_sysconfdir}/lvm/profile |
54ec8eef JB |
562 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/cache-mq.profile |
563 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/cache-smq.profile | |
bfc9ab17 JB |
564 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/command_profile_template.profile |
565 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/metadata_profile_template.profile | |
566 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/thin-generic.profile | |
ac328eef | 567 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/profile/thin-performance.profile |
43435358 JB |
568 | %if %{with lvmetad} |
569 | /lib/udev/rules.d/69-dm-lvm-metad.rules | |
570 | %endif | |
35a842cf | 571 | %{systemdtmpfilesdir}/lvm2.conf |
4cb4934b | 572 | %{systemdunitdir}/blk-availability.service |
43435358 JB |
573 | %if %{with lvmetad} |
574 | %{systemdunitdir}/lvm2-lvmetad.service | |
575 | %{systemdunitdir}/lvm2-lvmetad.socket | |
576 | %endif | |
54ec8eef JB |
577 | %if %{with lvmlockd} |
578 | %{systemdunitdir}/lvm2-lvmlockd.service | |
579 | %{systemdunitdir}/lvm2-lvmlocking.service | |
580 | %endif | |
581 | %if %{with lvmpolld} | |
582 | %{systemdunitdir}/lvm2-lvmpolld.service | |
583 | %{systemdunitdir}/lvm2-lvmpolld.socket | |
584 | %endif | |
43435358 JB |
585 | %{systemdunitdir}/lvm2-monitor.service |
586 | %{systemdunitdir}/lvm2-pvscan@.service | |
6e7a47a9 AM |
587 | %dir %{_sysconfdir}/lvm/cache |
588 | %ghost %{_sysconfdir}/lvm/cache/.cache | |
4cb4934b | 589 | %attr(754,root,root) /etc/rc.d/init.d/blk-availability |
43435358 JB |
590 | %if %{with lvmetad} |
591 | %attr(754,root,root) /etc/rc.d/init.d/lvm2-lvmetad | |
592 | %endif | |
54ec8eef JB |
593 | %if %{with lvmpolld} |
594 | %attr(754,root,root) /etc/rc.d/init.d/lvm2-lvmpolld | |
595 | %endif | |
6e7a47a9 | 596 | %attr(754,root,root) /etc/rc.d/init.d/lvm2-monitor |
54ec8eef JB |
597 | %attr(700,root,root) %dir /run/lvm |
598 | %attr(700,root,root) %dir /var/lock/lvm | |
7e873dd0 JK |
599 | |
600 | %if %{with cluster} | |
601 | %files clvmd | |
602 | %defattr(644,root,root,755) | |
603 | %attr(755,root,root) %{_usrsbindir}/clvmd | |
604 | %attr(754,root,root) /etc/rc.d/init.d/clvmd | |
0d673991 | 605 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/clvmd |
0442bdaf | 606 | %attr(755,root,root) /lib/systemd/lvm2-cluster-activation |
0d673991 | 607 | %{systemdunitdir}/clvmd.service |
0442bdaf JB |
608 | %{systemdunitdir}/lvm2-cluster-activation.service |
609 | %{systemdunitdir}/lvm2-clvmd.service | |
7e873dd0 JK |
610 | %{_mandir}/man8/clvmd.8* |
611 | ||
7e873dd0 JK |
612 | %files cmirrord |
613 | %defattr(644,root,root,755) | |
614 | %attr(755,root,root) %{_usrsbindir}/cmirrord | |
7e873dd0 | 615 | %attr(754,root,root) /etc/rc.d/init.d/cmirrord |
0442bdaf JB |
616 | %{systemdunitdir}/lvm2-cmirrord.service |
617 | %{_mandir}/man8/cmirrord.8* | |
7e873dd0 | 618 | %endif |
7e72c866 | 619 | |
e55d5c02 JB |
620 | %files resource-agents |
621 | %defattr(644,root,root,755) | |
622 | %dir %{_prefix}/lib/ocf/resource.d/lvm2 | |
623 | %attr(755,root,root) %{_prefix}/lib/ocf/resource.d/lvm2/VolumeGroup | |
624 | ||
35a842cf JB |
625 | %if %{with python} |
626 | %files -n python-lvm | |
627 | %defattr(644,root,root,755) | |
628 | %attr(755,root,root) %{py_sitedir}/lvm.so | |
629 | %{py_sitedir}/lvm-%{version}_*-py*.egg-info | |
630 | %endif | |
631 | ||
b167057a AM |
632 | %files -n device-mapper |
633 | %defattr(644,root,root,755) | |
634 | %doc *_DM | |
c35cea65 JR |
635 | %{systemdunitdir}/dm-event.service |
636 | %{systemdunitdir}/dm-event.socket | |
589f4db4 JR |
637 | /lib/udev/rules.d/10-dm.rules |
638 | /lib/udev/rules.d/11-dm-lvm.rules | |
639 | /lib/udev/rules.d/13-dm-disk.rules | |
640 | /lib/udev/rules.d/95-dm-notify.rules | |
b167057a AM |
641 | %attr(755,root,root) %{_sbindir}/dmeventd |
642 | %attr(755,root,root) %{_sbindir}/dmsetup | |
54ec8eef | 643 | %attr(755,root,root) %{_sbindir}/dmstats |
1306038e AM |
644 | %dir %{_libdir}/device-mapper |
645 | %attr(755,root,root) %{_libdir}/device-mapper/*.so | |
bece12dd | 646 | %attr(755,root,root) %{_libdir}/libdevmapper-event-*.so |
b167057a | 647 | %{_mandir}/man8/dmsetup.8* |
54ec8eef | 648 | %{_mandir}/man8/dmstats.8* |
f0dab9f1 | 649 | %{_mandir}/man8/dmeventd.8* |
b167057a | 650 | |
35a842cf JB |
651 | %files -n device-mapper-libs |
652 | %defattr(644,root,root,755) | |
653 | %attr(755,root,root) /%{_lib}/libdevmapper.so.*.* | |
654 | %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.* | |
655 | %attr(755,root,root) /%{_lib}/libdevmapper-event-lvm2.so.*.* | |
656 | %attr(755,root,root) /%{_lib}/liblvm2app.so.*.* | |
657 | %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.* | |
658 | ||
b167057a AM |
659 | %files -n device-mapper-devel |
660 | %defattr(644,root,root,755) | |
bece12dd JR |
661 | %attr(755,root,root) %{_libdir}/libdevmapper.so |
662 | %attr(755,root,root) %{_libdir}/libdevmapper-event.so | |
6e7a47a9 | 663 | %attr(755,root,root) %{_libdir}/liblvm2app.so |
b167057a | 664 | %attr(755,root,root) %{_libdir}/liblvm2cmd.so |
35a842cf JB |
665 | %{_includedir}/libdevmapper.h |
666 | %{_includedir}/libdevmapper-event.h | |
6e7a47a9 | 667 | %{_includedir}/lvm2app.h |
b167057a | 668 | %{_includedir}/lvm2cmd.h |
35a842cf JB |
669 | %{_pkgconfigdir}/devmapper.pc |
670 | %{_pkgconfigdir}/devmapper-event.pc | |
6e7a47a9 | 671 | %{_pkgconfigdir}/lvm2app.pc |
b167057a AM |
672 | |
673 | %files -n device-mapper-static | |
674 | %defattr(644,root,root,755) | |
35a842cf | 675 | %{_libdir}/libdevmapper.a |
b167057a | 676 | |
1306038e | 677 | %if %{with initrd} |
c70b42f6 JR |
678 | %if %{with dietlibc} |
679 | %files -n device-mapper-dietlibc | |
680 | %defattr(644,root,root,755) | |
681 | %{dietlibdir}/libdevmapper.a | |
682 | %endif | |
683 | ||
4a323c26 JR |
684 | %files -n device-mapper-initrd |
685 | %defattr(644,root,root,755) | |
88c67b5b | 686 | %attr(755,root,root) %{_libdir}/initrd/dmsetup |
4a323c26 | 687 | |
7e72c866 JR |
688 | %files initrd |
689 | %defattr(644,root,root,755) | |
88c67b5b | 690 | %attr(755,root,root) %{_libdir}/initrd/lvm |
7e72c866 | 691 | %endif |