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