]> git.pld-linux.org Git - packages/libxcrypt.git/blob - libxcrypt.spec
rel 3
[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:        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
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 %package        compat
44 Summary:        Compatibility library providing legacy API functions
45 Requires:       %{name} = %{version}-%{release}
46
47 %description    compat
48 This package contains the library providing the compatibility API for
49 applications that are linked against glibc's libxcrypt, or that are
50 still using the unsafe and deprecated, encrypt, encrypt_r, setkey,
51 setkey_r, and fcrypt functions, which are still required by recent
52 versions of POSIX, the Single UNIX Specification, and various other
53 standards.
54
55 All existing binary executables linked against glibc's libcrypt should
56 work unmodified with the library supplied by this package.
57
58 %description
59 libxcrypt is a replacement for libcrypt, which comes with the GNU C
60 Library. It supports DES crypt, MD5, and passwords with Blowfish
61 encryption.
62
63 %description -l pl.UTF-8
64 libxcrypt to zamiennik biblioteki libcrypt dostarczanej wraz z
65 biblioteką GNU C (libc). Obsługuje szyfrowanie haseł DES, MD5 oraz
66 Blowfish.
67
68 %package devel
69 Summary:        Header file for libxcrypt
70 Summary(pl.UTF-8):      Plik nagłówkowy biblioteki libxcrypt
71 License:        LGPL v2.1+
72 Group:          Development/Libraries
73 Requires:       %{name} = %{version}-%{release}
74 %{?with_default_crypt:Conflicts:        glibc-devel-doc < 6:2.34-7}
75
76 %description devel
77 This package contains the header file to develop software using
78 libxcrypt.
79
80 %description devel -l pl.UTF-8
81 Ten pakiet zawiera plik nagłówkowy pozwalający na tworzenie programów
82 korzystających z libxcrypt.
83
84 %package static
85 Summary:        Static libxcrypt library
86 Summary(pl.UTF-8):      Statyczna biblioteka libxcrypt
87 License:        LGPL v2.1+
88 Group:          Development/Libraries
89 Requires:       %{name}-devel = %{version}-%{release}
90
91 %description static
92 This package contains the static libxcrypt library used for
93 development.
94
95 %description static -l pl.UTF-8
96 Ten pakiet zawiera statyczną wersję biblioteki libxcrypt.
97
98 %prep
99 %setup -q
100 %{!?with_default_crypt:%patch0 -p1}
101
102 %build
103 %{__libtoolize}
104 %{__aclocal}
105 %{__autoconf}
106 %{__autoheader}
107 %{__automake}
108
109 install -d regular
110 cd regular
111 ../%configure \
112         --enable-hashes=all \
113 %if %{with default_crypt}
114         --enable-obsolete-api=no \
115         --enable-obsolete-api-enosys=no \
116 %else
117         --includedir=%{_includedir}/xcrypt \
118         --disable-xcrypt-compat-files \
119 %endif
120         --disable-werror
121 %{__make}
122
123 %if %{with tests}
124 %{__make} check
125 %endif
126 cd ..
127
128 %if %{with compat_pkg}
129 install -d compat
130 cd 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
142 cd ..
143 %endif
144
145 %install
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT/%{_lib}
148
149 %if %{with compat_pkg}
150 %{__make} -C compat install \
151         DESTDIR=$RPM_BUILD_ROOT
152
153 # clean everything beside library
154 find $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
159
160 %{__mv} $RPM_BUILD_ROOT%{_libdir}/%{libname}.so.* $RPM_BUILD_ROOT/%{_lib}
161 ln -snf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/%{libname}.so.%{libver}.*.*) $RPM_BUILD_ROOT%{_libdir}/%{libname}.so
162
163 # obsoleted by pkg-config
164 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{libname}.la
165
166 %if %{without default_crypt}
167 # PLD doesn't need Owl compatibility
168 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libowcrypt.*
169 # packaged with glibc-devel
170 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/crypt{,_r,_ra,_rn}.3*
171 %endif
172
173 %clean
174 rm -rf $RPM_BUILD_ROOT
175
176 %post   -p /sbin/ldconfig
177 %postun -p /sbin/ldconfig
178
179 %post compat -p /sbin/ldconfig
180 %postun compat -p /sbin/ldconfig
181
182 %posttrans
183 if [ ! -L /%{_lib}/%{libname}.so.1 ]; then
184         %{__rm} -f /%{_lib}/%{libname}.so.1
185         /sbin/ldconfig
186 fi
187
188 %files
189 %defattr(644,root,root,755)
190 %doc AUTHORS ChangeLog LICENSING NEWS README.md THANKS TODO.md
191 %attr(755,root,root) /%{_lib}/%{libname}.so.%{libver}.*.*
192 %attr(755,root,root) %ghost /%{_lib}/%{libname}.so.%{libver}
193
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
201 %files devel
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_libdir}/%{libname}.so
204 %if %{with default_crypt}
205 %{_includedir}/crypt.h
206 %else
207 %{_includedir}/xcrypt
208 %endif
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*
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
220 %{_mandir}/man5/crypt.5*
221
222 %files static
223 %defattr(644,root,root,755)
224 %{_libdir}/%{libname}.a
This page took 0.121498 seconds and 3 git commands to generate.