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