3 %bcond_with initrd # don't build initrd version
4 %bcond_with dietlibc # build initrd version with static glibc instead of dietlibc
5 %bcond_with gcrypt # use gcrypt for crypto (instead of openssl)
6 %bcond_with passwdqc # password quality checking via libpasswdqc [conflicts with pwquality]
7 %bcond_with pwquality # password quality checking via libpwquality [conflicts with passwdqc]
8 %bcond_without tests # "make check" run
10 Summary: LUKS for dm-crypt implemented in cryptsetup
11 Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup
17 Source0: https://www.kernel.org/pub/linux/utils/cryptsetup/v2.6/%{name}-%{version}.tar.xz
18 # Source0-md5: 8b67da403a2515dc75d40c42e8196e4e
20 Patch1: no_pty_tests.patch
21 Patch2: %{name}-sh.patch
22 URL: https://gitlab.com/cryptsetup/cryptsetup
23 BuildRequires: autoconf >= 2.67
24 BuildRequires: automake >= 1:1.12
25 BuildRequires: device-mapper-devel >= 1.02.27
26 BuildRequires: gettext-tools >= 0.21
27 BuildRequires: json-c-devel
28 BuildRequires: libargon2-devel >= 20171227
29 BuildRequires: libblkid-devel
30 %{?with_gcrypt:BuildRequires: libgcrypt-devel >= 1.6.1}
31 BuildRequires: libgpg-error-devel
32 %{?with_pwquality:BuildRequires: libpwquality-devel >= 1.0.0}
33 BuildRequires: libselinux-devel
34 BuildRequires: libsepol-devel
35 BuildRequires: libssh-devel
36 BuildRequires: libtool >= 2:2.0
37 BuildRequires: libuuid-devel
38 %{!?with_gcrypt:BuildRequires: openssl-devel >= 0.9.8}
39 %{?with_passwdqc:BuildRequires: passwdqc-devel}
40 BuildRequires: pkgconfig
41 BuildRequires: popt-devel >= 1.7
42 BuildRequires: ruby-asciidoctor
43 BuildRequires: tar >= 1:1.22
46 BuildRequires: libgpg-error-static
48 BuildRequires: device-mapper-dietlibc >= 1.02.27
49 BuildRequires: dietlibc-static
50 BuildRequires: libgcrypt-dietlibc >= 1.6.1
51 BuildRequires: libuuid-dietlibc
52 BuildRequires: popt-dietlibc
54 BuildRequires: device-mapper-static >= 1.02.27
55 BuildRequires: libgcrypt-static >= 1.6.1
56 BuildRequires: libselinux-static
57 BuildRequires: libsepol-static
58 BuildRequires: libuuid-static
59 BuildRequires: popt-static
60 BuildRequires: udev-static
63 Requires: device-mapper >= 1.02.27
64 %{?with_gcrypt:Requires: libgcrypt >= 1.6.1}
65 %{?with_pwquality:Requires: libpwquality >= 1.0.0}
67 Provides: cryptsetup-luks = %{version}-%{release}
68 Obsoletes: cryptsetup-luks < 1.4.1-2
69 %{!?with_initrd:Obsoletes: cryptsetup-initrd < %{version}-%{release}}
70 Obsoletes: python-pycryptsetup < 2.1.0
71 Conflicts: udev < 1:118-1
72 Conflicts: udev-core < 1:115
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75 %define _sbindir /sbin
78 LUKS is the upcoming standard for Linux hard disk encryption. By
79 providing a standard on-disk-format, it does not only facilitate
80 compatibility among distributions, but also provide secure management
81 of multiple user passwords. In contrast to existing solution, LUKS
82 stores all setup necessary setup information in the partition header,
83 enabling the user to transport or migrate his data seamlessly.
85 This package contains implementation of LUKS for dm-crypt implemented
88 %description -l pl.UTF-8
89 LUKS to nadchodzący standard linuksowego szyfrowania twardego dysku.
90 Dostarczając standardowy format danych na dysku nie tylko ułatwia
91 utrzymanie kompatybilności między dystrybucjami, ale także dostarcza
92 bezpieczne zarządzanie wieloma hasłami użytkowników. W przeciwieństwie
93 do istniejącego rozwiązania LUKS przechowuje wszystkie potrzebne
94 informacje o konfiguracji w nagłówku partycji, pozwalając
95 użytkownikowi przenosić lub migrować dane w sposób przezroczysty.
97 Ten pakiet zawiera implementację LUKS dla dm-crytpa zaimplementowaną w
101 Summary: Header files for cryptsetup library
102 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cryptsetup
103 Group: Development/Libraries
104 Requires: %{name} = %{version}-%{release}
105 Requires: device-mapper-devel >= 1.02.27
106 Requires: json-c-devel
107 Requires: libargon2-devel >= 20171227
108 Requires: libblkid-devel
109 %{?with_gcrypt:Requires: libgcrypt-devel >= 1.6.1}
110 Requires: libuuid-devel
111 %{!?with_gcrypt:Requires: openssl-devel >= 0.9.8}
112 Provides: cryptsetup-luks-devel = %{version}-%{release}
113 Obsoletes: cryptsetup-luks-devel < 1.4.1-2
116 Header files for cryptsetup library.
118 %description devel -l pl.UTF-8
119 Pliki nagłówkowe biblioteki cryptsetup.
122 Summary: Static cryptsetup library
123 Summary(pl.UTF-8): Statyczna biblioteka cryptsetup
124 Group: Development/Libraries
125 Requires: %{name}-devel = %{version}-%{release}
126 Provides: cryptsetup-luks-static = %{version}-%{release}
127 Obsoletes: cryptsetup-luks-static < 1.4.1-2
130 Static version of cryptsetup library.
132 %description static -l pl.UTF-8
133 Statyczna wersja biblioteki cryptsetup.
136 Summary: LUKS for dm-crypt implemented in cryptsetup - initrd version
137 Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup - wersja initrd
139 Requires: udev-initrd >= 1:115
140 Provides: cryptsetup-luks-initrd = %{version}-%{release}
141 Obsoletes: cryptsetup-luks-initrd < 1.4.1-2
142 Conflicts: geninitrd < 10000.10
145 This package contains implementation of LUKS for dm-crypt implemented
146 in cryptsetup - statically linked for initrd.
148 %description initrd -l pl.UTF-8
149 Ten pakiet zawiera implementację LUKS dla dm-crypta zaimplementowaną w
150 cryptsetup - wersję statycznie zlinkowaną dla initrd.
154 %{?with_diet:%patch0 -p1}
172 CC="diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os" \
174 ac_cv_lib_popt_poptConfigFileToString=yes \
175 ac_cv_lib_sepol_sepol_bool_set=no \
176 ac_cv_lib_selinux_is_selinux_enabled=no \
178 %if "%{?configure_cache}" == "1"
179 --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \
183 --disable-silent-rules \
185 --enable-static-cryptsetup \
186 --with-crypto-backend=gcrypt \
187 --with-luks2-lock-path=/var/run/%{name} \
188 --with-tmpfilesdir=%{systemdtmpfilesdir}
193 # we have to do it by hand cause libtool "know better" and forces
194 # static libs from /usr/lib
196 diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \
197 -o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \
198 -lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat
201 %{__mv} src/cryptsetup cryptsetup-initrd
209 %{?with_passwdqc:--enable-passwdqc=/etc/passwdqc.conf} \
210 %{?with_pwquality:--enable-pwquality} \
211 --disable-silent-rules \
214 %{?with_gcrypt:--with-crypto-backend=gcrypt} \
215 --with-luks2-lock-path=/var/run/%{name} \
216 --with-tmpfilesdir=%{systemdtmpfilesdir}
219 %{?with_tests:%{__make} check}
222 rm -rf $RPM_BUILD_ROOT
224 install -d $RPM_BUILD_ROOT/var/run/cryptsetup
227 DESTDIR=$RPM_BUILD_ROOT
229 install -d $RPM_BUILD_ROOT/%{_lib}
230 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so.* $RPM_BUILD_ROOT/%{_lib}
231 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcryptsetup.so.*.*.*) \
232 $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so
234 %{__rm} $RPM_BUILD_ROOT%{_libdir}/cryptsetup/libcryptsetup-*.{la,a}
237 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
238 install -p cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup
244 rm -rf $RPM_BUILD_ROOT
246 %post -p /sbin/ldconfig
247 %postun -p /sbin/ldconfig
249 %files -f %{name}.lang
250 %defattr(644,root,root,755)
251 %doc AUTHORS FAQ.md README.md docs/{ChangeLog.old,v*-ReleaseNotes,on-disk-format.pdf}
252 %attr(755,root,root) %{_sbindir}/cryptsetup
253 %attr(755,root,root) %{_sbindir}/cryptsetup-ssh
254 %attr(755,root,root) %{_sbindir}/integritysetup
255 %attr(755,root,root) %{_sbindir}/veritysetup
256 %attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.*
257 %attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.12
258 %dir %{_libdir}/cryptsetup
259 %attr(755,root,root) %{_libdir}/cryptsetup/libcryptsetup-token-ssh.so
260 %{_mandir}/man8/cryptsetup.8*
261 %{_mandir}/man8/cryptsetup-*.8*
262 %{_mandir}/man8/integritysetup.8*
263 %{_mandir}/man8/veritysetup.8*
264 %{systemdtmpfilesdir}/cryptsetup.conf
265 %attr(700,root,root) %dir /var/run/cryptsetup
268 %defattr(644,root,root,755)
269 %attr(755,root,root) %{_libdir}/libcryptsetup.so
270 %{_libdir}/libcryptsetup.la
271 %{_includedir}/libcryptsetup.h
272 %{_pkgconfigdir}/libcryptsetup.pc
275 %defattr(644,root,root,755)
276 %{_libdir}/libcryptsetup.a
280 %defattr(644,root,root,755)
281 %attr(755,root,root) %{_libdir}/initrd/cryptsetup