]> git.pld-linux.org Git - packages/libxcrypt.git/blame - libxcrypt.spec
rel 3
[packages/libxcrypt.git] / libxcrypt.spec
CommitLineData
0f4884b2
JP
1#
2# Conditional build:
05ee50b3
AM
3%bcond_without compat_pkg
4%bcond_without default_crypt
3dbc3119 5%bcond_without tests
0f4884b2 6
37a8c0b7 7Summary: Crypt Library for DES, MD5, and Blowfish
e65f8c9b 8Summary(pl.UTF-8): Biblioteka szyfrująca hasła obsługująca DES, MD5 i Blowfish
37a8c0b7 9Name: libxcrypt
b8dea599 10Version: 4.4.33
6f585af5 11Release: 3
c311c836 12License: LGPL v2.1+
37a8c0b7 13Group: Libraries
dd0823fd
JB
14#Source0Download: https://github.com/besser82/libxcrypt/releases
15Source0: https://github.com/besser82/libxcrypt/archive/v%{version}/%{name}-%{version}.tar.gz
b8dea599 16# Source0-md5: 1cfd40c89ab1e3d4a1f030c9842474e9
c311c836 17Patch0: %{name}-xcrypt.patch
dd0823fd 18URL: https://github.com/besser82/libxcrypt
c311c836
JB
19BuildRequires: autoconf >= 2.62
20BuildRequires: automake >= 1:1.14
c6198b7e 21BuildRequires: gcc >= 5:3.2
f35557c2 22BuildRequires: libltdl-devel
dd0823fd 23BuildRequires: libtool >= 2:2
c311c836 24BuildRequires: pkgconfig >= 1:0.27
0f4884b2
JP
25%if %{with default_crypt}
26Provides: crypt(blowfish)
27Obsoletes: glibc-libcrypt
28%endif
37a8c0b7
AM
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
05ee50b3 31%undefine __cxx
f0e142fd 32
0f4884b2 33%if %{with default_crypt}
05ee50b3
AM
34%define libname libcrypt
35%define libver 2
36%define libvercompat 1
0f4884b2 37%else
05ee50b3
AM
38%undefine with_compat_pkg
39%define libname libxcrypt
40%define libver 2
41%endif
42
05ee50b3
AM
43%package compat
44Summary: Compatibility library providing legacy API functions
45Requires: %{name} = %{version}-%{release}
46
47%description compat
48This package contains the library providing the compatibility API for
49applications that are linked against glibc's libxcrypt, or that are
50still using the unsafe and deprecated, encrypt, encrypt_r, setkey,
51setkey_r, and fcrypt functions, which are still required by recent
52versions of POSIX, the Single UNIX Specification, and various other
53standards.
54
55All existing binary executables linked against glibc's libcrypt should
56work unmodified with the library supplied by this package.
0f4884b2 57
37a8c0b7 58%description
e65f8c9b
JB
59libxcrypt is a replacement for libcrypt, which comes with the GNU C
60Library. It supports DES crypt, MD5, and passwords with Blowfish
37a8c0b7
AM
61encryption.
62
e65f8c9b
JB
63%description -l pl.UTF-8
64libxcrypt to zamiennik biblioteki libcrypt dostarczanej wraz z
65biblioteką GNU C (libc). Obsługuje szyfrowanie haseł DES, MD5 oraz
66Blowfish.
67
37a8c0b7 68%package devel
e65f8c9b
JB
69Summary: Header file for libxcrypt
70Summary(pl.UTF-8): Plik nagłówkowy biblioteki libxcrypt
71License: LGPL v2.1+
37a8c0b7 72Group: Development/Libraries
18fb40b5 73Requires: %{name} = %{version}-%{release}
04fe7a72 74%{?with_default_crypt:Conflicts: glibc-devel-doc < 6:2.34-7}
37a8c0b7
AM
75
76%description devel
e65f8c9b 77This package contains the header file to develop software using
37a8c0b7
AM
78libxcrypt.
79
e65f8c9b
JB
80%description devel -l pl.UTF-8
81Ten pakiet zawiera plik nagłówkowy pozwalający na tworzenie programów
82korzystających z libxcrypt.
83
37a8c0b7
AM
84%package static
85Summary: Static libxcrypt library
e65f8c9b
JB
86Summary(pl.UTF-8): Statyczna biblioteka libxcrypt
87License: LGPL v2.1+
37a8c0b7 88Group: Development/Libraries
18fb40b5 89Requires: %{name}-devel = %{version}-%{release}
37a8c0b7
AM
90
91%description static
e65f8c9b
JB
92This package contains the static libxcrypt library used for
93development.
94
95%description static -l pl.UTF-8
96Ten pakiet zawiera statyczną wersję biblioteki libxcrypt.
37a8c0b7
AM
97
98%prep
99%setup -q
0f4884b2 100%{!?with_default_crypt:%patch0 -p1}
37a8c0b7
AM
101
102%build
dd0823fd 103%{__libtoolize}
f35557c2 104%{__aclocal}
dd0823fd
JB
105%{__autoconf}
106%{__autoheader}
107%{__automake}
05ee50b3
AM
108
109install -d regular
110cd regular
111../%configure \
112 --enable-hashes=all \
f8fd6844 113%if %{with default_crypt}
05ee50b3
AM
114 --enable-obsolete-api=no \
115 --enable-obsolete-api-enosys=no \
f8fd6844
AM
116%else
117 --includedir=%{_includedir}/xcrypt \
118 --disable-xcrypt-compat-files \
119%endif
120 --disable-werror
37a8c0b7
AM
121%{__make}
122
3dbc3119
AM
123%if %{with tests}
124%{__make} check
125%endif
05ee50b3
AM
126cd ..
127
128%if %{with compat_pkg}
129install -d compat
130cd compat
131../%configure \
132 --enable-hashes=all \
133 --enable-obsolete-api=glibc \
134 --enable-obsolete-api-enosys=yes \
135 --enable-hashes=all \
136 --disable-werror
137%{__make}
138
139%if %{with tests}
140%{__make} check
141%endif
142cd ..
143%endif
3dbc3119 144
37a8c0b7
AM
145%install
146rm -rf $RPM_BUILD_ROOT
c311c836 147install -d $RPM_BUILD_ROOT/%{_lib}
37a8c0b7 148
05ee50b3
AM
149%if %{with compat_pkg}
150%{__make} -C compat install \
151 DESTDIR=$RPM_BUILD_ROOT
152
153# clean everything beside library
154find $RPM_BUILD_ROOT -not -type d -not -name 'libcrypt.so.%{libvercompat}*' -delete -print
155%endif
156
157%{__make} -C regular install \
158 DESTDIR=$RPM_BUILD_ROOT
37a8c0b7 159
0f4884b2 160%{__mv} $RPM_BUILD_ROOT%{_libdir}/%{libname}.so.* $RPM_BUILD_ROOT/%{_lib}
05ee50b3 161ln -snf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/%{libname}.so.%{libver}.*.*) $RPM_BUILD_ROOT%{_libdir}/%{libname}.so
429af81c 162
53a124c9 163# obsoleted by pkg-config
0f4884b2 164%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{libname}.la
7de2424d
JB
165
166%if %{without default_crypt}
167# PLD doesn't need Owl compatibility
168%{__rm} $RPM_BUILD_ROOT%{_libdir}/libowcrypt.*
eee95ac9 169# packaged with glibc-devel
7de2424d
JB
170%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/crypt{,_r,_ra,_rn}.3*
171%endif
37a8c0b7
AM
172
173%clean
174rm -rf $RPM_BUILD_ROOT
175
176%post -p /sbin/ldconfig
177%postun -p /sbin/ldconfig
178
6f585af5
AM
179%post compat -p /sbin/ldconfig
180%postun compat -p /sbin/ldconfig
181
7bd10e8a 182%posttrans
05ee50b3
AM
183if [ ! -L /%{_lib}/%{libname}.so.1 ]; then
184 %{__rm} -f /%{_lib}/%{libname}.so.1
7bd10e8a
JR
185 /sbin/ldconfig
186fi
187
37a8c0b7
AM
188%files
189%defattr(644,root,root,755)
c311c836 190%doc AUTHORS ChangeLog LICENSING NEWS README.md THANKS TODO.md
05ee50b3 191%attr(755,root,root) /%{_lib}/%{libname}.so.%{libver}.*.*
0f4884b2 192%attr(755,root,root) %ghost /%{_lib}/%{libname}.so.%{libver}
37a8c0b7 193
05ee50b3
AM
194%if %{with compat_pkg}
195%files compat
196%defattr(644,root,root,755)
197%attr(755,root,root) /%{_lib}/%{libname}.so.%{libvercompat}.*.*
198%attr(755,root,root) %ghost /%{_lib}/%{libname}.so.%{libvercompat}
199%endif
200
37a8c0b7
AM
201%files devel
202%defattr(644,root,root,755)
0f4884b2 203%attr(755,root,root) %{_libdir}/%{libname}.so
f7f4363a 204%if %{with default_crypt}
39d43e40 205%{_includedir}/crypt.h
f7f4363a 206%else
c311c836 207%{_includedir}/xcrypt
f7f4363a 208%endif
c311c836
JB
209%{_pkgconfigdir}/libcrypt.pc
210%{_pkgconfigdir}/libxcrypt.pc
211%{_mandir}/man3/crypt_checksalt.3*
212%{_mandir}/man3/crypt_gensalt*.3*
213%{_mandir}/man3/crypt_preferred_method.3*
0f4884b2
JP
214%if %{with default_crypt}
215%{_mandir}/man3/crypt.3*
216%{_mandir}/man3/crypt_r.3*
217%{_mandir}/man3/crypt_ra.3*
218%{_mandir}/man3/crypt_rn.3*
219%endif
c311c836 220%{_mandir}/man5/crypt.5*
37a8c0b7
AM
221
222%files static
223%defattr(644,root,root,755)
0f4884b2 224%{_libdir}/%{libname}.a
This page took 0.255506 seconds and 4 git commands to generate.