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