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