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