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