]> git.pld-linux.org Git - packages/device-mapper.git/blobdiff - device-mapper.spec
- disable configure_cache as configure is ran twice with different CFLAGS
[packages/device-mapper.git] / device-mapper.spec
index f11b81bc4a8c26f1746474cc6fdc2bdd31b471b2..45af22946ecbcf98c1aec0bcc983d223a3dfd6a1 100644 (file)
@@ -1,41 +1,61 @@
 #
 # Conditional build:
 %bcond_without selinux         # build without SELinux support
+%bcond_without initrd          # don't build initrd version
 #
 Summary:       Userspace support for the device-mapper
 Summary(pl):   Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika
 Name:          device-mapper
-Version:       1.00.19
-Release:       2
-License:       GPL
+Version:       1.02.05
+Release:       0.1
+License:       GPL v2
 Group:         Applications/System
 Source0:       ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz
-# Source0-md5: a7a97c469f22e3ec2cdcb5aae5603f3f
+# Source0-md5: e5cfc57a6e36af883dfedd9e9106f97e
+# http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html
+Patch0:                %{name}-disable_dynamic_link.patch
+Patch1:                %{name}-klibc.patch
+Patch2:                %{name}-getopt.patch
 URL:           http://sources.redhat.com/dm/
 BuildRequires: autoconf
 BuildRequires: automake
+%{?with_initrd:BuildRequires:  klibc-static}
 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
 %{?with_selinux:Requires:      libselinux >= 1.10}
 Conflicts:     dev < 2.9.0-8
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%undefine      configure_cache
 %define                _sbindir        /sbin
 
 %description
-The goal of this driver is to support volume management.
-The driver enables the definition of new block devices composed of
-ranges of sectors of existing devices. This can be used to define
-disk partitions - or logical volumes. This light-weight kernel
-component can support user-space tools for logical volume management.
+The goal of this driver is to support volume management. The driver
+enables the definition of new block devices composed of ranges of
+sectors of existing devices. This can be used to define disk
+partitions - or logical volumes. This light-weight kernel component
+can support user-space tools for logical volume management.
 
 %description -l pl
-Celem tego sterownika jest obs³uga zarz±dzania wolumenami.
-Sterownik w³±cza definiowanie nowych urz±dzeñ blokowych z³o¿onych z
-przedzia³ów sektorów na istniej±cych urz±dzeniach. Mo¿e to byæ
-wykorzystane do definiowania partycji na dysku lub logicznych
-wolumenów. Ten lekki sk³adnik j±dra mo¿e wspieraæ dzia³aj±ce w
-przestrzeni u¿ytkownika narzêdzia do zarz±dzania logicznymi
-wolumenami.
+Celem tego sterownika jest obs³uga zarz±dzania wolumenami. Sterownik
+w³±cza definiowanie nowych urz±dzeñ blokowych z³o¿onych z przedzia³ów
+sektorów na istniej±cych urz±dzeniach. Mo¿e to byæ wykorzystane do
+definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
+sk³adnik j±dra mo¿e wspieraæ dzia³aj±ce w przestrzeni u¿ytkownika
+narzêdzia do zarz±dzania logicznymi wolumenami.
+
+%package initrd
+Summary:       Userspace support for the device-mapper - static dmsetup for initrd
+Summary(pl):   Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika - statyczne dmsetup dla initrd
+Group:         Applications/System
+Requires:      %{name} = %{version}-%{release}
+
+%description initrd
+Userspace support for the device-mapper - static dmsetup binary for
+initrd.
+
+%description initrd -l pl
+Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika - statyczna
+wersja dmsetup dla initrd.
 
 %package devel
 Summary:       Header files and development documentation for %{name}
@@ -61,19 +81,76 @@ Static devmapper library.
 %description static -l pl
 Statyczna biblioteka devmapper.
 
+%package initrd-devel
+Summary:       Static devmapper library and header files for initrd applications
+Summary(pl):   Statyczna biblioteka devmapper i jej pliki nag³ówkowe dla aplikacji initrd
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{version}-%{release}
+Requires:      klibc
+
+%description initrd-devel
+Static devmapper library and its header files for initrd applications
+linked with klibc.
+
+%description initrd-devel -l pl
+Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki
+nag³ówkowe dla aplikacji u¿ywanych w initrd.
+
+%package scripts
+Summary:       Additional scripts
+Summary(pl):   Dodatkowe skrypty
+Group:         Applications/System
+Requires:      %{name} = %{version}-%{release}
+Requires:      util-linux
+
+%description scripts
+Additional scripts.
+
+%description scripts -l pl
+Dodatkowe skrypty.
+
 %prep
 %setup -q -n %{name}.%{version}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+# klcc puts its own -I before any options, so klibc's <linux/*>
+# overrides include/linux/*, requiring very fresh kernel headers
+sed -i -e 's,<linux/dm-ioctl.h>,"../../kernel/ioctl/dm-ioctl.h",' lib/ioctl/libdm-iface.c
 
 %build
 cp -f /usr/share/automake/config.sub autoconf
 %{__aclocal}
 %{__autoconf}
+
+%if %{with initrd}
 %configure \
-       SELINUX=%{?with_selinux:yes}%{!?with_selinux:no} \
+       --disable-selinux \
        --with-optimisation="%{rpmcflags}" \
        --with-user=%(id -u) \
        --with-group=%(id -g) \
-       --with-interface=ioctl
+       --with-interface=ioctl \
+       --enable-static_link \
+       --disable-dynamic_link \
+       --enable-klibc \
+       CC="klcc -static"
+sed -i -e 's#-Dmalloc=rpl_malloc##g' make.tmpl
+%{__make}
+
+cp -a dmsetup/dmsetup.static initrd-dmsetup
+cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper.a
+%{__make} clean
+%endif
+
+%configure \
+       --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \
+       --with-optimisation="%{rpmcflags} -DHAVE_GETOPTLONG" \
+       --with-user=%(id -u) \
+       --with-group=%(id -g) \
+       --with-interface=ioctl \
+       --enable-dmeventd \
+       --disable-klibc
 %{__make}
 
 ar cru libdevmapper.a lib/ioctl/*.o lib/*.o
@@ -81,7 +158,7 @@ ranlib libdevmapper.a
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}}
+install -d $RPM_BUILD_ROOT/{%{_lib},%{_libdir}/%{name},/usr/{%{_lib},include}/klibc}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
@@ -89,9 +166,12 @@ install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}}
 SONAME=$(basename $(ls -1 $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.*))
 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so
 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
-cp -f scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
+install scripts/* $RPM_BUILD_ROOT/%{_libdir}/%{name}
 
 install libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
+%{?with_initrd:install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir}}
+%{?with_initrd:install initrd-libdevmapper.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a}
+%{?with_initrd:install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -101,11 +181,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc INTRO INSTALL README
-%attr(755,root,root) %{_sbindir}/*
+%doc INTRO INSTALL README scripts/*
+%attr(755,root,root) %{_sbindir}/dmsetup
 %attr(755,root,root) /%{_lib}/lib*.so.*.*
-%dir %{_libdir}/%{name}
-%attr(755,root,root) %{_libdir}/%{name}/*
 %{_mandir}/man8/*
 
 %files devel
@@ -116,3 +194,19 @@ rm -rf $RPM_BUILD_ROOT
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/lib*.a
+
+%files scripts
+%defattr(644,root,root,755)
+%dir %{_libdir}/%{name}
+%{_libdir}/%{name}/*
+
+%if %{with initrd}
+%files initrd
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_sbindir}/initrd-dmsetup
+
+%files initrd-devel
+%defattr(644,root,root,755)
+%{_prefix}/%{_lib}/klibc/libdevmapper.a
+%{_includedir}/klibc/libdevmapper.h
+%endif
This page took 0.095556 seconds and 4 git commands to generate.