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