]> git.pld-linux.org Git - packages/libxcrypt.git/blob - libxcrypt.spec
- cleanup, pl for -compat
[packages/libxcrypt.git] / libxcrypt.spec
1 #
2 # Conditional build:
3 %bcond_without  compat_pkg      # compat package (libcrypt.so.1 with legacy APIs)
4 %bcond_without  default_crypt   # libxcrypt as default libcrypt
5 %bcond_without  tests           # testing
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:        3
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 < 6:2.37
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 %description
44 libxcrypt is a replacement for libcrypt, which comes with the GNU C
45 Library. It supports DES crypt, MD5, and passwords with Blowfish
46 encryption.
47
48 %description -l pl.UTF-8
49 libxcrypt to zamiennik biblioteki libcrypt dostarczanej wraz z
50 biblioteką GNU C (libc). Obsługuje szyfrowanie haseł DES, MD5 oraz
51 Blowfish.
52
53 %package devel
54 Summary:        Header file for libxcrypt
55 Summary(pl.UTF-8):      Plik nagłówkowy biblioteki libxcrypt
56 License:        LGPL v2.1+
57 Group:          Development/Libraries
58 Requires:       %{name} = %{version}-%{release}
59 %{?with_default_crypt:Conflicts:        glibc-devel-doc < 6:2.34-7}
60
61 %description devel
62 This package contains the header file to develop software using
63 libxcrypt.
64
65 %description devel -l pl.UTF-8
66 Ten pakiet zawiera plik nagłówkowy pozwalający na tworzenie programów
67 korzystających z libxcrypt.
68
69 %package static
70 Summary:        Static libxcrypt library
71 Summary(pl.UTF-8):      Statyczna biblioteka libxcrypt
72 License:        LGPL v2.1+
73 Group:          Development/Libraries
74 Requires:       %{name}-devel = %{version}-%{release}
75
76 %description static
77 This package contains the static libxcrypt library used for
78 development.
79
80 %description static -l pl.UTF-8
81 Ten pakiet zawiera statyczną wersję biblioteki libxcrypt.
82
83 %package compat
84 Summary:        Compatibility library providing legacy API functions
85 Summary(pl.UTF-8):      Biblioteka zgodności wstecznej dostarczająca dawne funkcje API
86 Requires:       %{name} = %{version}-%{release}
87
88 %description compat
89 This package contains the library providing the compatibility API for
90 applications that are linked against glibc's libcrypt, or that are
91 still using the unsafe and deprecated, encrypt, encrypt_r, setkey,
92 setkey_r, and fcrypt functions, which are still required by recent
93 versions of POSIX, the Single UNIX Specification, and various other
94 standards.
95
96 All existing binary executables linked against glibc's libcrypt should
97 work unmodified with the library supplied by this package.
98
99 %description compat -l pl.UTF-8
100 Ten pakiet zawiera bibliotekę dostarczającą API zgodności wstecznej
101 dla aplikacji skonsolidowanych z biblioteką libcrypt z glibc lub
102 nadal wykorzystujących niebezpieczne i przestarzałe funkcje encrypt,
103 encrypt_r, setkey, setkey_r oraz fcrypt, nadal wymagane przez obecne
104 wersje standardów POSIX, Single UNIX Specification i innych.
105
106 Wszystkie istniejące programy wykonywalne skonsolidowane z biblioteką
107 libcrypt z glibc powinny działać bez modyfikacji z biblioteką
108 dostarczaną przez ten pakiet.
109
110 %prep
111 %setup -q
112 %{!?with_default_crypt:%patch0 -p1}
113
114 %build
115 %{__libtoolize}
116 %{__aclocal}
117 %{__autoconf}
118 %{__autoheader}
119 %{__automake}
120
121 install -d regular
122 cd regular
123 ../%configure \
124         --enable-hashes=all \
125 %if %{with default_crypt}
126         --disable-obsolete-api \
127         --disable-obsolete-api-enosys \
128 %else
129         --includedir=%{_includedir}/xcrypt \
130         --disable-xcrypt-compat-files \
131 %endif
132         --disable-werror
133 %{__make}
134
135 %if %{with tests}
136 %{__make} check
137 %endif
138 cd ..
139
140 %if %{with compat_pkg}
141 install -d compat
142 cd compat
143 ../%configure \
144         --enable-hashes=all \
145         --enable-obsolete-api=glibc \
146         --enable-obsolete-api-enosys \
147         --disable-werror
148 %{__make}
149
150 %if %{with tests}
151 %{__make} check
152 %endif
153 cd ..
154 %endif
155
156 %install
157 rm -rf $RPM_BUILD_ROOT
158 install -d $RPM_BUILD_ROOT/%{_lib}
159
160 %if %{with compat_pkg}
161 %{__make} -C compat install \
162         DESTDIR=$RPM_BUILD_ROOT
163
164 # clean everything beside library
165 find $RPM_BUILD_ROOT -not -type d -not -name 'libcrypt.so.%{libvercompat}*' -delete -print
166 %endif
167
168 %{__make} -C regular install \
169         DESTDIR=$RPM_BUILD_ROOT
170
171 %{__mv} $RPM_BUILD_ROOT%{_libdir}/%{libname}.so.* $RPM_BUILD_ROOT/%{_lib}
172 ln -snf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/%{libname}.so.%{libver}.*.*) $RPM_BUILD_ROOT%{_libdir}/%{libname}.so
173
174 # obsoleted by pkg-config
175 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{libname}.la
176
177 %if %{without default_crypt}
178 # PLD doesn't need Owl compatibility
179 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libowcrypt.*
180 # packaged with glibc-devel
181 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/crypt{,_r,_ra,_rn}.3*
182 %endif
183
184 %clean
185 rm -rf $RPM_BUILD_ROOT
186
187 %post   -p /sbin/ldconfig
188 %postun -p /sbin/ldconfig
189
190 %post   compat -p /sbin/ldconfig
191 %postun compat -p /sbin/ldconfig
192
193 %posttrans compat
194 if [ ! -L /%{_lib}/%{libname}.so.1 ]; then
195         %{__rm} -f /%{_lib}/%{libname}.so.1
196         /sbin/ldconfig
197 fi
198
199 %files
200 %defattr(644,root,root,755)
201 %doc AUTHORS ChangeLog LICENSING NEWS README.md THANKS TODO.md
202 %attr(755,root,root) /%{_lib}/%{libname}.so.%{libver}.*.*
203 %attr(755,root,root) %ghost /%{_lib}/%{libname}.so.%{libver}
204
205 %files devel
206 %defattr(644,root,root,755)
207 %attr(755,root,root) %{_libdir}/%{libname}.so
208 %if %{with default_crypt}
209 %{_includedir}/crypt.h
210 %else
211 %{_includedir}/xcrypt
212 %endif
213 %{_pkgconfigdir}/libcrypt.pc
214 %{_pkgconfigdir}/libxcrypt.pc
215 %{_mandir}/man3/crypt_checksalt.3*
216 %{_mandir}/man3/crypt_gensalt*.3*
217 %{_mandir}/man3/crypt_preferred_method.3*
218 %if %{with default_crypt}
219 %{_mandir}/man3/crypt.3*
220 %{_mandir}/man3/crypt_r.3*
221 %{_mandir}/man3/crypt_ra.3*
222 %{_mandir}/man3/crypt_rn.3*
223 %endif
224 %{_mandir}/man5/crypt.5*
225
226 %files static
227 %defattr(644,root,root,755)
228 %{_libdir}/%{libname}.a
229
230 %if %{with compat_pkg}
231 %files compat
232 %defattr(644,root,root,755)
233 %attr(755,root,root) /%{_lib}/%{libname}.so.%{libvercompat}.*.*
234 %attr(755,root,root) %ghost /%{_lib}/%{libname}.so.%{libvercompat}
235 %endif
This page took 0.149653 seconds and 3 git commands to generate.