# Conditonal build:
%bcond_without initrd # don't build initrd version
%bcond_without dietlibc # build initrd version with static glibc instead of dietlibc
+%bcond_without python # Python binding
#
-%define realname cryptsetup
+%define realname cryptsetup
Summary: LUKS for dm-crypt implemented in cryptsetup
Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup
Name: cryptsetup-luks
-Version: 1.1.2
+Version: 1.4.1
Release: 1
License: GPL v2
Group: Base
+#Source0Download: http://code.google.com/p/cryptsetup/downloads/list
Source0: http://cryptsetup.googlecode.com/files/%{realname}-%{version}.tar.bz2
-# Source0-md5: f3928c1f1d49fcee39bb1e8d42fe707a
+# Source0-md5: 9253b3f29abf5c6f333eb74128b0df1c
Source1: %{name}-initramfs-root-conf
Source2: %{name}-initramfs-root-hook
Source3: %{name}-initramfs-root-local-top
Source4: %{name}-initramfs-passdev-hook
Source5: %{name}-initramfs-README
-Patch0: %{name}-nostatic.patch
+Patch0: %{name}-diet.patch
+Patch1: %{name}-dont-drag-more-libs.patch
URL: http://code.google.com/p/cryptsetup/
-BuildRequires: autoconf >= 2.57
+BuildRequires: autoconf >= 2.67
BuildRequires: automake
BuildRequires: device-mapper-devel >= 1.02.03
BuildRequires: gettext-devel >= 0.15
BuildRequires: libgcrypt-devel >= 1.1.42
BuildRequires: libselinux-devel
BuildRequires: libsepol-devel
-BuildRequires: libtool
+BuildRequires: libtool >= 2:2.0
BuildRequires: libuuid-devel
BuildRequires: popt-devel >= 1.7
+%if %{with python}
+BuildRequires: python-devel >= 1:2.4
+BuildRequires: rpm-pythonprov
+%endif
%if %{with initrd}
BuildRequires: libgpg-error-static
%if %{with dietlibc}
%description static -l pl.UTF-8
Statyczna wersja biblioteki cryptsetup.
+%package -n python-pycryptsetup
+Summary: Python binding for cryptsetup library
+Summary(pl.UTF-8): Wiązanie Pythona do biblioteki cryptsetup
+Group: Libraries/Python
+Requires: %{name}-libs = %{version}-%{release}
+%pyrequires_eq python-libs
+
+%description -n python-pycryptsetup
+Python binding for cryptsetup library.
+
+%description -n python-pycryptsetup -l pl.UTF-8
+Wiązanie Pythona do biblioteki cryptsetup.
+
%package initrd
Summary: LUKS for dm-crypt implemented in cryptsetup - initrd version
+Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup - wersja initrd
Group: Base
Requires: udev-initrd >= 1:115
Conflicts: geninitrd < 10000.10
%description initrd
This package contains implementation of LUKS for dm-crypt implemented
-in cryptsetup - staticaly linked for initrd.
+in cryptsetup - statically linked for initrd.
+
+%description initrd -l pl.UTF-8
+Ten pakiet zawiera implementację LUKS dla dm-crypta zaimplementowaną
+w cryptsetup - wersję statycznie zlinkowaną dla initrd.
%package initramfs
Summary: LUKS for dm-crypt implemented in cryptsetup - support scripts for initramfs-tools
%prep
%setup -q -n %{realname}-%{version}
%patch0 -p1
+%patch1 -p1
+
+cp -a %{SOURCE5} README.initramfs
-install %{SOURCE5} README.initramfs
+%{__rm} po/stamp-po
%build
%{__gettextize}
%{__automake}
%if %{with initrd}
+CC="%{__cc}"
%configure \
%if %{with dietlibc}
- CC="diet %{__cc} %{rpmcflags} %{rpmldflags} -Os" \
+%configure \
+ CC="diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os" \
+ LIBS="-lcompat" \
ac_cv_lib_popt_poptConfigFileToString=yes \
ac_cv_lib_sepol_sepol_bool_set=no \
ac_cv_lib_selinux_is_selinux_enabled=no \
%endif
- --disable-shared-library \
+%if "%{?configure_cache}" == "1"
+ --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \
+%endif
+ --disable-shared \
--enable-static \
--enable-static-cryptsetup \
+ --disable-udev \
--disable-nls
-%{__make} -C luks
%{__make} -C lib
%if %{with dietlibc}
# we have to do it by hand cause libtool "know better" and forces
# static libs from /usr/lib
-diet %{__cc} %{rpmcflags} %{rpmldflags} -Os -I./lib -static \
+CC="%{__cc}"
+diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \
-o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \
-lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat
%else
%endif
%configure \
- --enable-static
+ --enable-udev \
+ --enable-static \
+ %{?with_python:--enable-python}
%{__make}
%install
%if %{with initrd}
install -d $RPM_BUILD_ROOT%{_libdir}/initrd
-install cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup
+install -p cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup
%endif
-install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/conf-hooks.d/cryptsetup
-install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/cryptroot
-install %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/cryptroot
-install %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/cryptpassdev
+install -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/conf-hooks.d/cryptsetup
+install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/cryptroot
+install -p %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/cryptroot
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/cryptpassdev
+
+%{?with_python:%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/pycryptsetup.{la,a}}
%find_lang %{realname}
%doc AUTHORS ChangeLog TODO
%attr(755,root,root) %{_sbindir}/cryptsetup
%attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.*
-%attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.1
+%attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.4
%{_mandir}/man8/cryptsetup.8*
%files devel
%defattr(644,root,root,755)
%{_libdir}/libcryptsetup.a
+%if %{with python}
+%files -n python-pycryptsetup
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/pycryptsetup.so
+%endif
+
%if %{with initrd}
%files initrd
%defattr(644,root,root,755)