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