]> git.pld-linux.org Git - packages/cryptsetup.git/blob - cryptsetup.spec
up to 2.7.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     passwdqc        # password quality checking via libpasswdqc [conflicts with pwquality]
6 %bcond_with     pwquality       # password quality checking via libpwquality [conflicts with passwdqc]
7 %bcond_without  python          # Python binding
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.0.3
14 Release:        2
15 License:        GPL v2
16 Group:          Base
17 Source0:        https://www.kernel.org/pub/linux/utils/cryptsetup/v2.0/%{name}-%{version}.tar.xz
18 # Source0-md5:  ea1c722f8d4c4e36427628b679b1f819
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.15
25 BuildRequires:  json-c-devel
26 BuildRequires:  libargon2-devel >= 20171227
27 BuildRequires:  libgcrypt-devel >= 1.6.1
28 BuildRequires:  libgpg-error-devel
29 %{?with_pwquality:BuildRequires:        libpwquality-devel >= 1.0.0}
30 BuildRequires:  libselinux-devel
31 BuildRequires:  libsepol-devel
32 BuildRequires:  libtool >= 2:2.0
33 BuildRequires:  libuuid-devel
34 %{?with_passwdqc:BuildRequires: passwdqc-devel}
35 BuildRequires:  pkgconfig
36 BuildRequires:  popt-devel >= 1.7
37 %if %{with python}
38 BuildRequires:  python-devel >= 1:2.6
39 BuildRequires:  rpm-pythonprov
40 %endif
41 BuildRequires:  tar >= 1:1.22
42 BuildRequires:  xz
43 %if %{with initrd}
44 BuildRequires:  libgpg-error-static
45         %if %{with dietlibc}
46 BuildRequires:  device-mapper-dietlibc >= 1.02.27
47 BuildRequires:  dietlibc-static
48 BuildRequires:  libgcrypt-dietlibc >= 1.6.1
49 BuildRequires:  libuuid-dietlibc
50 BuildRequires:  popt-dietlibc
51         %else
52 BuildRequires:  device-mapper-static >= 1.02.27
53 BuildRequires:  libgcrypt-static >= 1.6.1
54 BuildRequires:  libselinux-static
55 BuildRequires:  libsepol-static
56 BuildRequires:  libuuid-static
57 BuildRequires:  popt-static
58 BuildRequires:  udev-static
59         %endif
60 %endif
61 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 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 Requires:       libgcrypt-devel >= 1.6.1
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 -n python-pycryptsetup
128 Summary:        Python binding for cryptsetup library
129 Summary(pl.UTF-8):      Wiązanie Pythona do biblioteki cryptsetup
130 Group:          Libraries/Python
131 Requires:       %{name} = %{version}-%{release}
132 %pyrequires_eq  python-libs
133
134 %description -n python-pycryptsetup
135 Python binding for cryptsetup library.
136
137 %description -n python-pycryptsetup -l pl.UTF-8
138 Wiązanie Pythona do biblioteki cryptsetup.
139
140 %package initrd
141 Summary:        LUKS for dm-crypt implemented in cryptsetup - initrd version
142 Summary(pl.UTF-8):      LUKS dla dm-crypta zaimplementowany w cryptsetup - wersja initrd
143 Group:          Base
144 Requires:       udev-initrd >= 1:115
145 Provides:       cryptsetup-luks-initrd = %{version}-%{release}
146 Obsoletes:      cryptsetup-luks-initrd < 1.4.1-2
147 Conflicts:      geninitrd < 10000.10
148
149 %description initrd
150 This package contains implementation of LUKS for dm-crypt implemented
151 in cryptsetup - statically linked for initrd.
152
153 %description initrd -l pl.UTF-8
154 Ten pakiet zawiera implementację LUKS dla dm-crypta zaimplementowaną w
155 cryptsetup - wersję statycznie zlinkowaną dla initrd.
156
157 %prep
158 %setup -q
159 %{?with_diet:%patch0 -p1}
160
161 %{__rm} po/stamp-po
162
163 %build
164 %{__gettextize}
165 %{__libtoolize}
166 %{__aclocal} -I m4
167 %{__autoconf}
168 %{__autoheader}
169 %{__automake}
170
171 %if %{with initrd}
172 CC="%{__cc}"
173 %configure \
174 %if %{with dietlibc}
175         CC="diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os" \
176         LIBS="-lcompat" \
177         ac_cv_lib_popt_poptConfigFileToString=yes \
178         ac_cv_lib_sepol_sepol_bool_set=no \
179         ac_cv_lib_selinux_is_selinux_enabled=no \
180 %endif
181 %if "%{?configure_cache}" == "1"
182         --cache-file=%{?configure_cache_file}%{!?configure_cache_file:configure}-initrd.cache \
183 %endif
184         --disable-nls \
185         --disable-silent-rules \
186         --disable-shared \
187         --enable-static \
188         --enable-static-cryptsetup \
189         --with-tmpfilesdir=%{systemdtmpfilesdir} \
190         --with-luks2-lock-path=/var/run/%{name}
191
192 %{__make} -C lib
193
194 %if %{with dietlibc}
195 # we have to do it by hand cause libtool "know better" and forces
196 # static libs from /usr/lib
197 CC="%{__cc}"
198 diet ${CC#ccache } %{rpmcppflags} %{rpmcflags} %{rpmldflags} -Os -I. -I./lib -static \
199         -o cryptsetup-initrd src/cryptsetup.c ./lib/.libs/libcryptsetup.a \
200         -lpopt -lgcrypt -lgpg-error -ldevmapper -luuid -lcompat
201 %else
202 %{__make} -C src
203 mv src/cryptsetup cryptsetup-initrd
204 %endif
205
206 %{__make} clean
207 %endif
208
209 %configure \
210         --enable-udev \
211         --disable-silent-rules \
212         --enable-static \
213         --enable-libargon2 \
214         %{?with_passwdqc:--enable-passwdqc=/etc/passwdqc.conf} \
215         %{?with_pwquality:--enable-pwquality} \
216         %{?with_python:--enable-python} \
217         --with-tmpfilesdir=%{systemdtmpfilesdir} \
218         --with-luks2-lock-path=/var/run/%{name}
219 %{__make}
220
221 %{?with_tests:%{__make} check}
222
223 %install
224 rm -rf $RPM_BUILD_ROOT
225
226 install -d $RPM_BUILD_ROOT/var/run/cryptsetup
227
228 %{__make} install \
229         DESTDIR=$RPM_BUILD_ROOT
230
231 install -d $RPM_BUILD_ROOT/%{_lib}
232 mv -f $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so.* $RPM_BUILD_ROOT/%{_lib}
233 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcryptsetup.so.*.*.*) \
234         $RPM_BUILD_ROOT%{_libdir}/libcryptsetup.so
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 %{?with_python:%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/pycryptsetup.la}
242
243 %find_lang %{name}
244
245 %clean
246 rm -rf $RPM_BUILD_ROOT
247
248 %post   -p /sbin/ldconfig
249 %postun -p /sbin/ldconfig
250
251 %files -f %{name}.lang
252 %defattr(644,root,root,755)
253 %doc AUTHORS ChangeLog FAQ README TODO docs/{ChangeLog.old,v*-ReleaseNotes,on-disk-format.pdf}
254 %attr(755,root,root) %{_sbindir}/cryptsetup
255 %attr(755,root,root) %{_sbindir}/cryptsetup-reencrypt
256 %attr(755,root,root) %{_sbindir}/integritysetup
257 %attr(755,root,root) %{_sbindir}/veritysetup
258 %attr(755,root,root) /%{_lib}/libcryptsetup.so.*.*.*
259 %attr(755,root,root) %ghost /%{_lib}/libcryptsetup.so.12
260 %{_mandir}/man8/cryptsetup.8*
261 %{_mandir}/man8/cryptsetup-reencrypt.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 python}
279 %files -n python-pycryptsetup
280 %defattr(644,root,root,755)
281 %attr(755,root,root) %{py_sitedir}/pycryptsetup.so
282 %endif
283
284 %if %{with initrd}
285 %files initrd
286 %defattr(644,root,root,755)
287 %attr(755,root,root) %{_libdir}/initrd/cryptsetup
288 %endif
This page took 0.097795 seconds and 3 git commands to generate.