3 %bcond_without initrd # don't build initrd version
4 %bcond_without dietlibc # build initrd version with static glibc instead of dietlibc
5 %bcond_without python # Python binding
7 %define realname cryptsetup
8 Summary: LUKS for dm-crypt implemented in cryptsetup
9 Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup
15 #Source0Download: http://code.google.com/p/cryptsetup/downloads/list
16 Source0: http://cryptsetup.googlecode.com/files/%{realname}-%{version}.tar.bz2
17 # Source0-md5: 9253b3f29abf5c6f333eb74128b0df1c
18 Source1: %{name}-initramfs-root-conf
19 Source2: %{name}-initramfs-root-hook
20 Source3: %{name}-initramfs-root-local-top
21 Source4: %{name}-initramfs-passdev-hook
22 Source5: %{name}-initramfs-README
23 Patch0: %{name}-diet.patch
24 Patch1: %{name}-dont-drag-more-libs.patch
25 URL: http://code.google.com/p/cryptsetup/
26 BuildRequires: autoconf >= 2.67
27 BuildRequires: automake
28 BuildRequires: device-mapper-devel >= 1.02.03
29 BuildRequires: gettext-devel >= 0.15
30 BuildRequires: libgcrypt-devel >= 1.1.42
31 BuildRequires: libselinux-devel
32 BuildRequires: libsepol-devel
33 BuildRequires: libtool >= 2:2.0
34 BuildRequires: libuuid-devel
35 BuildRequires: popt-devel >= 1.7
37 BuildRequires: python-devel >= 1:2.4
38 BuildRequires: rpm-pythonprov
41 BuildRequires: libgpg-error-static
43 BuildRequires: device-mapper-dietlibc
44 BuildRequires: dietlibc-static
45 BuildRequires: libgcrypt-dietlibc
46 BuildRequires: libuuid-dietlibc
47 BuildRequires: popt-dietlibc
49 BuildRequires: device-mapper-static >= 1.02.07
50 BuildRequires: libgcrypt-static >= 1.1.42
51 BuildRequires: libselinux-static
52 BuildRequires: libsepol-static
53 BuildRequires: libuuid-static
54 BuildRequires: popt-static
58 Provides: cryptsetup = %{version}
60 Conflicts: udev < 1:118-1
61 Conflicts: udev-core < 1:115
62 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 %define _sbindir /sbin
67 LUKS is the upcoming standard for Linux hard disk encryption. By
68 providing a standard on-disk-format, it does not only facilitate
69 compatibility among distributions, but also provide secure management
70 of multiple user passwords. In contrast to existing solution, LUKS
71 stores all setup necessary setup information in the partition header,
72 enabling the user to transport or migrate his data seamlessly.
74 This package contains implementation of LUKS for dm-crypt implemented
77 %description -l pl.UTF-8
78 LUKS to nadchodzący standard linuksowego szyfrowania twardego dysku.
79 Dostarczając standardowy format danych na dysku nie tylko ułatwia
80 utrzymanie kompatybilności między dystrybucjami, ale także dostarcza
81 bezpieczne zarządzanie wieloma hasłami użytkowników. W przeciwieństwie
82 do istniejącego rozwiązania LUKS przechowuje wszystkie potrzebne
83 informacje o konfiguracji w nagłówku partycji, pozwalając
84 użytkownikowi przenosić lub migrować dane w sposób przezroczysty.
86 Ten pakiet zawiera implementację LUKS dla dm-crytpa zaimplementowaną w
90 Summary: Header files for cryptsetup library
91 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cryptsetup
92 Group: Development/Libraries
93 Requires: %{name} = %{version}-%{release}
94 Requires: device-mapper-devel
95 Requires: libgcrypt-devel >= 1.1.42
96 Obsoletes: cryptsetup-devel
99 Header files for cryptsetup library.
101 %description devel -l pl.UTF-8
102 Pliki nagłówkowe biblioteki cryptsetup.
105 Summary: Static cryptsetup library
106 Summary(pl.UTF-8): Statyczna biblioteka cryptsetup
107 Group: Development/Libraries
108 Requires: %{name}-devel = %{version}-%{release}
109 Obsoletes: cryptsetup-static
112 Static version of cryptsetup library.
114 %description static -l pl.UTF-8
115 Statyczna wersja biblioteki cryptsetup.
117 %package -n python-pycryptsetup
118 Summary: Python binding for cryptsetup library
119 Summary(pl.UTF-8): Wiązanie Pythona do biblioteki cryptsetup
120 Group: Libraries/Python
121 Requires: %{name}-libs = %{version}-%{release}
122 %pyrequires_eq python-libs
124 %description -n python-pycryptsetup
125 Python binding for cryptsetup library.
127 %description -n python-pycryptsetup -l pl.UTF-8
128 Wiązanie Pythona do biblioteki cryptsetup.
131 Summary: LUKS for dm-crypt implemented in cryptsetup - initrd version
132 Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup - wersja initrd
134 Requires: udev-initrd >= 1:115
135 Conflicts: geninitrd < 10000.10
138 This package contains implementation of LUKS for dm-crypt implemented
139 in cryptsetup - statically linked for initrd.
141 %description initrd -l pl.UTF-8
142 Ten pakiet zawiera implementację LUKS dla dm-crypta zaimplementowaną
143 w cryptsetup - wersję statycznie zlinkowaną dla initrd.
146 Summary: LUKS for dm-crypt implemented in cryptsetup - support scripts for initramfs-tools
147 Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup - skrypty dla initramfs-tools
149 Requires: %{name} = %{version}-%{release}
150 Requires: initramfs-tools
152 %description initramfs
153 LUKS for dm-crypt implemented in cryptsetup - support scripts
156 %description initramfs -l pl.UTF-8
157 LUKS dla dm-crypta zaimplementowany w cryptsetup - skrypty dla
161 %setup -q -n %{realname}-%{version}
165 cp -a %{SOURCE5} README.initramfs
182 CC="diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os" \
184 ac_cv_lib_popt_poptConfigFileToString=yes \
185 ac_cv_lib_sepol_sepol_bool_set=no \
186 ac_cv_lib_selinux_is_selinux_enabled=no \
188 %if "%{?configure_cache}" == "1"
189 --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \
193 --enable-static-cryptsetup \
200 # we have to do it by hand cause libtool "know better" and forces
201 # static libs from /usr/lib
203 diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \
204 -o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \
205 -lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat
208 mv src/cryptsetup cryptsetup-initrd
217 %{?with_python:--enable-python}
221 rm -rf $RPM_BUILD_ROOT
222 install -d $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/{conf-hooks.d,hooks,scripts/local-top}
225 DESTDIR=$RPM_BUILD_ROOT
227 install -d $RPM_BUILD_ROOT/%{_lib}
228 mv -f $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so.* $RPM_BUILD_ROOT/%{_lib}
229 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcryptsetup.so.*.*.*) \
230 $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so
233 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
234 install -p cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup
237 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/conf-hooks.d/cryptsetup
238 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/cryptroot
239 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/cryptroot
240 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/cryptpassdev
242 %{?with_python:%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/pycryptsetup.{la,a}}
244 %find_lang %{realname}
247 rm -rf $RPM_BUILD_ROOT
249 %post -p /sbin/ldconfig
250 %postun -p /sbin/ldconfig
252 %files -f %{realname}.lang
253 %defattr(644,root,root,755)
254 %doc AUTHORS ChangeLog TODO
255 %attr(755,root,root) %{_sbindir}/cryptsetup
256 %attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.*
257 %attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.4
258 %{_mandir}/man8/cryptsetup.8*
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_libdir}/libcryptsetup.so
263 %{_libdir}/libcryptsetup.la
264 %{_includedir}/libcryptsetup.h
265 %{_pkgconfigdir}/libcryptsetup.pc
268 %defattr(644,root,root,755)
269 %{_libdir}/libcryptsetup.a
272 %files -n python-pycryptsetup
273 %defattr(644,root,root,755)
274 %attr(755,root,root) %{py_sitedir}/pycryptsetup.so
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_libdir}/initrd/cryptsetup
284 %defattr(644,root,root,755)
285 %doc README.initramfs
286 %attr(755,root,root) %{_datadir}/initramfs-tools/conf-hooks.d/cryptsetup
287 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/cryptroot
288 %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/cryptpassdev
289 %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/cryptroot