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