]>
Commit | Line | Data |
---|---|---|
e3a928dc | 1 | # TODO |
e3a928dc | 2 | # - vgscan --ignorelocking failure creates /var/lock/lvm (even if /var is not yet mounted) |
1b67453e | 3 | # |
99958222 | 4 | # Conditional build: |
c70b42f6 JR |
5 | %bcond_without initrd # don't build initrd version |
6 | %bcond_with uClibc # link initrd version with uClibc | |
7 | %bcond_without dietlibc # link initrd version with dietlibc | |
8 | %bcond_with glibc # link initrd version with static glibc | |
9 | %bcond_without clvmd # don't build clvmd | |
f0dab9f1 | 10 | %bcond_with clvmd3 # build clvmd for 3rd generation of cluster |
c70b42f6 JR |
11 | %bcond_without selinux # disable SELinux |
12 | ||
4a323c26 | 13 | %ifarch sparc64 sparc |
c70b42f6 | 14 | %define with_glibc 1 |
66800f6a | 15 | %endif |
c70b42f6 JR |
16 | |
17 | # if one of the *libc is enabled disable default dietlibc | |
18 | %if %{with dietlibc} && %{with uClibc} | |
19 | %undefine with_dietlibc | |
20 | %endif | |
21 | ||
22 | %if %{with glibc} && %{with dietlibc} | |
23 | %undefine with_dietlibc | |
24 | %endif | |
25 | ||
87a7d834 | 26 | %if %{with clvmd3} |
f0dab9f1 | 27 | %undefine with_clvmd |
28 | %endif | |
29 | ||
5672aa67 | 30 | Summary: The new version of Logical Volume Manager for Linux |
6536e848 | 31 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa |
7e72c866 | 32 | Name: lvm2 |
2afef789 | 33 | Version: 2.02.72 |
ebbcde93 | 34 | Release: 1 |
1738b891 | 35 | License: GPL v2 |
7e72c866 | 36 | Group: Applications/System |
dc5d0e77 | 37 | Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz |
2afef789 | 38 | # Source0-md5: a7d0d1235a589869bd13cde0f0d7375d |
bf171b20 JR |
39 | Source1: %{name}-initramfs-hook |
40 | Source2: %{name}-initramfs-local-top | |
7210a095 | 41 | Patch0: %{name}-selinux.patch |
c70b42f6 | 42 | Patch1: %{name}-diet.patch |
9a00e98a | 43 | Patch2: device-mapper-dmsetup-export.patch |
f0dab9f1 | 44 | Patch3: %{name}-clvmd_init.patch |
b747c17a | 45 | Patch4: dl-dlsym.patch |
dc5d0e77 | 46 | URL: http://sources.redhat.com/lvm2/ |
7e72c866 JR |
47 | BuildRequires: autoconf |
48 | BuildRequires: automake | |
0dc2b8f2 | 49 | %{?with_selinux:BuildRequires: libselinux-devel >= 1.10} |
e4a12efb | 50 | %{?with_selinux:BuildRequires: libsepol-devel} |
3657a56d | 51 | BuildRequires: pkgconfig |
bd71c1b4 | 52 | BuildRequires: rpmbuild(macros) >= 1.213 |
1ccfba6c | 53 | %if %{with initrd} |
fa9e8aeb AM |
54 | %if %{with dietlibc} |
55 | BuildRequires: dietlibc-static >= 2:0.31-5 | |
56 | BuildConflicts: device-mapper-dietlibc | |
57 | %endif | |
c70b42f6 JR |
58 | %{?with_glibc:BuildRequires: glibc-static} |
59 | %{?with_uClibc:BuildRequires: uClibc-static >= 2:0.9.29} | |
1ccfba6c | 60 | %endif |
c97b4c11 | 61 | %if %{with clvmd} |
1b67453e | 62 | BuildRequires: cman-devel >= 1.0 |
4c78aede | 63 | BuildRequires: dlm-devel >= 1.0-0.pre21.2 |
1b67453e | 64 | %endif |
f0dab9f1 | 65 | %if %{with clvmd3} |
66 | BuildRequires: cluster-cman-devel | |
67 | BuildRequires: cluster-dlm-devel | |
68 | %endif | |
260d6858 | 69 | BuildRequires: ncurses-devel |
33d5c7d0 | 70 | BuildRequires: readline-devel |
b167057a | 71 | Requires: device-mapper >= %{version}-%{release} |
1b67453e | 72 | %if %{with clvmd} |
ed044ab4 | 73 | Requires: cman-libs >= 1.0 |
b678d191 | 74 | Requires: dlm >= 1.0-0.pre21.2 |
1b67453e | 75 | %endif |
f0dab9f1 | 76 | %if %{with clvmd3} |
77 | Requires: cluster-cman-libs | |
78 | Requires: cluster-dlm | |
79 | %endif | |
0dc2b8f2 | 80 | %{?with_selinux:Requires: libselinux >= 1.10} |
1534f04d ER |
81 | # doesn't work with 2.4 kernels |
82 | Requires: uname(release) >= 2.6 | |
25b6b609 | 83 | Obsoletes: lvm |
7e72c866 JR |
84 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
85 | ||
86 | %define _sbindir /sbin | |
9ab13f24 | 87 | %define _usrsbindir /usr/sbin |
7e72c866 | 88 | |
0fbd6aae ER |
89 | # changing CFLAGS in the middle confuses confcache |
90 | %undefine configure_cache | |
91 | ||
87a7d834 ER |
92 | # borken on AC |
93 | %define filterout_ld -Wl,--as-needed | |
94 | ||
c70b42f6 JR |
95 | # for some reason known only to rpm there must be "\\|" not "\|" here |
96 | %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/') | |
97 | %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch} | |
98 | ||
7e72c866 JR |
99 | %description |
100 | This package includes a number of utilities for creating, checking, | |
101 | and repairing logical volumes. | |
102 | ||
68d45726 JR |
103 | %description -l pl.UTF-8 |
104 | Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania | |
105 | logicznych wolumenów dyskowych (LVM2). | |
7e72c866 | 106 | |
7e72c866 | 107 | %package initrd |
5672aa67 | 108 | Summary: The new version of Logical Volume Manager for Linux - initrd version |
6536e848 | 109 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - wersja dla initrd |
7e72c866 | 110 | Group: Base |
16ddcbd0 | 111 | Conflicts: geninitrd < 10000.18 |
7e72c866 JR |
112 | |
113 | %description initrd | |
114 | This package includes a number of utilities for creating, checking, | |
115 | and repairing logical volumes - staticaly linked for initrd. | |
116 | ||
68d45726 JR |
117 | %description initrd -l pl.UTF-8 |
118 | Pakiet ten zawiera narzędzia do tworzenia, sprawdzania i naprawiania | |
119 | logicznych wolumenów dyskowych (LVM2) - statycznie skonsolidowane na | |
7e72c866 JR |
120 | potrzeby initrd. |
121 | ||
b167057a AM |
122 | %package -n device-mapper |
123 | Summary: Userspace support for the device-mapper | |
124 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika | |
125 | Group: Base | |
126 | ||
127 | %description -n device-mapper | |
128 | The goal of this driver is to support volume management. The driver | |
129 | enables the definition of new block devices composed of ranges of | |
130 | sectors of existing devices. This can be used to define disk | |
131 | partitions - or logical volumes. This light-weight kernel component | |
132 | can support user-space tools for logical volume management. | |
133 | ||
134 | %description -n device-mapper -l pl.UTF-8 | |
135 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
136 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
137 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
138 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
139 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
140 | narzędzia do zarządzania logicznymi wolumenami. | |
141 | ||
142 | %package -n device-mapper-devel | |
143 | Summary: Header files and development documentation for %{name} | |
144 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name} | |
145 | Group: Development/Libraries | |
146 | Requires: device-mapper = %{version}-%{release} | |
147 | %if %{with selinux} | |
148 | Requires: libselinux-devel | |
149 | Requires: libsepol-devel | |
150 | %endif | |
151 | ||
152 | %description -n device-mapper-devel | |
153 | Header files and development documentation for %{name}. | |
154 | ||
155 | %description -n device-mapper-devel -l pl.UTF-8 | |
156 | Pliki nagłówkowe i dokumentacja do %{name}. | |
157 | ||
158 | %package -n device-mapper-static | |
159 | Summary: Static devmapper library | |
160 | Summary(pl.UTF-8): Statyczna biblioteka devmapper | |
161 | License: LGPL v2.1 | |
162 | Group: Development/Libraries | |
dc900ced | 163 | Requires: device-mapper-devel = %{version}-%{release} |
b167057a AM |
164 | |
165 | %description -n device-mapper-static | |
166 | Static devmapper library. | |
167 | ||
168 | %description -n device-mapper-static -l pl.UTF-8 | |
169 | Statyczna biblioteka devmapper. | |
170 | ||
c70b42f6 JR |
171 | %package -n device-mapper-dietlibc |
172 | Summary: Static devmapper library built with dietlibc | |
173 | Summary(pl.UTF-8): Statyczna biblioteka devmapper zbudowana z dietlibc | |
174 | License: LGPL v2.1 | |
175 | Group: Development/Libraries | |
176 | Requires: device-mapper-devel = %{version}-%{release} | |
177 | ||
178 | %description -n device-mapper-dietlibc | |
179 | Static devmapper library built with dietlibc. | |
180 | ||
181 | %description -n device-mapper-dietlibc -l pl.UTF-8 | |
182 | Statyczna biblioteka devmapper zbudowana z dietlibc. | |
183 | ||
4a323c26 JR |
184 | %package -n device-mapper-initrd |
185 | Summary: Userspace support for the device-mapper - initrd version | |
186 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - wersja dla initrd | |
187 | Group: Base | |
188 | Obsoletes: device-mapper-initrd-devel | |
1f7434e8 | 189 | Conflicts: geninitrd < 10000.10 |
4a323c26 JR |
190 | |
191 | %description -n device-mapper-initrd | |
192 | The goal of this driver is to support volume management. The driver | |
193 | enables the definition of new block devices composed of ranges of | |
194 | sectors of existing devices. This can be used to define disk | |
195 | partitions - or logical volumes. This light-weight kernel component | |
196 | can support user-space tools for logical volume management. | |
197 | ||
198 | This package contains dmsetup program linked staticaly for use in | |
199 | initrd. | |
200 | ||
201 | %description -n device-mapper-initrd -l pl.UTF-8 | |
202 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
203 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
204 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
205 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
206 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
207 | narzędzia do zarządzania logicznymi wolumenami. | |
208 | ||
209 | Ten pakiet zawiera program dmsetup skonsolidowany statycznie na | |
210 | potrzeby initrd. | |
211 | ||
906ac01a JR |
212 | %package initramfs |
213 | Summary: The new version of Logical Volume Manager for Linux - support scripts for initramfs-tools | |
214 | Summary(pl.UTF-8): Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla initramfs-tools | |
215 | Group: Base | |
216 | Requires: %{name} = %{version}-%{release} | |
217 | Requires: initramfs-tools | |
218 | ||
219 | %description initramfs | |
3657a56d | 220 | The new version of Logical Volume Manager for Linux - support scripts |
221 | for initramfs-tools. | |
906ac01a JR |
222 | |
223 | %description initramfs -l pl.UTF-8 | |
224 | Nowa wersja Logical Volume Managera dla Linuksa - skrypty dla | |
225 | initramfs-tools. | |
226 | ||
7e72c866 | 227 | %prep |
ec2de926 | 228 | %setup -q -n LVM2.%{version} |
7210a095 | 229 | %{?with_selinux:%patch0 -p1} |
c70b42f6 | 230 | %patch1 -p1 |
9a00e98a | 231 | %patch2 -p1 |
f0dab9f1 | 232 | %patch3 -p1 |
b747c17a | 233 | %patch4 -p1 |
b167057a | 234 | |
7e72c866 | 235 | %build |
87a7d834 ER |
236 | %if %{with initrd} |
237 | echo Using %{?with_glibc:GLIBC} %{?with_uClibc:uClibc} %{?with_dietlibc:diet} for initrd | |
238 | %endif | |
242ffb9a | 239 | cp -f /usr/share/automake/config.sub autoconf |
7e72c866 JR |
240 | %{__aclocal} |
241 | %{__autoconf} | |
242 | ||
99958222 | 243 | %if %{with initrd} |
0402cba0 | 244 | CC="%{__cc}" |
9bdab2f4 | 245 | %configure \ |
69688a46 | 246 | %{?with_uClibc:CC="%{_target_cpu}-uclibc-gcc"} \ |
0402cba0 | 247 | %{?with_dietlibc:CC="diet ${CC#*ccache }"} \ |
a5702977 | 248 | ac_cv_lib_dl_dlopen=no \ |
4c78aede | 249 | %{?debug:--enable-debug} \ |
e6cf1072 | 250 | --with-optimisation="%{rpmcflags} -Os" \ |
9bdab2f4 | 251 | --enable-static_link \ |
69688a46 | 252 | --with-lvm1=internal \ |
c70b42f6 | 253 | --%{?with_glibc:en}%{!?with_glibc:dis}able-selinux \ |
260d6858 | 254 | --disable-readline \ |
ef3dbc1a | 255 | --disable-nls |
c70b42f6 | 256 | # glibc version links with normal static libdevicemapper which has selinux enabled |
260d6858 | 257 | # and we need to keep these in sync between device-mapper and lvm2 |
4c78aede ER |
258 | |
259 | %{__sed} -i -e 's#rpl_malloc#malloc#g' lib/misc/configure.h | |
0402cba0 | 260 | %{__sed} -i -e 's#rpl_realloc#realloc#g' lib/misc/configure.h |
ec2de926 | 261 | |
c7bbf0c8 AM |
262 | %{__make} -j1 -C include |
263 | %{__make} -j1 -C lib LIB_SHARED= VERSIONED_SHLIB= | |
264 | %{__make} -j1 -C libdm LIB_SHARED= VERSIONED_SHLIB= | |
2afef789 | 265 | %{__make} -j1 -C tools dmsetup.static lvm.static %{?with_dietlibc:DIETLIBC_LIBS="-lcompat"} |
69688a46 | 266 | mv -f tools/lvm.static initrd-lvm |
4a323c26 | 267 | mv -f tools/dmsetup.static initrd-dmsetup |
c70b42f6 | 268 | %{?with_dietlibc:mv -f libdm/ioctl/libdevmapper.a diet-libdevmapper.a} |
9bdab2f4 | 269 | %{__make} clean |
7e72c866 JR |
270 | %endif |
271 | ||
9d0d1d5f | 272 | %configure \ |
b167057a | 273 | --with-usrlibdir=%{_libdir} \ |
4c78aede | 274 | %{?debug:--enable-debug} \ |
b167057a | 275 | --with-optimisation="%{rpmcflags}" \ |
607d2229 AM |
276 | --enable-readline \ |
277 | --enable-fsadm \ | |
b167057a AM |
278 | --enable-cmdlib \ |
279 | --enable-dmeventd \ | |
280 | --enable-pkgconfig \ | |
ed044ab4 | 281 | %{?with_clvmd:--with-clvmd=cman} \ |
607d2229 AM |
282 | --with-lvm1=internal \ |
283 | --with-pool=internal \ | |
3852b0e2 | 284 | --with-cluster=internal \ |
607d2229 | 285 | --with-snapshots=internal \ |
0dc2b8f2 | 286 | --with-mirrors=internal \ |
b167057a | 287 | --with-interface=ioctl \ |
0dc2b8f2 | 288 | %{!?with_selinux:--disable-selinux} |
b167057a | 289 | %{__make} -j1 |
c7bbf0c8 | 290 | %{__make} -j1 -C libdm LIB_STATIC=libdevmapper.a |
7e72c866 JR |
291 | |
292 | %install | |
293 | rm -rf $RPM_BUILD_ROOT | |
906ac01a JR |
294 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_sysconfdir}/lvm} \ |
295 | $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{hooks,scripts/local-top} | |
c70b42f6 | 296 | %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}} |
7e72c866 JR |
297 | |
298 | %{__make} install \ | |
299 | DESTDIR=$RPM_BUILD_ROOT \ | |
1ccfba6c AM |
300 | OWNER="" \ |
301 | GROUP="" | |
7e72c866 | 302 | |
b167057a AM |
303 | mv $RPM_BUILD_ROOT%{_libdir}/lib*.so.* $RPM_BUILD_ROOT/%{_lib} |
304 | for lib in $RPM_BUILD_ROOT/%{_lib}/lib*.so.*; do | |
305 | lib=$(echo $lib | sed -e "s#$RPM_BUILD_ROOT##g") | |
306 | slib=$(basename $lib | sed -e 's#\.so\..*#.so#g') | |
307 | ln -sf $lib $RPM_BUILD_ROOT%{_libdir}/$slib | |
308 | done | |
309 | ||
1cfc154f JR |
310 | touch $RPM_BUILD_ROOT%{_sysconfdir}/lvm/lvm.conf |
311 | ||
88c67b5b JR |
312 | %if %{with initrd} |
313 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd | |
314 | install initrd-lvm $RPM_BUILD_ROOT%{_libdir}/initrd/lvm | |
315 | install initrd-dmsetup $RPM_BUILD_ROOT%{_libdir}/initrd/dmsetup | |
7e72c866 | 316 | |
c70b42f6 | 317 | %{?with_dietlibc:install diet-libdevmapper.a $RPM_BUILD_ROOT%{dietlibdir}/libdevmapper.a} |
1306038e | 318 | %endif |
c70b42f6 | 319 | |
906ac01a JR |
320 | install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/lvm2 |
321 | install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/lvm2 | |
322 | ||
c7bbf0c8 | 323 | install libdm/libdevmapper.a $RPM_BUILD_ROOT%{_libdir} |
b167057a | 324 | |
7e72c866 JR |
325 | %clean |
326 | rm -rf $RPM_BUILD_ROOT | |
327 | ||
b167057a AM |
328 | %post -n device-mapper -p /sbin/ldconfig |
329 | %postun -n device-mapper -p /sbin/ldconfig | |
330 | ||
7e72c866 JR |
331 | %files |
332 | %defattr(644,root,root,755) | |
e6ac7970 | 333 | %doc README WHATS_NEW doc/* |
86418c14 JB |
334 | %attr(755,root,root) %{_sbindir}/fsadm |
335 | %attr(755,root,root) %{_sbindir}/lv* | |
336 | %attr(755,root,root) %{_sbindir}/pv* | |
337 | %attr(755,root,root) %{_sbindir}/vg* | |
1ccc459a | 338 | %{?with_clvmd:%attr(755,root,root) %{_usrsbindir}/clvmd} |
86418c14 JB |
339 | %{_mandir}/man5/lvm.conf.5* |
340 | %{?with_clvmd:%{_mandir}/man8/clvmd.8*} | |
341 | %{_mandir}/man8/fsadm.8* | |
342 | %{_mandir}/man8/lv*.8* | |
343 | %{_mandir}/man8/pv*.8* | |
344 | %{_mandir}/man8/vg*.8* | |
99958222 | 345 | %attr(750,root,root) %dir %{_sysconfdir}/lvm |
2316bf4d | 346 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf |
7e72c866 | 347 | |
b167057a AM |
348 | %files -n device-mapper |
349 | %defattr(644,root,root,755) | |
350 | %doc *_DM | |
351 | %attr(755,root,root) %{_sbindir}/dmeventd | |
352 | %attr(755,root,root) %{_sbindir}/dmsetup | |
353 | %attr(755,root,root) /%{_lib}/libdevmapper*.so.*.* | |
354 | %attr(755,root,root) /%{_lib}/liblvm2cmd.so.*.* | |
1306038e AM |
355 | %dir %{_libdir}/device-mapper |
356 | %attr(755,root,root) %{_libdir}/device-mapper/*.so | |
b167057a | 357 | %{_mandir}/man8/dmsetup.8* |
f0dab9f1 | 358 | %{_mandir}/man8/dmeventd.8* |
b167057a AM |
359 | |
360 | %files -n device-mapper-devel | |
361 | %defattr(644,root,root,755) | |
362 | %attr(755,root,root) %{_libdir}/libdevmapper*.so | |
363 | %attr(755,root,root) %{_libdir}/liblvm2cmd.so | |
364 | %{_includedir}/libdevmapper*.h | |
365 | %{_includedir}/lvm2cmd.h | |
366 | %{_pkgconfigdir}/devmapper*.pc | |
367 | ||
368 | %files -n device-mapper-static | |
369 | %defattr(644,root,root,755) | |
370 | %{_libdir}/libdevmapper*.a | |
371 | ||
1306038e | 372 | %if %{with initrd} |
c70b42f6 JR |
373 | %if %{with dietlibc} |
374 | %files -n device-mapper-dietlibc | |
375 | %defattr(644,root,root,755) | |
376 | %{dietlibdir}/libdevmapper.a | |
377 | %endif | |
378 | ||
4a323c26 JR |
379 | %files -n device-mapper-initrd |
380 | %defattr(644,root,root,755) | |
88c67b5b | 381 | %attr(755,root,root) %{_libdir}/initrd/dmsetup |
4a323c26 | 382 | |
7e72c866 JR |
383 | %files initrd |
384 | %defattr(644,root,root,755) | |
88c67b5b | 385 | %attr(755,root,root) %{_libdir}/initrd/lvm |
7e72c866 | 386 | %endif |
906ac01a JR |
387 | |
388 | %files initramfs | |
389 | %defattr(644,root,root,755) | |
390 | %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/lvm2 | |
391 | %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/lvm2 |