]>
Commit | Line | Data |
---|---|---|
0f4884b2 JP |
1 | # |
2 | # Conditional build: | |
f8fd6844 | 3 | %bcond_without default_crypt # build as default libcrypt provider |
3dbc3119 | 4 | %bcond_without tests |
0f4884b2 | 5 | |
37a8c0b7 | 6 | Summary: Crypt Library for DES, MD5, and Blowfish |
e65f8c9b | 7 | Summary(pl.UTF-8): Biblioteka szyfrująca hasła obsługująca DES, MD5 i Blowfish |
37a8c0b7 | 8 | Name: libxcrypt |
b8dea599 | 9 | Version: 4.4.33 |
7de2424d | 10 | Release: 1 |
c311c836 | 11 | License: LGPL v2.1+ |
37a8c0b7 | 12 | Group: Libraries |
dd0823fd JB |
13 | #Source0Download: https://github.com/besser82/libxcrypt/releases |
14 | Source0: https://github.com/besser82/libxcrypt/archive/v%{version}/%{name}-%{version}.tar.gz | |
b8dea599 | 15 | # Source0-md5: 1cfd40c89ab1e3d4a1f030c9842474e9 |
c311c836 | 16 | Patch0: %{name}-xcrypt.patch |
dd0823fd | 17 | URL: https://github.com/besser82/libxcrypt |
c311c836 JB |
18 | BuildRequires: autoconf >= 2.62 |
19 | BuildRequires: automake >= 1:1.14 | |
c6198b7e | 20 | BuildRequires: gcc >= 5:3.2 |
f35557c2 | 21 | BuildRequires: libltdl-devel |
dd0823fd | 22 | BuildRequires: libtool >= 2:2 |
c311c836 | 23 | BuildRequires: pkgconfig >= 1:0.27 |
0f4884b2 JP |
24 | %if %{with default_crypt} |
25 | Provides: crypt(blowfish) | |
26 | Obsoletes: glibc-libcrypt | |
27 | %endif | |
37a8c0b7 AM |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
f0e142fd | 30 | %undefine __cxx |
31 | ||
0f4884b2 JP |
32 | %if %{with default_crypt} |
33 | %define libname libcrypt | |
34 | %define libver 1 | |
35 | %else | |
36 | %define libname libxcrypt | |
37 | %define libver 2 | |
38 | %endif | |
39 | ||
37a8c0b7 | 40 | %description |
e65f8c9b JB |
41 | libxcrypt is a replacement for libcrypt, which comes with the GNU C |
42 | Library. It supports DES crypt, MD5, and passwords with Blowfish | |
37a8c0b7 AM |
43 | encryption. |
44 | ||
e65f8c9b JB |
45 | %description -l pl.UTF-8 |
46 | libxcrypt to zamiennik biblioteki libcrypt dostarczanej wraz z | |
47 | biblioteką GNU C (libc). Obsługuje szyfrowanie haseł DES, MD5 oraz | |
48 | Blowfish. | |
49 | ||
37a8c0b7 | 50 | %package devel |
e65f8c9b JB |
51 | Summary: Header file for libxcrypt |
52 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki libxcrypt | |
53 | License: LGPL v2.1+ | |
37a8c0b7 | 54 | Group: Development/Libraries |
18fb40b5 | 55 | Requires: %{name} = %{version}-%{release} |
04fe7a72 | 56 | %{?with_default_crypt:Conflicts: glibc-devel-doc < 6:2.34-7} |
37a8c0b7 AM |
57 | |
58 | %description devel | |
e65f8c9b | 59 | This package contains the header file to develop software using |
37a8c0b7 AM |
60 | libxcrypt. |
61 | ||
e65f8c9b JB |
62 | %description devel -l pl.UTF-8 |
63 | Ten pakiet zawiera plik nagłówkowy pozwalający na tworzenie programów | |
64 | korzystających z libxcrypt. | |
65 | ||
37a8c0b7 AM |
66 | %package static |
67 | Summary: Static libxcrypt library | |
e65f8c9b JB |
68 | Summary(pl.UTF-8): Statyczna biblioteka libxcrypt |
69 | License: LGPL v2.1+ | |
37a8c0b7 | 70 | Group: Development/Libraries |
18fb40b5 | 71 | Requires: %{name}-devel = %{version}-%{release} |
37a8c0b7 AM |
72 | |
73 | %description static | |
e65f8c9b JB |
74 | This package contains the static libxcrypt library used for |
75 | development. | |
76 | ||
77 | %description static -l pl.UTF-8 | |
78 | Ten pakiet zawiera statyczną wersję biblioteki libxcrypt. | |
37a8c0b7 AM |
79 | |
80 | %prep | |
81 | %setup -q | |
0f4884b2 | 82 | %{!?with_default_crypt:%patch0 -p1} |
37a8c0b7 AM |
83 | |
84 | %build | |
dd0823fd | 85 | %{__libtoolize} |
f35557c2 | 86 | %{__aclocal} |
dd0823fd JB |
87 | %{__autoconf} |
88 | %{__autoheader} | |
89 | %{__automake} | |
37a8c0b7 | 90 | %configure \ |
f8fd6844 AM |
91 | %if %{with default_crypt} |
92 | --enable-obsolete-api=glibc \ | |
93 | --enable-obsolete-api-enosys=yes \ | |
94 | %else | |
95 | --includedir=%{_includedir}/xcrypt \ | |
96 | --disable-xcrypt-compat-files \ | |
97 | %endif | |
98 | --disable-werror | |
37a8c0b7 AM |
99 | %{__make} |
100 | ||
3dbc3119 AM |
101 | %if %{with tests} |
102 | %{__make} check | |
103 | %endif | |
104 | ||
37a8c0b7 AM |
105 | %install |
106 | rm -rf $RPM_BUILD_ROOT | |
c311c836 | 107 | install -d $RPM_BUILD_ROOT/%{_lib} |
37a8c0b7 AM |
108 | |
109 | %{__make} install \ | |
110 | DESTDIR=$RPM_BUILD_ROOT | |
111 | ||
0f4884b2 JP |
112 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/%{libname}.so.* $RPM_BUILD_ROOT/%{_lib} |
113 | ln -snf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/%{libname}.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/%{libname}.so | |
429af81c | 114 | |
53a124c9 | 115 | # obsoleted by pkg-config |
0f4884b2 | 116 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{libname}.la |
7de2424d JB |
117 | |
118 | %if %{without default_crypt} | |
119 | # PLD doesn't need Owl compatibility | |
120 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/libowcrypt.* | |
eee95ac9 | 121 | # packaged with glibc-devel |
7de2424d JB |
122 | %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/crypt{,_r,_ra,_rn}.3* |
123 | %endif | |
37a8c0b7 AM |
124 | |
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %post -p /sbin/ldconfig | |
129 | %postun -p /sbin/ldconfig | |
130 | ||
7bd10e8a JR |
131 | %posttrans |
132 | if [ ! -L /%{_lib}/%{libname}.so.%{libver} ]; then | |
133 | %{__rm} -f /%{_lib}/%{libname}.so.%{libver} | |
134 | /sbin/ldconfig | |
135 | fi | |
136 | ||
37a8c0b7 AM |
137 | %files |
138 | %defattr(644,root,root,755) | |
c311c836 | 139 | %doc AUTHORS ChangeLog LICENSING NEWS README.md THANKS TODO.md |
0f4884b2 JP |
140 | %attr(755,root,root) /%{_lib}/%{libname}.so.*.*.* |
141 | %attr(755,root,root) %ghost /%{_lib}/%{libname}.so.%{libver} | |
37a8c0b7 AM |
142 | |
143 | %files devel | |
144 | %defattr(644,root,root,755) | |
0f4884b2 | 145 | %attr(755,root,root) %{_libdir}/%{libname}.so |
f7f4363a | 146 | %if %{with default_crypt} |
39d43e40 | 147 | %{_includedir}/crypt.h |
f8fd6844 AM |
148 | %{_includedir}/xcrypt.h |
149 | %attr(755,root,root) %{_libdir}/libxcrypt.so | |
f7f4363a | 150 | %else |
c311c836 | 151 | %{_includedir}/xcrypt |
f7f4363a | 152 | %endif |
c311c836 JB |
153 | %{_pkgconfigdir}/libcrypt.pc |
154 | %{_pkgconfigdir}/libxcrypt.pc | |
155 | %{_mandir}/man3/crypt_checksalt.3* | |
156 | %{_mandir}/man3/crypt_gensalt*.3* | |
157 | %{_mandir}/man3/crypt_preferred_method.3* | |
0f4884b2 JP |
158 | %if %{with default_crypt} |
159 | %{_mandir}/man3/crypt.3* | |
160 | %{_mandir}/man3/crypt_r.3* | |
161 | %{_mandir}/man3/crypt_ra.3* | |
162 | %{_mandir}/man3/crypt_rn.3* | |
163 | %endif | |
c311c836 | 164 | %{_mandir}/man5/crypt.5* |
37a8c0b7 AM |
165 | |
166 | %files static | |
167 | %defattr(644,root,root,755) | |
0f4884b2 | 168 | %{_libdir}/%{libname}.a |
f8fd6844 AM |
169 | %if %{with default_crypt} |
170 | %{_libdir}/libxcrypt.a | |
171 | %endif |