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