]> git.pld-linux.org Git - packages/cryptsetup.git/blob - cryptsetup.spec
- up to 2.2.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.2.2
14 Release:        1
15 License:        GPL v2
16 Group:          Base
17 Source0:        https://www.kernel.org/pub/linux/utils/cryptsetup/v2.2/%{name}-%{version}.tar.xz
18 # Source0-md5:  2b64ca9ea16e823df359eacf9c02414b
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=/var/run/%{name} \
178         --with-tmpfilesdir=%{systemdtmpfilesdir}
179
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
185 CC="%{__cc}"
186 diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \
187         -o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \
188         -lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat
189 %else
190 %{__make} -C src
191 mv src/cryptsetup cryptsetup-initrd
192 %endif
193
194 %{__make} clean
195 %endif
196
197 %configure \
198         --enable-libargon2 \
199         %{?with_passwdqc:--enable-passwdqc=/etc/passwdqc.conf} \
200         %{?with_pwquality:--enable-pwquality} \
201         --disable-silent-rules \
202         --enable-static \
203         --enable-udev \
204         %{?with_gcrypt:--with-crypto-backend=gcrypt} \
205         --with-luks2-lock-path=/var/run/%{name} \
206         --with-tmpfilesdir=%{systemdtmpfilesdir}
207 %{__make}
208
209 %{?with_tests:%{__make} check}
210
211 %install
212 rm -rf $RPM_BUILD_ROOT
213
214 install -d $RPM_BUILD_ROOT/var/run/cryptsetup
215
216 %{__make} install \
217         DESTDIR=$RPM_BUILD_ROOT
218
219 install -d $RPM_BUILD_ROOT/%{_lib}
220 mv -f $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so.* $RPM_BUILD_ROOT/%{_lib}
221 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcryptsetup.so.*.*.*) \
222         $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so
223
224 %if %{with initrd}
225 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
226 install -p cryptsetup-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/cryptsetup
227 %endif
228
229 %find_lang %{name}
230
231 %clean
232 rm -rf $RPM_BUILD_ROOT
233
234 %post   -p /sbin/ldconfig
235 %postun -p /sbin/ldconfig
236
237 %files -f %{name}.lang
238 %defattr(644,root,root,755)
239 %doc AUTHORS FAQ README TODO docs/{ChangeLog.old,v*-ReleaseNotes,on-disk-format.pdf}
240 %attr(755,root,root) %{_sbindir}/cryptsetup
241 %attr(755,root,root) %{_sbindir}/cryptsetup-reencrypt
242 %attr(755,root,root) %{_sbindir}/integritysetup
243 %attr(755,root,root) %{_sbindir}/veritysetup
244 %attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.*
245 %attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.12
246 %{_mandir}/man8/cryptsetup.8*
247 %{_mandir}/man8/cryptsetup-reencrypt.8*
248 %{_mandir}/man8/integritysetup.8*
249 %{_mandir}/man8/veritysetup.8*
250 %{systemdtmpfilesdir}/cryptsetup.conf
251 %attr(700,root,root) %dir /var/run/cryptsetup
252
253 %files devel
254 %defattr(644,root,root,755)
255 %attr(755,root,root) %{_libdir}/libcryptsetup.so
256 %{_libdir}/libcryptsetup.la
257 %{_includedir}/libcryptsetup.h
258 %{_pkgconfigdir}/libcryptsetup.pc
259
260 %files static
261 %defattr(644,root,root,755)
262 %{_libdir}/libcryptsetup.a
263
264 %if %{with initrd}
265 %files initrd
266 %defattr(644,root,root,755)
267 %attr(755,root,root) %{_libdir}/initrd/cryptsetup
268 %endif
This page took 0.07042 seconds and 3 git commands to generate.