]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with dietlibc # don't build static dietlibc library | |
4 | %bcond_with libcap # Linux capabilities usage | |
5 | # | |
6 | Summary: Cryptographic library based on the code from GnuPG | |
7 | Summary(es.UTF-8): Libgcrypt es una biblioteca general de desarrole embasada em GnuPG | |
8 | Summary(pl.UTF-8): Biblioteka kryptograficzna oparta na kodzie GnuPG | |
9 | Summary(pt_BR.UTF-8): libgcrypt é uma biblioteca de criptografia de uso geral baseada no GnuPG | |
10 | Name: libgcrypt | |
11 | Version: 1.9.0 | |
12 | Release: 1 | |
13 | License: LGPL v2.1+ | |
14 | Group: Libraries | |
15 | Source0: ftp://ftp.gnupg.org/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2 | |
16 | # Source0-md5: 5ef99d1838092bc15c0ddafb22830a02 | |
17 | Patch0: %{name}-info.patch | |
18 | Patch1: %{name}-libgcrypt_config.patch | |
19 | Patch2: %{name}-poll.patch | |
20 | Patch3: kdf-selftest.patch | |
21 | URL: https://directory.fsf.org/wiki/Libgcrypt | |
22 | BuildRequires: autoconf >= 2.60 | |
23 | BuildRequires: automake >= 1:1.14 | |
24 | BuildRequires: binutils >= 2:2.12 | |
25 | %{?with_dietlibc:BuildRequires: dietlibc-static >= 2:0.31-5} | |
26 | BuildRequires: gcc >= 5:3.2 | |
27 | %{?with_libcap:BuildRequires: libcap-devel} | |
28 | BuildRequires: libgpg-error-devel >= 1.27 | |
29 | BuildRequires: libtool >= 2:2.2.6 | |
30 | BuildRequires: texinfo | |
31 | Requires: libgpg-error >= 1.27 | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | # for some reason known only to rpm there must be "\\|" not "\|" here | |
35 | %define dietarch %(echo %{_target_cpu} | sed -e 's/i.86\\|pentium.\\|athlon/i386/;s/amd64/x86_64/;s/armv.*/arm/') | |
36 | %define dietlibdir %{_prefix}/lib/dietlibc/lib-%{dietarch} | |
37 | ||
38 | %description | |
39 | This is a general purpose cryptographic library based on the code from | |
40 | GnuPG. It provides functions for all cryptograhic building blocks: | |
41 | symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish, Arcfour), hash | |
42 | algorithms (MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for all | |
43 | hash algorithms), public key algorithms (RSA, ElGamal, DSA), large | |
44 | integer functions, random numbers and a lot of supporting functions. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | Ten pakiet zawiera bibliotekę kryptograficzną ogólnego przeznaczenia, | |
48 | opartą na kodzie GnuPG. Biblioteka ta dostarcza funkcje do wszystkich | |
49 | podstawowych bloków kryptografii: szyfrów symetrycznych (AES, DES, | |
50 | Blowfish, CAST5, Twofish, Acrfour), algorytmów mieszających (MD5, | |
51 | RIPE-MD160, SHA-1, RIGER-192), MAC-ów (HMAC dla wszystkich algorytmów | |
52 | mieszających), algorytmów klucza publicznego (RSA, ElGamal, DSA), | |
53 | funkcji dużych liczb całkowitych, liczb losowych i wiele funkcji | |
54 | pomocniczych. | |
55 | ||
56 | %description -l pt_BR.UTF-8 | |
57 | Libgcrypt é uma biblioteca de criptografia de uso geral baseada no | |
58 | GnuPG. | |
59 | ||
60 | %package tools | |
61 | Summary: Additional binary tools for libgcrypt | |
62 | Summary(pl.UTF-8): Dodatkowe narzędzia dla biblioteki libgcrypt | |
63 | Group: Development/Libraries | |
64 | Requires: %{name} = %{version}-%{release} | |
65 | ||
66 | %description tools | |
67 | Additional binary tools for libgcrypt. | |
68 | ||
69 | %description tools -l pl.UTF-8 | |
70 | Dodatkowe narzędzia dla biblioteki libgcrypt. | |
71 | ||
72 | %package devel | |
73 | Summary: Header files etc to develop libgcrypt applications | |
74 | Summary(es.UTF-8): Archivos de desarrollo de libgcrypt | |
75 | Summary(pl.UTF-8): Pliki nagłówkowe i inne do libgcrypt | |
76 | Summary(pt_BR.UTF-8): Arquivos de desenvolvimento da libgcrypt | |
77 | Group: Development/Libraries | |
78 | Requires: %{name} = %{version}-%{release} | |
79 | %{?with_libcap:Requires: libcap-devel} | |
80 | Requires: libgpg-error-devel >= 1.25 | |
81 | ||
82 | %description devel | |
83 | Header files etc to develop libgcrypt applications. | |
84 | ||
85 | %description devel -l pl.UTF-8 | |
86 | Pliki nagłówkowe i inne do libgcrypt. | |
87 | ||
88 | %description devel -l pt_BR.UTF-8 | |
89 | Bibliotecas de desenvolvimento para libgcrypt. | |
90 | ||
91 | %package static | |
92 | Summary: Static libgcrypt library | |
93 | Summary(es.UTF-8): Archivos de desarrollo de libgcrypt - estatico | |
94 | Summary(pl.UTF-8): Biblioteka statyczna libgcrypt | |
95 | Summary(pt_BR.UTF-8): Arquivos de desenvolvimento da libgcrypt - biblioteca estática | |
96 | Group: Development/Libraries | |
97 | Requires: %{name}-devel = %{version}-%{release} | |
98 | ||
99 | %description static | |
100 | Static libgcrypt library. | |
101 | ||
102 | %description static -l pl.UTF-8 | |
103 | Biblioteka statyczna libgcrypt. | |
104 | ||
105 | %description static -l pt_BR.UTF-8 | |
106 | Bibliotecas de desenvolvimento para libgcrypt - estático. | |
107 | ||
108 | %package dietlibc | |
109 | Summary: Static dietlibc libgcrypt library | |
110 | Summary(pl.UTF-8): Biblioteka statyczna dietlibc libgcrypt | |
111 | Group: Development/Libraries | |
112 | Requires: %{name}-devel = %{version}-%{release} | |
113 | ||
114 | %description dietlibc | |
115 | Static dietlibc libgcrypt library. | |
116 | ||
117 | %description dietlibc -l pl.UTF-8 | |
118 | Biblioteka statyczna dietlibc libgcrypt. | |
119 | ||
120 | %prep | |
121 | %setup -q | |
122 | %patch0 -p1 | |
123 | %patch1 -p1 | |
124 | %patch2 -p1 | |
125 | %patch3 -p1 | |
126 | ||
127 | %build | |
128 | %{__rm} m4/libtool.m4 | |
129 | %{__libtoolize} | |
130 | %{__aclocal} -I m4 | |
131 | %{__autoconf} | |
132 | %{__automake} | |
133 | ||
134 | %if %{with dietlibc} | |
135 | %configure \ | |
136 | CC="diet %{__cc} %{rpmcflags} %{rpmldflags} -Os" \ | |
137 | --enable-static \ | |
138 | --disable-shared | |
139 | ||
140 | # libtool sucks, build just the libs | |
141 | %{__make} -C compat | |
142 | %{__make} -C cipher | |
143 | %{__make} -C mpi | |
144 | %{__make} -C random | |
145 | %{__make} -C src \ | |
146 | PROGRAMS= | |
147 | mv src/.libs/libgcrypt.a diet-libgcrypt.a | |
148 | %{__make} clean | |
149 | %endif | |
150 | ||
151 | %configure \ | |
152 | --enable-static \ | |
153 | %{?with_libcap:--with-capabilities} | |
154 | ||
155 | %{__make} | |
156 | ||
157 | %install | |
158 | rm -rf $RPM_BUILD_ROOT | |
159 | %{?with_dietlibc:install -d $RPM_BUILD_ROOT%{dietlibdir}} | |
160 | ||
161 | %{__make} install \ | |
162 | DESTDIR=$RPM_BUILD_ROOT \ | |
163 | m4datadir=%{_aclocaldir} | |
164 | ||
165 | install -d $RPM_BUILD_ROOT/%{_lib} | |
166 | mv -f $RPM_BUILD_ROOT%{_libdir}/libgcrypt.so.* $RPM_BUILD_ROOT/%{_lib} | |
167 | ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libgcrypt.so.*.*.*) \ | |
168 | $RPM_BUILD_ROOT%{_libdir}/libgcrypt.so | |
169 | ||
170 | %{?with_dietlibc:install diet-libgcrypt.a $RPM_BUILD_ROOT%{dietlibdir}/libgcrypt.a} | |
171 | ||
172 | %clean | |
173 | rm -rf $RPM_BUILD_ROOT | |
174 | ||
175 | %post -p /sbin/ldconfig | |
176 | %postun -p /sbin/ldconfig | |
177 | ||
178 | %post devel -p /sbin/postshell | |
179 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
180 | ||
181 | %postun devel -p /sbin/postshell | |
182 | -/usr/sbin/fix-info-dir -c %{_infodir} | |
183 | ||
184 | %files | |
185 | %defattr(644,root,root,755) | |
186 | %doc AUTHORS ChangeLog NEWS README THANKS TODO | |
187 | %attr(755,root,root) /%{_lib}/libgcrypt.so.*.*.* | |
188 | %attr(755,root,root) %ghost /%{_lib}/libgcrypt.so.20 | |
189 | ||
190 | %files tools | |
191 | %defattr(644,root,root,755) | |
192 | %attr(755,root,root) %{_bindir}/dumpsexp | |
193 | %attr(755,root,root) %{_bindir}/hmac256 | |
194 | %attr(755,root,root) %{_bindir}/mpicalc | |
195 | %{_mandir}/man1/hmac256.1* | |
196 | ||
197 | %files devel | |
198 | %defattr(644,root,root,755) | |
199 | %attr(755,root,root) %{_bindir}/libgcrypt-config | |
200 | %attr(755,root,root) %{_libdir}/libgcrypt.so | |
201 | %{_libdir}/libgcrypt.la | |
202 | %{_includedir}/gcrypt*.h | |
203 | %{_pkgconfigdir}/libgcrypt.pc | |
204 | %{_aclocaldir}/libgcrypt.m4 | |
205 | %{_infodir}/gcrypt.info* | |
206 | ||
207 | %files static | |
208 | %defattr(644,root,root,755) | |
209 | %{_libdir}/libgcrypt.a | |
210 | ||
211 | %if %{with dietlibc} | |
212 | %files dietlibc | |
213 | %defattr(644,root,root,755) | |
214 | %{dietlibdir}/libgcrypt.a | |
215 | %endif |