%bcond_without initrd # don't build initrd version
%bcond_without uclibc
#
+%ifarch sparc sparcv9 sparc64
+%undefine with_uclibc
+%endif
+
Summary: Userspace support for the device-mapper
Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
Name: device-mapper
-Version: 1.02.19
-Release: 4
-License: GPL v2
+Version: 1.02.22
+Release: 3
+License: LGPL v2.1 (library), GPL v2 (executables)
Group: Applications/System
Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz
-# Source0-md5: 37cb592a1fa8fc31dc00cb437bbb4969
+# Source0-md5: 6b94db57cdc9022af1583b3f2acb91cd
# http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html
Patch0: %{name}-disable_dynamic_link.patch
Patch1: %{name}-klibc.patch
Patch3: %{name}-ac.patch
Patch4: %{name}-force-local-headers.patch
Patch5: %{name}-linking.patch
+Patch6: %{name}-dmsetup-export.patch
URL: http://sources.redhat.com/dm/
BuildRequires: autoconf
BuildRequires: automake
-%{?with_initrd:BuildRequires: klibc-static}
+%{?with_initrd:BuildRequires: klibc-static >= 1.3.22}
%{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
%if %{with initrd} && %{with uclibc}
BuildRequires: uClibc-static >= 0.9.26
%package initrd
Summary: Userspace support for the device-mapper - static dmsetup for initrd
Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczne dmsetup dla initrd
+License: GPL v2
Group: Applications/System
Requires: %{name} = %{version}-%{release}
%package devel
Summary: Header files and development documentation for %{name}
Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
+License: LGPL v2.1
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%package static
Summary: Static devmapper library
Summary(pl.UTF-8): Statyczna biblioteka devmapper
+License: LGPL v2.1
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
%package initrd-devel
Summary: Static devmapper library and header files for initrd applications
Summary(pl.UTF-8): Statyczna biblioteka devmapper i jej pliki nagłówkowe dla aplikacji initrd
+License: LGPL v2.1
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: klibc
%package scripts
Summary: Additional scripts
Summary(pl.UTF-8): Dodatkowe skrypty
+License: GPL v2
Group: Applications/System
Requires: %{name} = %{version}-%{release}
Requires: util-linux
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
%build
cp -f /usr/share/automake/config.sub autoconf
--with-interface=ioctl \
--disable-nls
sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
+# On AC it successfully finds canonicalize_file_name() from glibc's libc.a
+# On TH it it fails to do anything with libc.a due link errors (undefined reference to `_Unwind_Resume', undefined reference to `__gcc_personality_v0', ...)
+# really it should check func from klibc libc.a
+sed -i -e 's,#define HAVE_CANONICALIZE_FILE_NAME 1,#undef HAVE_CANONICALIZE_FILE_NAME,' include/configure.h
%{__make}
cp -a dmsetup/dmsetup.static initrd-dmsetup
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/{%{_lib},%{_libdir}/%{name}}
+install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}}
%{__make} install \
usrlibdir="$RPM_BUILD_ROOT%{_libdir}" \
DESTDIR=$RPM_BUILD_ROOT
-SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper.so.*.*)
+SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so.*.*)
ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so
-SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper-event.so.*.*)
+SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so.*.*)
ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so
mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
%files
%defattr(644,root,root,755)
-%doc INTRO INSTALL README scripts/*
+%doc INTRO INSTALL README
%attr(755,root,root) %{_sbindir}/dmeventd
%attr(755,root,root) %{_sbindir}/dmsetup
%attr(755,root,root) /%{_lib}/libdevmapper.so.*.*
%attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.*
-%{_mandir}/man8/*
+%{_mandir}/man8/dmsetup.8*
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libdevmapper.so
%attr(755,root,root) %{_libdir}/libdevmapper-event.so
%{_includedir}/libdevmapper*.h
-%{_pkgconfigdir}/*.pc
+%{_pkgconfigdir}/devmapper.pc
+%{_pkgconfigdir}/devmapper-event.pc
%files static
%defattr(644,root,root,755)