]> TLD Linux GIT Repositories - packages/cryptsetup.git/blob - cryptsetup.spec
- updated to 2.3.4
[packages/cryptsetup.git] / cryptsetup.spec
1 #
2 # Conditonal build:
3 %bcond_with     initrd          # don't build initrd version
4 %bcond_with     dietlibc        # build initrd version with static glibc instead of dietlibc
5 %bcond_with     gcrypt          # use gcrypt for crypto (instead of openssl)
6 %bcond_with     passwdqc        # password quality checking via libpasswdqc [conflicts with pwquality]
7 %bcond_with     pwquality       # password quality checking via libpwquality [conflicts with passwdqc]
8 %bcond_without  tests           # "make check" run
9
10 Summary:        LUKS for dm-crypt implemented in cryptsetup
11 Summary(pl.UTF-8):      LUKS dla dm-crypta zaimplementowany w cryptsetup
12 Name:           cryptsetup
13 Version:        2.3.4
14 Release:        1
15 License:        GPL v2
16 Group:          Base
17 Source0:        https://www.kernel.org/pub/linux/utils/cryptsetup/v2.3/%{name}-%{version}.tar.xz
18 # Source0-md5:  911272e73181fdc850bb4d25103a9f83
19 Patch0:         diet.patch
20 URL:            https://gitlab.com/cryptsetup/cryptsetup
21 BuildRequires:  autoconf >= 2.67
22 BuildRequires:  automake >= 1:1.12
23 BuildRequires:  device-mapper-devel >= 1.02.27
24 BuildRequires:  gettext-tools >= 0.18.3
25 BuildRequires:  json-c-devel
26 BuildRequires:  libargon2-devel >= 20171227
27 BuildRequires:  libblkid-devel
28 %{?with_gcrypt:BuildRequires:   libgcrypt-devel >= 1.6.1}
29 BuildRequires:  libgpg-error-devel
30 %{?with_pwquality:BuildRequires:        libpwquality-devel >= 1.0.0}
31 BuildRequires:  libselinux-devel
32 BuildRequires:  libsepol-devel
33 BuildRequires:  libtool >= 2:2.0
34 BuildRequires:  libuuid-devel
35 %{!?with_gcrypt:BuildRequires:  openssl-devel >= 0.9.8}
36 %{?with_passwdqc:BuildRequires: passwdqc-devel}
37 BuildRequires:  pkgconfig
38 BuildRequires:  popt-devel >= 1.7
39 BuildRequires:  tar >= 1:1.22
40 BuildRequires:  xz
41 %if %{with initrd}
42 BuildRequires:  libgpg-error-static
43         %if %{with dietlibc}
44 BuildRequires:  device-mapper-dietlibc >= 1.02.27
45 BuildRequires:  dietlibc-static
46 BuildRequires:  libgcrypt-dietlibc >= 1.6.1
47 BuildRequires:  libuuid-dietlibc
48 BuildRequires:  popt-dietlibc
49         %else
50 BuildRequires:  device-mapper-static >= 1.02.27
51 BuildRequires:  libgcrypt-static >= 1.6.1
52 BuildRequires:  libselinux-static
53 BuildRequires:  libsepol-static
54 BuildRequires:  libuuid-static
55 BuildRequires:  popt-static
56 BuildRequires:  udev-static
57         %endif
58 %endif
59 %{?with_gcrypt:Requires:        libgcrypt >= 1.6.1}
60 %{?with_pwquality:Requires:     libpwquality >= 1.0.0}
61 Requires:       popt >= 1.7
62 Provides:       cryptsetup-luks = %{version}-%{release}
63 Obsoletes:      cryptsetup-luks < 1.4.1-2
64 %{!?with_initrd:Obsoletes:      cryptsetup-initrd < %{version}-%{release}}
65 Obsoletes:      python-pycryptsetup < 2.1.0
66 Conflicts:      udev < 1:118-1
67 Conflicts:      udev-core < 1:115
68 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69
70 %define         _sbindir        /sbin
71
72 %description
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.
79
80 This package contains implementation of LUKS for dm-crypt implemented
81 in cryptsetup.
82
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.
91
92 Ten pakiet zawiera implementację LUKS dla dm-crytpa zaimplementowaną w
93 cryptsetup.
94
95 %package devel
96 Summary:        Header files for cryptsetup library
97 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki cryptsetup
98 Group:          Development/Libraries
99 Requires:       %{name} = %{version}-%{release}
100 Requires:       device-mapper-devel >= 1.02.27
101 Requires:       libargon2-devel >= 20171227
102 %{?with_gcrypt:Requires:        libgcrypt-devel >= 1.6.1}
103 %{!?with_gcrypt:Requires:       openssl-devel >= 0.9.8}
104 Provides:       cryptsetup-luks-devel = %{version}-%{release}
105 Obsoletes:      cryptsetup-luks-devel < 1.4.1-2
106
107 %description devel
108 Header files for cryptsetup library.
109
110 %description devel -l pl.UTF-8
111 Pliki nagłówkowe biblioteki cryptsetup.
112
113 %package static
114 Summary:        Static cryptsetup library
115 Summary(pl.UTF-8):      Statyczna biblioteka cryptsetup
116 Group:          Development/Libraries
117 Requires:       %{name}-devel = %{version}-%{release}
118 Provides:       cryptsetup-luks-static = %{version}-%{release}
119 Obsoletes:      cryptsetup-luks-static < 1.4.1-2
120
121 %description static
122 Static version of cryptsetup library.
123
124 %description static -l pl.UTF-8
125 Statyczna wersja biblioteki cryptsetup.
126
127 %package initrd
128 Summary:        LUKS for dm-crypt implemented in cryptsetup - initrd version
129 Summary(pl.UTF-8):      LUKS dla dm-crypta zaimplementowany w cryptsetup - wersja initrd
130 Group:          Base
131 Requires:       udev-initrd >= 1:115
132 Provides:       cryptsetup-luks-initrd = %{version}-%{release}
133 Obsoletes:      cryptsetup-luks-initrd < 1.4.1-2
134 Conflicts:      geninitrd < 10000.10
135
136 %description initrd
137 This package contains implementation of LUKS for dm-crypt implemented
138 in cryptsetup - statically linked for initrd.
139
140 %description initrd -l pl.UTF-8
141 Ten pakiet zawiera implementację LUKS dla dm-crypta zaimplementowaną w
142 cryptsetup - wersję statycznie zlinkowaną dla initrd.
143
144 %prep
145 %setup -q
146 %{?with_diet:%patch0 -p1}
147
148 %{__rm} po/stamp-po
149
150 %build
151 %{__gettextize}
152 %{__libtoolize}
153 %{__aclocal} -I m4
154 %{__autoconf}
155 %{__autoheader}
156 %{__automake}
157
158 %if %{with initrd}
159 CC="%{__cc}"
160 %configure \
161 %if %{with dietlibc}
162         CC="diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os" \
163         LIBS="-lcompat" \
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 \
167 %endif
168 %if "%{?configure_cache}" == "1"
169         --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \
170 %endif
171         --disable-nls \
172         --disable-shared \
173         --disable-silent-rules \
174         --enable-static \
175         --enable-static-cryptsetup \
176         --with-crypto-backend=gcrypt \
177         --with-luks2-lock-path=/run/%{name}
178
179 %{__make} -C lib
180
181 %if %{with dietlibc}
182 # we have to do it by hand cause libtool "know better" and forces
183 # static libs from /usr/lib
184 CC="%{__cc}"
185 diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \
186         -o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \
187         -lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat
188 %else
189 %{__make} -C src
190 mv src/cryptsetup cryptsetup-initrd
191 %endif
192
193 %{__make} clean
194 %endif
195
196 %configure \
197         --enable-libargon2 \
198         %{?with_passwdqc:--enable-passwdqc=/etc/passwdqc.conf} \
199         %{?with_pwquality:--enable-pwquality} \
200         --disable-silent-rules \
201         --enable-static \
202         --enable-udev \
203         %{?with_gcrypt:--with-crypto-backend=gcrypt} \
204         --with-luks2-lock-path=/run/%{name}
205 %{__make}
206
207 %{?with_tests:%{__make} check}
208
209 %install
210 rm -rf $RPM_BUILD_ROOT
211
212 %{__make} install \
213         DESTDIR=$RPM_BUILD_ROOT
214
215 install -d $RPM_BUILD_ROOT/%{_lib}
216 mv -f $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so.* $RPM_BUILD_ROOT/%{_lib}
217 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcryptsetup.so.*.*.*) \
218         $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so
219
220 %if %{with initrd}
221 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
222 install -p cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup
223 %endif
224
225 %find_lang %{name}
226
227 %clean
228 rm -rf $RPM_BUILD_ROOT
229
230 %post   -p /sbin/ldconfig
231 %postun -p /sbin/ldconfig
232
233 %files -f %{name}.lang
234 %defattr(644,root,root,755)
235 %doc AUTHORS FAQ README TODO docs/{ChangeLog.old,v*-ReleaseNotes,on-disk-format.pdf}
236 %attr(755,root,root) %{_sbindir}/cryptsetup
237 %attr(755,root,root) %{_sbindir}/cryptsetup-reencrypt
238 %attr(755,root,root) %{_sbindir}/integritysetup
239 %attr(755,root,root) %{_sbindir}/veritysetup
240 %attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.*
241 %attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.12
242 %{_mandir}/man8/cryptsetup.8*
243 %{_mandir}/man8/cryptsetup-reencrypt.8*
244 %{_mandir}/man8/integritysetup.8*
245 %{_mandir}/man8/veritysetup.8*
246
247 %files devel
248 %defattr(644,root,root,755)
249 %attr(755,root,root) %{_libdir}/libcryptsetup.so
250 %{_libdir}/libcryptsetup.la
251 %{_includedir}/libcryptsetup.h
252 %{_pkgconfigdir}/libcryptsetup.pc
253
254 %files static
255 %defattr(644,root,root,755)
256 %{_libdir}/libcryptsetup.a
257
258 %if %{with initrd}
259 %files initrd
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{_libdir}/initrd/cryptsetup
262 %endif