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