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