This commit is contained in:
Alexander Stefanov 2020-01-30 23:15:44 +00:00
parent e40a2ae874
commit c0255df1e1
2 changed files with 101 additions and 118 deletions

View file

@ -1,2 +1,2 @@
sources: sources:
"libxcrypt-3.0.2.tar.bz2": 0e0f22932a644e6f1fa1df2ebdd291fdac9c4f7c libxcrypt-4.4.11.tar.gz: 6cf28ff3d60c4b7f58da1dd10058d66ca62a3b2b

View file

@ -1,17 +1,32 @@
%define major 2 %define major 1
%define libname %mklibname xcrypt %{major} %define libname %mklibname crypt %{major}
%define develname %mklibname xcrypt -d %define develname %mklibname crypt -d
%define staticname %mklibname crypt -d -s
# We ship a static library here -- LTO bytecode rather than
# object code in .o files packaged into a static library breaks
# using different compilers
%global _disable_lto 1
%ifarch %{armx} %{ix86} %{x86_64}
%global optflags %{optflags} -O3 -falign-functions=32 -fno-math-errno -fno-trapping-math -fno-strict-aliasing -fuse-ld=bfd
%endif
%ifarch %{riscv}
%global optflags %{optflags} -O2 -fno-strict-aliasing -fuse-ld=bfd
%endif
%global ldflags %{ldflags} -fuse-ld=bfd
Summary: Crypt Library for DES, MD5, Blowfish and others Summary: Crypt Library for DES, MD5, Blowfish and others
Name: libxcrypt Name: libxcrypt
Version: 3.0.2 Version: 4.4.11
Release: %mkrel 4 Release: 1
License: LGPLv2+ License: LGPLv2+
Group: System/Libraries Group: System/Libraries
Url: provide_url_to_some_site Url: https://github.com/besser82/libxcrypt
# where is full url to the source ? Source0: https://github.com/besser82/libxcrypt/archive/%{name}-%{version}.tar.gz
Source0: %{name}-%{version}.tar.bz2 #Patch0: libxcrypt-4.0.1-strict-aliasing.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: findutils
%description %description
Libxcrypt is a replacement for libcrypt, which comes with the GNU C Libxcrypt is a replacement for libcrypt, which comes with the GNU C
@ -20,7 +35,10 @@ blowfish encryption.
%package -n %{libname} %package -n %{libname}
Summary: Crypt Library for DES, MD5, Blowfish and others Summary: Crypt Library for DES, MD5, Blowfish and others
Group: System/Libraries Group: System/Libraries
Obsoletes: %{mklibname xcrypt 2} < 4.0.0
Provides: glibc-crypt_blowfish = 1.3
Provides: eglibc-crypt_blowfish = 1.3
%description -n %{libname} %description -n %{libname}
Libxcrypt is a replacement for libcrypt, which comes with the GNU C Libxcrypt is a replacement for libcrypt, which comes with the GNU C
@ -29,128 +47,93 @@ blowfish encryption.
%package -n %{develname} %package -n %{develname}
Summary: Development libraries for %{name} Summary: Development libraries for %{name}
Group: Development/C Group: Development/C
Requires: %{libname} = %{version}-%{release} Requires: %{libname} = %{EVRD}
Provides: %{name} = %{version}-%{release} Provides: %{name} = %{EVRD}
Obsoletes: %{mklibname xcrypt -d} < 4.0.0
Provides: glibc-crypt_blowfish-devel = 1.3
Provides: eglibc-crypt_blowfish-devel = 1.3
%description -n %{develname} %description -n %{develname}
This package contains the header files and static libraries necessary This package contains the header files necessary
to develop software using %{name}. to develop software using %{name}.
%package -n %{staticname}
Summary: Static libraries for %{name}
Group: Development/C
Requires: %{develname} = %{EVRD}
%description -n %{staticname}
This package contains the static libraries necessary
to develop software using %{name} without requiring
%{name} to be installed on the target system.
%prep %prep
%setup -q %autosetup -p1
%build %build
export CFLAGS="%{optflags} -Wno-cast-align" autoreconf -fiv
%configure2_5x \
--libdir=/%{_lib} \
--disable-static
%make %configure \
--libdir=/%{_lib} \
--enable-shared \
--enable-static \
--enable-hashes=all \
--disable-failure-tokens \
--enable-obsolete-api=yes || (cat config.log && exit 1)
%make_build
%install %install
%makeinstall_std %make_install
mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_libdir}/pkgconfig/
rm %{buildroot}/%{_lib}/libxcrypt.{so,la} mv %{buildroot}/%{_lib}/pkgconfig/*.pc %{buildroot}%{_libdir}/pkgconfig/
rm %{buildroot}/%{_lib}/xcrypt/lib*.{so,la} mv %{buildroot}/%{_lib}/*.a %{buildroot}%{_libdir}/
ln -sf ../../%{_lib}/libxcrypt.so.2 %{buildroot}%{_libdir}/libxcrypt.so
%if %mdkversion < 200900 # We do not need libowcrypt.*, since it is a SUSE
%post -n %{libname} -p /sbin/ldconfig # compat thing. Software needing it to be build can
# be patched easily to just link against '-lcrypt'.
find %{buildroot} -name 'libow*' -print -delete
%check
# Make sure the symbol versioning script worked
if ! nm $(ls .libs/libcrypt.so.%{major}* |head -n1) |grep -q 'crypt_r@GLIBC_2'; then
printf '%s\n' 'Symbol versioning script seems to have messed up.'
printf '%s\n' 'Make sure this is fixed unless you want to break pam.'
printf '%s\n' 'You may want to try a different ld.'
exit 1
fi
# FIXME as of libxcrypt 4.4.3-2, clang 7.0.1-1, binutils 2.32-1
# make check fails on 32-bit ARM:
#
# ./m4/test-driver: line 107: 9303 Bus error (core dumped) "$@" > $log_file 2>&1
# [...]
# FAIL: test-alg-gost3411-2012
#============================
# ok: test vector from example A.1 from GOST-34.11-2012 (256 Bit)
# ERROR: false positive test vector (256 Bit)
# FAIL test-alg-gost3411-2012 (exit status: 135)
#
# Since this happens in one of the less relevant algorithms and libxcrypt
# 4.4.3-2 is perfectly usable for PAM and friends even if there is a bug
# in GOST, we let this pass for now.
%ifnarch %{arm}
# (tpg) all tests MUST pass
make check || (cat test-suite.log && exit 1)
%endif %endif
%if %mdkversion < 200900
%postun -n %{libname} -p /sbin/ldconfig
%endif
%clean
rm -rf %{buildroot}
%files -n %{libname} %files -n %{libname}
%defattr(-,root,root)
%doc README NEWS README.bcrypt README.ufc-crypt
/%{_lib}/lib*.so.%{major}* /%{_lib}/lib*.so.%{major}*
%dir /%{_lib}/xcrypt
/%{_lib}/xcrypt/lib*.so.*
%files -n %{develname} %files -n %{develname}
%defattr(-,root,root) %doc AUTHORS NEWS README.md
%{_prefix}/include/*.h %{_includedir}/*.h
%{_libdir}/lib*.so /%{_lib}/libcrypt.so
/%{_lib}/libxcrypt.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man3/crypt*.3*
%{_mandir}/man5/crypt.5*
%files -n %{staticname}
%{_libdir}/libcrypt.a
%changelog %{_libdir}/libxcrypt.a
* Fri Dec 10 2010 Oden Eriksson <oeriksson@mandriva.com> 3.0.2-4mdv2011.0
+ Revision: 620238
- the mass rebuild of 2010.0 packages
* Mon Sep 14 2009 Thierry Vignaud <tv@mandriva.org> 3.0.2-3mdv2010.0
+ Revision: 439486
- rebuild
+ Tomasz Pawel Gajc <tpg@mandriva.org>
- apply mdv library packaging policy
- new license policy
- spec file clean
+ Zombie Ryushu <ryushu@mandriva.org>
- Fix Macros
* Mon Jan 26 2009 Zombie Ryushu <ryushu@mandriva.org> 3.0.2-1mdv2009.1
+ Revision: 333604
- Import from SuSE
- import libxcrypt
* Tue Dec 16 2008 kukuk@suse.de
- Update to version 3.0.2 (merge of patches)
* Sun Sep 28 2008 kukuk@suse.de
- Add missing gensalt security fixes (was [bnc#408719])
* Thu Jun 26 2008 kukuk@suse.de
- Remove old obsolete libxcrypt.so.1
* Tue Apr 15 2008 kukuk@suse.de
- Create libxcrypt.so.1 symlink and include it in package
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
for multilib support
* Mon Apr 7 2008 schwab@suse.de
- Remove use of undefined macro.
- Work around unclean sources.
* Thu Apr 3 2008 kukuk@suse.de
- Add libxcrypt-3.0:
* Add sha256 and sha512 hashes
* Create plugins for every hash function except DES/bigcrypt
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jan 6 2006 kukuk@suse.de
- Update to 2.4 (sync with crypt_blowfish 1.0)
* Sun Sep 18 2005 kukuk@suse.de
- Update to 2.3 (remove broken assembler code)
* Sat Apr 9 2005 schwab@suse.de
- Fix utterly broken and unportable code.
* Fri Jun 18 2004 kukuk@suse.de
- Update to 2.2 (apply fixes from glibc version)
* Sat Jan 10 2004 adrian@suse.de
- add %%run_ldconfig
* Fri Nov 14 2003 kukuk@suse.de
- Compile libarary with no exec stack
* Thu Oct 16 2003 kukuk@suse.de
- Update to 2.1 (use optimized assembler version on ix86)
* Mon Jul 28 2003 kukuk@suse.de
- Update to 2.0
* Tue May 13 2003 kukuk@suse.de
- Add defattr to filelist
* Thu Jan 16 2003 kukuk@suse.de
- Update to version 1.4 (compiles with glibc > 2.3.1)
* Fri Jan 10 2003 kukuk@suse.de
- Update to version 1.3 (fix initialisation of internal data
struct for des_crypt)
* Mon Oct 21 2002 kukuk@suse.de
- Update to version 1.2 (fix compiling with glibc 2.3.x)
* Mon May 27 2002 kukuk@suse.de
- Update to version 1.1 (add SHA1 support)
* Wed Apr 17 2002 kukuk@suse.de
- Add require to libxcrypt-devel for correct shared library
* Mon Apr 15 2002 kukuk@suse.de
- Initial version of a libcrypt replacement