-# TODO: optflags
+#
+# Conditional build:
+%bcond_without dist_kernel # without distribution kernel headers
+#
Summary: Userspace support for the device-mapper
Summary(pl): Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika
Name: device-mapper
-Version: 1.00.05
+Version: 1.00.09
Release: 0.1@%{_kernel_ver_str}
License: GPL
Group: Applications/System
-Source0: ftp://ftp.sistina.com/pub/LVM2/device-mapper/%{name}.%{version}.tgz
-# Source0-md5: f8203b25454dcef90f37b3bdf42d8817
+Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz
+# Source0-md5: c08c9478d7176a4ba2de1707baa41909
Patch0: %{name}-install.patch
+Patch1: %{name}-opt.patch
BuildRequires: autoconf
BuildRequires: automake
+%{!?with_dist_kernel:BuildRequires: kernel-headers}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sbindir /sbin
%prep
%setup -q -n %{name}.%{version}
%patch0 -p1
+%patch1 -p1
%build
+cp -f /usr/share/automake/config.sub autoconf
%{__aclocal}
%{__autoconf}
%configure \
+ --with-user=$(id -u) \
+ --with-group=$(id -g) \
--with-interface=ioctl \
- --with-kernel-dir=%{_kernelsrcdir} \
--with-kernel-version=%{_kernel_ver}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/lib
+install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/lib
+mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
+cp -f scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
install libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
%defattr(644,root,root,755)
%doc INTRO INSTALL README
%attr(755,root,root) %{_sbindir}/*
-%attr(755,root,root) /lib/lib*.so.*.*
+%attr(755,root,root) /%{_lib}/lib*.so.*.*
+%dir %{_libdir}/%{name}
+%attr(755,root,root) %{_libdir}/%{name}/*
%{_mandir}/man8/*
%files devel