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