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