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