]>
Commit | Line | Data |
---|---|---|
5eb10616 JB |
1 | # |
2 | # Conditonal build: | |
3ee30d05 | 3 | %bcond_with initrd # don't build initrd version |
c2608e02 | 4 | %bcond_with dietlibc # build initrd version with static glibc instead of dietlibc |
b240e50f | 5 | %bcond_with gcrypt # use gcrypt for crypto (instead of openssl) |
f13756af JB |
6 | %bcond_with passwdqc # password quality checking via libpasswdqc [conflicts with pwquality] |
7 | %bcond_with pwquality # password quality checking via libpwquality [conflicts with passwdqc] | |
92620a6e | 8 | %bcond_without static_libs # static library |
2b412273 | 9 | %bcond_without tests # "make check" run |
ef897fda | 10 | |
2488c838 | 11 | Summary: LUKS for dm-crypt implemented in cryptsetup |
29f5822a | 12 | Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup |
ef897fda | 13 | Name: cryptsetup |
53196639 | 14 | Version: 2.7.2 |
4e79a0b3 | 15 | Release: 1 |
d7593791 | 16 | License: GPL v2 |
6351d6a5 | 17 | Group: Base |
1ce5308b | 18 | Source0: https://www.kernel.org/pub/linux/utils/cryptsetup/v2.7/%{name}-%{version}.tar.xz |
53196639 | 19 | # Source0-md5: d13fa531c37f05824d67ae92f3c6f73b |
ef897fda | 20 | Patch0: diet.patch |
b3d74a9a | 21 | Patch1: no_pty_tests.patch |
207d2b78 | 22 | URL: https://gitlab.com/cryptsetup/cryptsetup |
c905abc3 | 23 | BuildRequires: autoconf >= 2.67 |
d4db5a85 JB |
24 | BuildRequires: automake >= 1:1.12 |
25 | BuildRequires: device-mapper-devel >= 1.02.27 | |
b5de8ad0 | 26 | BuildRequires: gettext-tools >= 0.21 |
e13ad7cf AM |
27 | BuildRequires: json-c-devel |
28 | BuildRequires: libargon2-devel >= 20171227 | |
021afb9d | 29 | BuildRequires: libblkid-devel |
b240e50f | 30 | %{?with_gcrypt:BuildRequires: libgcrypt-devel >= 1.6.1} |
d4db5a85 | 31 | BuildRequires: libgpg-error-devel |
196834e2 | 32 | %{?with_pwquality:BuildRequires: libpwquality-devel >= 1.0.0} |
0b90291e JB |
33 | BuildRequires: libselinux-devel |
34 | BuildRequires: libsepol-devel | |
b5de8ad0 | 35 | BuildRequires: libssh-devel |
c905abc3 | 36 | BuildRequires: libtool >= 2:2.0 |
0b90291e | 37 | BuildRequires: libuuid-devel |
1ce5308b | 38 | BuildRequires: linux-libc-headers >= 7:6.4 |
b240e50f | 39 | %{!?with_gcrypt:BuildRequires: openssl-devel >= 0.9.8} |
f13756af | 40 | %{?with_passwdqc:BuildRequires: passwdqc-devel} |
d4db5a85 | 41 | BuildRequires: pkgconfig |
79b6c53c | 42 | BuildRequires: popt-devel >= 1.7 |
92620a6e | 43 | BuildRequires: rpmbuild(macros) >= 1.527 |
4e79a0b3 | 44 | BuildRequires: ruby-asciidoctor |
15278b5b JB |
45 | BuildRequires: tar >= 1:1.22 |
46 | BuildRequires: xz | |
d07d45f7 | 47 | %if %{with initrd} |
21d48aec JR |
48 | BuildRequires: libgpg-error-static |
49 | %if %{with dietlibc} | |
df4d3321 | 50 | BuildRequires: device-mapper-dietlibc >= 1.02.27 |
ef897fda | 51 | BuildRequires: dietlibc-static |
15278b5b | 52 | BuildRequires: libgcrypt-dietlibc >= 1.6.1 |
21d48aec JR |
53 | BuildRequires: libuuid-dietlibc |
54 | BuildRequires: popt-dietlibc | |
55 | %else | |
df4d3321 | 56 | BuildRequires: device-mapper-static >= 1.02.27 |
15278b5b | 57 | BuildRequires: libgcrypt-static >= 1.6.1 |
a6fd3218 | 58 | BuildRequires: libselinux-static |
8d9e50de | 59 | BuildRequires: libsepol-static |
a6fd3218 | 60 | BuildRequires: libuuid-static |
61 | BuildRequires: popt-static | |
c2608e02 | 62 | BuildRequires: udev-static |
21d48aec | 63 | %endif |
5eb10616 | 64 | %endif |
2cbcb55c | 65 | Requires: %{name}-libs%{?_isa} = %{version}-%{release} |
d1a372bb | 66 | Requires: device-mapper >= 1.02.27 |
b240e50f | 67 | %{?with_gcrypt:Requires: libgcrypt >= 1.6.1} |
196834e2 | 68 | %{?with_pwquality:Requires: libpwquality >= 1.0.0} |
79b6c53c | 69 | Requires: popt >= 1.7 |
f96aa109 JR |
70 | Provides: cryptsetup-luks = %{version}-%{release} |
71 | Obsoletes: cryptsetup-luks < 1.4.1-2 | |
3ee30d05 | 72 | %{!?with_initrd:Obsoletes: cryptsetup-initrd < %{version}-%{release}} |
b240e50f | 73 | Obsoletes: python-pycryptsetup < 2.1.0 |
751c89df ER |
74 | Conflicts: udev < 1:118-1 |
75 | Conflicts: udev-core < 1:115 | |
6351d6a5 | 76 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
77 | ||
78 | %define _sbindir /sbin | |
79 | ||
80 | %description | |
6e98e6fb | 81 | LUKS is the upcoming standard for Linux hard disk encryption. By |
82 | providing a standard on-disk-format, it does not only facilitate | |
83 | compatibility among distributions, but also provide secure management | |
84 | of multiple user passwords. In contrast to existing solution, LUKS | |
85 | stores all setup necessary setup information in the partition header, | |
86 | enabling the user to transport or migrate his data seamlessly. | |
6351d6a5 | 87 | |
6e98e6fb | 88 | This package contains implementation of LUKS for dm-crypt implemented |
89 | in cryptsetup. | |
6351d6a5 | 90 | |
77f30028 JR |
91 | %description -l pl.UTF-8 |
92 | LUKS to nadchodzący standard linuksowego szyfrowania twardego dysku. | |
93 | Dostarczając standardowy format danych na dysku nie tylko ułatwia | |
94 | utrzymanie kompatybilności między dystrybucjami, ale także dostarcza | |
95 | bezpieczne zarządzanie wieloma hasłami użytkowników. W przeciwieństwie | |
96 | do istniejącego rozwiązania LUKS przechowuje wszystkie potrzebne | |
97 | informacje o konfiguracji w nagłówku partycji, pozwalając | |
98 | użytkownikowi przenosić lub migrować dane w sposób przezroczysty. | |
12cca230 | 99 | |
77f30028 | 100 | Ten pakiet zawiera implementację LUKS dla dm-crytpa zaimplementowaną w |
12cca230 JB |
101 | cryptsetup. |
102 | ||
2cbcb55c JP |
103 | %package libs |
104 | Summary: cryptsetup shared library | |
105 | Summary(pl.UTF-8): Biblioteka współdzielona cryptsetup | |
106 | Group: Libraries | |
107 | ||
108 | %description libs | |
109 | cryptsetup shared library. | |
110 | ||
111 | %description libs -l pl.UTF-8 | |
112 | Biblioteka współdzielona cryptsetup. | |
113 | ||
6351d6a5 | 114 | %package devel |
115 | Summary: Header files for cryptsetup library | |
29f5822a | 116 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki cryptsetup |
6351d6a5 | 117 | Group: Development/Libraries |
2cbcb55c | 118 | Requires: %{name}-libs%{?_isa} = %{version}-%{release} |
d4db5a85 | 119 | Requires: device-mapper-devel >= 1.02.27 |
6007b91c | 120 | Requires: json-c-devel |
de879d31 | 121 | Requires: libargon2-devel >= 20171227 |
6007b91c | 122 | Requires: libblkid-devel |
b240e50f | 123 | %{?with_gcrypt:Requires: libgcrypt-devel >= 1.6.1} |
6007b91c | 124 | Requires: libuuid-devel |
b240e50f | 125 | %{!?with_gcrypt:Requires: openssl-devel >= 0.9.8} |
ef897fda ER |
126 | Provides: cryptsetup-luks-devel = %{version}-%{release} |
127 | Obsoletes: cryptsetup-luks-devel < 1.4.1-2 | |
6351d6a5 | 128 | |
129 | %description devel | |
130 | Header files for cryptsetup library. | |
131 | ||
77f30028 JR |
132 | %description devel -l pl.UTF-8 |
133 | Pliki nagłówkowe biblioteki cryptsetup. | |
6351d6a5 | 134 | |
135 | %package static | |
136 | Summary: Static cryptsetup library | |
29f5822a | 137 | Summary(pl.UTF-8): Statyczna biblioteka cryptsetup |
6351d6a5 | 138 | Group: Development/Libraries |
139 | Requires: %{name}-devel = %{version}-%{release} | |
ef897fda ER |
140 | Provides: cryptsetup-luks-static = %{version}-%{release} |
141 | Obsoletes: cryptsetup-luks-static < 1.4.1-2 | |
6351d6a5 | 142 | |
143 | %description static | |
144 | Static version of cryptsetup library. | |
145 | ||
77f30028 | 146 | %description static -l pl.UTF-8 |
6351d6a5 | 147 | Statyczna wersja biblioteki cryptsetup. |
148 | ||
d07d45f7 ER |
149 | %package initrd |
150 | Summary: LUKS for dm-crypt implemented in cryptsetup - initrd version | |
1c89131c | 151 | Summary(pl.UTF-8): LUKS dla dm-crypta zaimplementowany w cryptsetup - wersja initrd |
d07d45f7 | 152 | Group: Base |
311e3692 | 153 | Requires: udev-initrd >= 1:115 |
ef897fda ER |
154 | Provides: cryptsetup-luks-initrd = %{version}-%{release} |
155 | Obsoletes: cryptsetup-luks-initrd < 1.4.1-2 | |
2dd5e1c3 | 156 | Conflicts: geninitrd < 10000.10 |
d07d45f7 ER |
157 | |
158 | %description initrd | |
159 | This package contains implementation of LUKS for dm-crypt implemented | |
1c89131c JB |
160 | in cryptsetup - statically linked for initrd. |
161 | ||
162 | %description initrd -l pl.UTF-8 | |
ef897fda ER |
163 | Ten pakiet zawiera implementację LUKS dla dm-crypta zaimplementowaną w |
164 | cryptsetup - wersję statycznie zlinkowaną dla initrd. | |
d07d45f7 | 165 | |
6351d6a5 | 166 | %prep |
ef897fda | 167 | %setup -q |
396f27d3 | 168 | %{?with_diet:%patch0 -p1} |
b3d74a9a | 169 | %patch1 -p1 |
6351d6a5 | 170 | |
c627e74c JB |
171 | %{__rm} po/stamp-po |
172 | ||
6351d6a5 | 173 | %build |
8d9e50de | 174 | %{__gettextize} |
d7593791 | 175 | %{__libtoolize} |
8d9e50de | 176 | %{__aclocal} -I m4 |
177 | %{__autoconf} | |
d7593791 | 178 | %{__autoheader} |
8d9e50de | 179 | %{__automake} |
d07d45f7 ER |
180 | |
181 | %if %{with initrd} | |
802ed4ef | 182 | CC="%{__cc}" |
a6fd3218 | 183 | %configure \ |
21d48aec | 184 | %if %{with dietlibc} |
04af2f11 | 185 | CC="diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os" \ |
8a7a87e4 | 186 | LIBS="-lcompat" \ |
21d48aec JR |
187 | ac_cv_lib_popt_poptConfigFileToString=yes \ |
188 | ac_cv_lib_sepol_sepol_bool_set=no \ | |
189 | ac_cv_lib_selinux_is_selinux_enabled=no \ | |
802ed4ef ER |
190 | %endif |
191 | %if "%{?configure_cache}" == "1" | |
192 | --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \ | |
21d48aec | 193 | %endif |
196834e2 | 194 | --disable-nls \ |
8a7a87e4 | 195 | --disable-shared \ |
b240e50f | 196 | --disable-silent-rules \ |
5eb10616 | 197 | --enable-static \ |
e13ad7cf | 198 | --enable-static-cryptsetup \ |
b240e50f JB |
199 | --with-crypto-backend=gcrypt \ |
200 | --with-luks2-lock-path=/var/run/%{name} \ | |
201 | --with-tmpfilesdir=%{systemdtmpfilesdir} | |
21d48aec | 202 | |
21d48aec JR |
203 | %{__make} -C lib |
204 | ||
205 | %if %{with dietlibc} | |
206 | # we have to do it by hand cause libtool "know better" and forces | |
207 | # static libs from /usr/lib | |
802ed4ef | 208 | CC="%{__cc}" |
04af2f11 | 209 | diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \ |
593621cb JR |
210 | -o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \ |
211 | -lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat | |
21d48aec JR |
212 | %else |
213 | %{__make} -C src | |
6007b91c | 214 | %{__mv} src/cryptsetup cryptsetup-initrd |
21d48aec | 215 | %endif |
23904b26 | 216 | |
d07d45f7 ER |
217 | %{__make} clean |
218 | %endif | |
219 | ||
220 | %configure \ | |
e13ad7cf | 221 | --enable-libargon2 \ |
f13756af JB |
222 | %{?with_passwdqc:--enable-passwdqc=/etc/passwdqc.conf} \ |
223 | %{?with_pwquality:--enable-pwquality} \ | |
021afb9d | 224 | --disable-silent-rules \ |
92620a6e | 225 | %{__enable_disable static_libs static} \ |
021afb9d | 226 | --enable-udev \ |
b240e50f JB |
227 | %{?with_gcrypt:--with-crypto-backend=gcrypt} \ |
228 | --with-luks2-lock-path=/var/run/%{name} \ | |
229 | --with-tmpfilesdir=%{systemdtmpfilesdir} | |
6351d6a5 | 230 | %{__make} |
231 | ||
b0d1eeaa AM |
232 | %{?with_tests:%{__make} check} |
233 | ||
6351d6a5 | 234 | %install |
235 | rm -rf $RPM_BUILD_ROOT | |
236 | ||
e13ad7cf AM |
237 | install -d $RPM_BUILD_ROOT/var/run/cryptsetup |
238 | ||
6351d6a5 | 239 | %{__make} install \ |
240 | DESTDIR=$RPM_BUILD_ROOT | |
241 | ||
242 | install -d $RPM_BUILD_ROOT/%{_lib} | |
5be6882d | 243 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so.* $RPM_BUILD_ROOT/%{_lib} |
d7593791 | 244 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcryptsetup.so.*.*.*) \ |
6351d6a5 | 245 | $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so |
246 | ||
92620a6e JP |
247 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/cryptsetup/libcryptsetup-*.la |
248 | %{?with_static_libs:%{__rm} $RPM_BUILD_ROOT%{_libdir}/cryptsetup/libcryptsetup-*.a} | |
5be6882d | 249 | |
d07d45f7 | 250 | %if %{with initrd} |
927d0cdf | 251 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd |
802ed4ef | 252 | install -p cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup |
d07d45f7 ER |
253 | %endif |
254 | ||
ef897fda | 255 | %find_lang %{name} |
6351d6a5 | 256 | |
257 | %clean | |
258 | rm -rf $RPM_BUILD_ROOT | |
259 | ||
2cbcb55c JP |
260 | %post libs -p /sbin/ldconfig |
261 | %postun libs -p /sbin/ldconfig | |
6351d6a5 | 262 | |
ef897fda | 263 | %files -f %{name}.lang |
6351d6a5 | 264 | %defattr(644,root,root,755) |
4e79a0b3 | 265 | %doc AUTHORS FAQ.md README.md docs/{ChangeLog.old,v*-ReleaseNotes,on-disk-format.pdf} |
6351d6a5 | 266 | %attr(755,root,root) %{_sbindir}/cryptsetup |
5be6882d | 267 | %attr(755,root,root) %{_sbindir}/cryptsetup-ssh |
e13ad7cf | 268 | %attr(755,root,root) %{_sbindir}/integritysetup |
56c60c79 | 269 | %attr(755,root,root) %{_sbindir}/veritysetup |
5be6882d JB |
270 | %dir %{_libdir}/cryptsetup |
271 | %attr(755,root,root) %{_libdir}/cryptsetup/libcryptsetup-token-ssh.so | |
d7593791 | 272 | %{_mandir}/man8/cryptsetup.8* |
4e79a0b3 | 273 | %{_mandir}/man8/cryptsetup-*.8* |
e13ad7cf | 274 | %{_mandir}/man8/integritysetup.8* |
56c60c79 | 275 | %{_mandir}/man8/veritysetup.8* |
e13ad7cf AM |
276 | %{systemdtmpfilesdir}/cryptsetup.conf |
277 | %attr(700,root,root) %dir /var/run/cryptsetup | |
6351d6a5 | 278 | |
2cbcb55c JP |
279 | %files libs |
280 | %defattr(644,root,root,755) | |
281 | %attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.* | |
282 | %attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.12 | |
283 | ||
6351d6a5 | 284 | %files devel |
285 | %defattr(644,root,root,755) | |
286 | %attr(755,root,root) %{_libdir}/libcryptsetup.so | |
287 | %{_libdir}/libcryptsetup.la | |
d7593791 | 288 | %{_includedir}/libcryptsetup.h |
79b6c53c | 289 | %{_pkgconfigdir}/libcryptsetup.pc |
6351d6a5 | 290 | |
92620a6e | 291 | %if %{with static_libs} |
a6fd3218 | 292 | %files static |
293 | %defattr(644,root,root,755) | |
294 | %{_libdir}/libcryptsetup.a | |
92620a6e | 295 | %endif |
d07d45f7 ER |
296 | |
297 | %if %{with initrd} | |
298 | %files initrd | |
299 | %defattr(644,root,root,755) | |
927d0cdf | 300 | %attr(755,root,root) %{_libdir}/initrd/cryptsetup |
d07d45f7 | 301 | %endif |