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