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