libxcrypt/libxcrypt.spec

499 lines
17 KiB
RPMSpec
Raw Normal View History

# Build with new api?
#if 0%%{?fedora} >= 30 || 0%%{?rhel} >= 9
#bcond_without new_api
#else
%bcond_with new_api
#endif
2018-10-25 14:34:44 +00:00
# Run memcheck?
# Valgrind does not work well on %%{power64} arches.
%ifnarch %{power64}
%bcond_without memcheck
%else
%bcond_with memcheck
%endif
2018-01-12 19:49:45 +00:00
# Shared object version of libcrypt.
%if %{with new_api}
%global soc 2
%global sol 0
%global sof 0
%global sov %{soc}.%{sol}.%{sof}
%global csoc 1
%global csol 1
%global csof 0
%global csov %{csoc}.%{csol}.%{csof}
%else
2018-01-12 19:49:45 +00:00
%global soc 1
%global sol 1
%global sof 0
%global sov %{soc}.%{sol}.%{sof}
%endif
2018-10-03 09:56:56 +00:00
# Hash methods and API supported by libcrypt.
# NEVER EVER touch this, if you do NOT know what you are doing!
%if %{with new_api}
2018-11-14 18:36:20 +00:00
%global hash_methods fedora,glibc,strong
2018-10-03 09:56:56 +00:00
%global obsolete_api no
2018-11-14 13:14:23 +00:00
%global compat_methods all
2018-10-03 09:56:56 +00:00
%global compat_api glibc
%else
%global hash_methods all
%global obsolete_api glibc
%endif
# Needed for out-of-tree builds.
2018-11-14 13:14:23 +00:00
%global _configure ../"configure"
2018-01-12 19:49:45 +00:00
2018-10-03 09:56:56 +00:00
# Common configure options.
%global common_configure_options \\\
--libdir=/%{_lib} \\\
2018-11-14 13:14:23 +00:00
--disable-failure-tokens \\\
2018-10-03 09:56:56 +00:00
--disable-silent-rules \\\
--enable-shared \\\
--enable-static \\\
2018-10-25 14:34:44 +00:00
%if %{with memcheck} \
--enable-valgrind \\\
%else \
--disable-valgrind \\\
%endif \
2018-10-03 09:56:56 +00:00
--srcdir=.. \\\
--with-pkgconfigdir=%{_libdir}/pkgconfig
2018-01-12 19:49:45 +00:00
# Add generation of HMAC checksums of the final stripped
# binaries. %%define with lazy globbing is used here
# intentionally, because using %%global does not work.
%define __spec_install_post \
%{?__debug_package:%{__debug_install_post}} \
%{__arch_install_post} \
%{__os_install_post} \
%{_bindir}/fipshmac %{buildroot}/%{_lib}/libcrypt.a \
2018-11-14 18:36:20 +00:00
%{__ln_s} .libcrypt.a.hmac \\\
%{buildroot}/%{_lib}/.libxcrypt.a.hmac \
%{_bindir}/fipshmac %{buildroot}/%{_lib}/libcrypt.so.%{sov} \
%{__ln_s} .libcrypt.so.%{sov}.hmac \\\
%{buildroot}/%{_lib}/.libcrypt.so.%{soc}.hmac \
if [[ %{with new_api} == 1 ]]; then \
%{_bindir}/fipshmac %{buildroot}/%{_lib}/libcrypt.so.%{csov} \
%{__ln_s} .libcrypt.so.%{csov}.hmac \\\
%{buildroot}/%{_lib}/.libcrypt.so.%{csoc}.hmac \
fi \
2018-01-12 19:49:45 +00:00
%{nil}
Name: libxcrypt
2018-11-20 09:37:02 +00:00
Version: 4.4.0
Release: 5%{?dist}
2018-01-12 19:49:45 +00:00
Summary: Extended crypt library for DES, MD5, Blowfish and others
# For explicit license breakdown, see the
# LICENSING file in the source tarball.
License: LGPLv2+ and BSD and Public Domain
2018-01-12 19:49:45 +00:00
URL: https://github.com/besser82/%{name}
2018-11-09 15:31:07 +00:00
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
2018-11-14 13:14:23 +00:00
# Patch 0000 - 2999: Backported patches from upstream.
Patch0000: %{url}/commit/a60130b2211c6666bee69051b2b76413af2d679f.patch#/%{name}-4.4.0-fix_manual-page-warning_list-type-stack0.patch
Patch0001: %{url}/commit/664bfda5a51dbaa75904b29a7cd3c51888db6bd9.patch#/%{name}-4.4.0-use_XCRYPT_STRCPY_OR_ABORT_in_crypt_nt_rn.patch
Patch0002: %{url}/commit/fdeddd908b6c659b281bbef7e535f9060b5b6186.patch#/%{name}-4.4.0-use_base64_output_gensalt_nt_rn.patch
Patch0003: %{url}/commit/f6fe5e6faf4a681984e5bb9d830c8006bba8dab7.patch#/%{name}-4.4.0-set_minimum_rbytes_for_NT_to_2.patch
Patch0004: %{url}/commit/580a15e118ee86676ddc1b4456ae6a3f14d86296.patch#/%{name}-4.4.0-test_hmac-sha256_incremental_computation.patch
Patch0005: %{url}/commit/176151db6c456c41be12f7d3a6338559d767cf9b.patch#/%{name}-4.4.0-test-crypt-gost-yescrypt_fix_static_pointer_memory_leak.patch
Patch0006: %{url}/commit/4b4aaa2241aa8b8d52e78cbf486acb0d8cb1e67d.patch#/%{name}-4.4.0-buildflags_-fno-plt.patch
2018-11-11 16:29:22 +00:00
2018-11-14 13:14:23 +00:00
# Patch 3000 - 5999: Backported patches from pull requests.
2018-11-11 16:29:22 +00:00
2018-11-14 13:14:23 +00:00
# Patch 6000 - 9999: Downstream patches.
2018-01-12 19:49:45 +00:00
BuildRequires: fipscheck
BuildRequires: libtool
2018-10-25 14:34:44 +00:00
%if %{with memcheck}
BuildRequires: valgrind
%endif
2018-01-12 19:49:45 +00:00
# We do not need to keep this forever.
2018-11-14 13:14:23 +00:00
%if (0%{?fedora} && 0%{?fedora} <= 31) || (0%{?rhel} && 0%{?rhel} <= 10)
# Inherited from former libcrypt package.
2018-11-14 13:14:23 +00:00
Obsoletes: libcrypt-nss <= 2.26.9000-33
Provides: libcrypt-nss == 2.26.9000-34
2018-01-19 21:34:00 +00:00
2018-11-14 13:14:23 +00:00
# Obsolete former libcrypt properly and provide a virtual libcrypt
# package as it has been done by the former packages, which were
# built by glibc before.
Obsoletes: libcrypt <= 2.26.9000-46
Provides: libcrypt == 2.26.9000-47
Provides: libcrypt%{?_isa} == 2.26.9000-47
2018-01-19 21:34:00 +00:00
2018-11-14 13:04:54 +00:00
# Obsolete former libxcrypt-common properly.
2018-11-14 13:14:23 +00:00
Obsoletes: %{name}-common <= 4.3.3-3
Provides: %{name}-common == %{version}-%{release}
2018-11-14 13:04:54 +00:00
2018-11-14 13:14:23 +00:00
# We need a version of glibc, that doesn't build libcrypt anymore.
Requires: glibc%{?_isa} >= 2.26.9000-46
2018-11-14 13:14:23 +00:00
%endif
%if 0%{?fedora} >= 30
Recommends: mkpasswd%{?_isa}
%endif
2018-01-12 19:49:45 +00:00
%description
libxcrypt is a modern library for one-way hashing of passwords. It
supports a wide variety of both modern and historical hashing methods:
2018-11-09 15:30:26 +00:00
yescrypt, gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt,
md5crypt, SunMD5, sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt.
It provides the traditional Unix crypt and crypt_r interfaces, as well
as a set of extended interfaces pioneered by Openwall Linux, crypt_rn,
crypt_ra, crypt_gensalt, crypt_gensalt_rn, and crypt_gensalt_ra.
2018-01-12 19:49:45 +00:00
libxcrypt is intended to be used by login(1), passwd(1), and other
2018-11-09 15:30:26 +00:00
similar programs; that is, to hash a small number of passwords during
an interactive authentication dialogue with a human. It is not suitable
for use in bulk password-cracking applications, or in any other situation
where speed is more important than careful handling of sensitive data.
However, it is intended to be fast and lightweight enough for use in
servers that must field thousands of login attempts per minute.
%if %{with new_api}
This version of the library does not provide the legacy API functions
that have been provided by glibc's libcrypt.so.1.
2018-11-09 15:30:26 +00:00
%endif
%if %{with new_api}
%package compat
Summary: Compatibility library providing legacy API functions
Requires: %{name}%{?_isa} == %{version}-%{release}
%description compat
This package contains the library providing the compatibility API for
applications that are still using the unsafe and deprecated encrypt,
encrypt_r, setkey, setkey_r, and fcrypt functions.
All existing binary executables linked against glibc's libcrypt should
2018-11-14 13:14:23 +00:00
work unmodified with this library.
%endif
2018-01-12 19:49:45 +00:00
%package devel
Summary: Development files for %{name}
2018-11-14 13:14:23 +00:00
Conflicts: man-pages < 4.15-3
2018-11-14 13:14:23 +00:00
Requires: %{name}%{?_isa} == %{version}-%{release}
Requires: glibc-devel%{?_isa}
2018-01-12 19:49:45 +00:00
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package static
Summary: Static library for -static linking with %{name}
2018-11-14 13:14:23 +00:00
Requires: %{name}-devel%{?_isa} == %{version}-%{release}
Requires: glibc-static%{?_isa}
2018-01-12 19:49:45 +00:00
%description static
2018-10-01 19:54:03 +00:00
This package contains the libxcrypt static library for -static
linking.
You don't need this, unless you link statically, which is highly
discouraged.
2018-01-12 19:49:45 +00:00
%prep
2018-01-27 16:14:06 +00:00
%autosetup -p 1
2018-10-25 14:40:55 +00:00
./bootstrap
%{__mkdir_p} %{_vpath_builddir}{,-compat}
2018-01-12 19:49:45 +00:00
%build
2018-11-14 18:36:20 +00:00
# Build the default system library.
pushd %{_vpath_builddir}
2018-10-03 09:56:56 +00:00
%configure \
%{common_configure_options} \
--enable-hashes=%{hash_methods} \
--enable-obsolete-api=%{obsolete_api}
%make_build
popd
2018-11-14 18:36:20 +00:00
2018-10-03 09:56:56 +00:00
%if %{with new_api}
2018-11-14 18:36:20 +00:00
# Build the compatibility library.
pushd %{_vpath_builddir}-compat
2018-10-03 09:56:56 +00:00
%configure \
%{common_configure_options} \
--enable-hashes=%{compat_methods} \
--enable-obsolete-api=%{compat_api}
2018-01-12 19:49:45 +00:00
%make_build
popd
2018-10-03 09:56:56 +00:00
%endif
2018-01-12 19:49:45 +00:00
%install
%if %{with new_api}
2018-11-14 18:36:20 +00:00
# Install the compatibility library.
%make_install -C %{_vpath_builddir}-compat
2018-11-14 18:36:20 +00:00
# Cleanup everything we do not need from the compatibility library.
%{__rm} -fr %{buildroot}%{_bindir} \
%{buildroot}%{_includedir} \
%{buildroot}/%{_lib}/lib{,x}crypt.{a,so} \
%{buildroot}%{_libdir}/pkgconfig \
%{buildroot}%{_mandir} \
%{buildroot}%{_sbindir}
%endif
2018-11-14 18:36:20 +00:00
# Install the default system library.
%make_install -C %{_vpath_builddir}
2018-01-12 19:49:45 +00:00
# Get rid of libtool crap.
%{_bindir}/find %{buildroot} -name '*.la' -print -delete
# Install documentation to shared %%_pkgdocdir.
%{__install} -Dpm 0644 -t %{buildroot}%{_pkgdocdir} \
ChangeLog NEWS README THANKS TODO
2018-11-14 18:36:20 +00:00
# Install 'README.fedora', if existing, to shared %%_pkgdocdir.
2018-11-10 12:53:57 +00:00
if [ -f README.fedora ]; then
%{__install} -Dpm 0644 -t %{buildroot}%{_pkgdocdir} \
README.fedora
fi
2018-01-12 19:49:45 +00:00
%check
%if %{with new_api}
for dir in %{_vpath_builddir} %{_vpath_builddir}-compat; do
%else
for dir in %{_vpath_builddir}; do
%endif
%make_build -C ${dir} check || \
{
rc=$?;
echo "-----BEGIN TESTLOG: ${dir}-----";
%{__cat} ${dir}/test-suite.log;
echo "-----END TESTLOG: ${dir}-----";
exit $rc;
}
2018-10-25 14:34:44 +00:00
%if %{with memcheck}
%make_build -C ${dir} check-valgrind-memcheck || \
{
rc=$?;
echo "-----BEGIN TESTLOG: ${dir}-----";
%{__cat} ${dir}/test-suite-memcheck.log;
echo "-----END TESTLOG: ${dir}-----";
exit $rc;
}
%endif
done
2018-01-12 19:49:45 +00:00
2018-02-17 08:45:54 +00:00
%ldconfig_scriptlets
%if %{with new_api}
%ldconfig_scriptlets compat
%endif
2018-01-12 19:49:45 +00:00
%files
%doc %dir %{_pkgdocdir}
%doc %{_pkgdocdir}/NEWS
2018-11-10 12:53:57 +00:00
%doc %{_pkgdocdir}/README*
2018-01-12 19:49:45 +00:00
%doc %{_pkgdocdir}/THANKS
2018-11-14 13:04:54 +00:00
%license AUTHORS COPYING.LIB LICENSING
/%{_lib}/.libcrypt.so.{%{soc},%{sov}}.hmac
/%{_lib}/libcrypt.so.{%{soc},%{sov}}
2018-01-12 19:49:45 +00:00
%{_mandir}/man5/crypt.5.*
%if %{with new_api}
%files compat
/%{_lib}/.libcrypt.so.{%{csoc},%{csov}}.hmac
/%{_lib}/libcrypt.so.{%{csoc},%{csov}}
%endif
2018-01-12 19:49:45 +00:00
%files devel
%doc %{_pkgdocdir}/ChangeLog
%doc %{_pkgdocdir}/TODO
2018-11-14 18:36:20 +00:00
/%{_lib}/lib{,x}crypt.so
%{_includedir}/{,x}crypt.h
%{_libdir}/pkgconfig/{libcrypt,%{name}}.pc
%{_mandir}/man3/crypt{,_r,_ra,_rn}.3.*
2018-11-09 15:31:07 +00:00
%{_mandir}/man3/crypt_checksalt.3.*
%{_mandir}/man3/crypt_gensalt{,_ra,_rn}.3.*
2018-11-20 09:37:02 +00:00
%{_mandir}/man3/crypt_preferred_method.3.*
2018-01-12 19:49:45 +00:00
%files static
2018-11-14 18:36:20 +00:00
/%{_lib}/.lib{,x}crypt.a.hmac
/%{_lib}/lib{,x}crypt.a
2018-01-12 19:49:45 +00:00
%changelog
* Tue Dec 04 2018 Björn Esser <besser82@fedoraproject.org> - 4.4.0-5
- Sync -fno-plt patch with upstream commit
* Tue Dec 04 2018 Björn Esser <besser82@fedoraproject.org> - 4.4.0-4
- Backport upstream commit to fix a memory leak from a static pointer
* Tue Dec 04 2018 Björn Esser <besser82@fedoraproject.org> - 4.4.0-3
- Backport upstream PR to build with -fno-plt optimization
* Mon Nov 26 2018 Björn Esser <besser82@fedoraproject.org> - 4.4.0-2
- Backport upstream commit to use a safer strcpy for the NT method
- Backport upstream generating base64 encoded output for NT gensalt
- Backport upstream commit to require less rbytes for NT gensalt
- Backport upstream commit to test incremental hmac-sha256 computation
- Add Recommends: mkpasswd for Fedora >= 30
2018-11-20 09:37:02 +00:00
* Tue Nov 20 2018 Björn Esser <besser82@fedoraproject.org> - 4.4.0-1
- New upstream release
2018-11-14 18:36:20 +00:00
* Wed Nov 14 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.4-1
- New upstream release
* Wed Nov 14 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.3-4
- Bump release for proper obsoletion of former common sub-package
* Wed Nov 14 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.3-3
- Add two upstream patches with minor fixes
- Add HMAC checksum file for the static library
2018-11-14 13:04:54 +00:00
- Drop the common sub-package
2018-11-14 13:14:23 +00:00
- Some spec-file optimizations
* Tue Nov 13 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.3-2
- Add a patch to define crypt_gensalt_r as macro, so applications
link the identical crypt_gensalt_rn directly
2018-11-11 21:50:23 +00:00
* Sun Nov 11 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.3-1
- New upstream release
2018-11-11 16:29:22 +00:00
* Sun Nov 11 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.2-1
- New upstream release
* Sun Nov 11 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.1-2
- Backport two patches from upstream fixing the gensalt function for
NT to properly terminate its returned output
2018-11-10 22:41:49 +00:00
* Sat Nov 10 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.1-1
- New upstream release
* Sat Nov 10 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.0-1
2018-11-09 15:31:07 +00:00
- New upstream release
2018-10-26 17:33:06 +00:00
* Fri Oct 26 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.3-1
- New upstream release
* Thu Oct 25 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.2-2
- Add patch updating to recent development version
2018-10-25 14:34:44 +00:00
- Run valgrind-memcheck
2018-10-25 14:40:55 +00:00
- Use bootstrap script
2018-10-18 19:27:28 +00:00
* Thu Oct 18 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.2-1
- New upstream release
2018-10-01 19:54:03 +00:00
* Mon Oct 01 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.1-3
- Drop compat-devel package
2018-10-03 09:56:56 +00:00
- Set configure options from globals
2018-10-01 19:54:03 +00:00
* Sun Sep 30 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.1-2
- Build out-of-tree
- Split off noarch-bits into common sub-package
- Update %%description
- Prepare to remove legacy API from library and to provide a compatibilty
package for the legacy API
2018-09-29 14:59:00 +00:00
* Sat Sep 29 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.1-1
- New upstream release
2018-09-29 15:05:25 +00:00
- Add new manpages
2018-09-29 14:59:00 +00:00
2018-09-29 14:24:38 +00:00
* Sat Sep 29 2018 Björn Esser <besser82@fedoraproject.org> - 4.2.0-1
- New upstream release
2018-08-24 10:26:54 +00:00
* Fri Aug 24 2018 Björn Esser <besser82@fedoraproject.org> - 4.1.2-1
- New upstream release
* Wed Aug 08 2018 Björn Esser <besser82@fedoraproject.org> - 4.1.1-4
- Move *.3 manpages to devel subpackage (#1613762)
- Add needed Conflicts: man-pages < 4.15-3
* Wed Aug 08 2018 Björn Esser <besser82@fedoraproject.org> - 4.1.1-3
- Make crypt{,_r} return NULL on failure (#1611784)
* Sat Aug 04 2018 Björn Esser <besser82@fedoraproject.org> - 4.1.1-2
- Add manpages for crypt{,_r,_ra}.3 (#1610307)
2018-08-01 09:54:10 +00:00
* Wed Aug 01 2018 Björn Esser <besser82@fedoraproject.org> - 4.1.1-1
- New upstream release
2018-07-13 18:59:08 +00:00
* Fri Jul 13 2018 Björn Esser <besser82@fedoraproject.org> - 4.1.0-1
- New upstream release
* Fri Jul 13 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.1-6
- Make testsuite fail on error again
- Update patch0 with more upstream fixes
* Fri Jul 13 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.1-5
- Add patch to update to recent development branch
- Re-enable SUNMD5 support as it is BSD licensed now
- Build compatibility symbols for glibc only
2018-07-13 10:07:18 +00:00
- Skip failing testsuite once
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 29 2018 Florian Weimer <fweimer@redhat.com> - 4.0.1-3
- Remove CDDL from license list (#1592445)
2018-06-29 12:45:29 +00:00
* Fri Jun 29 2018 Florian Weimer <fweimer@redhat.com> - 4.0.1-2
- Remove SUNMD5 support (#1592445)
2018-05-16 11:19:53 +00:00
* Wed May 16 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.1-1
- New upstream release
2018-02-17 08:45:54 +00:00
* Sat Feb 17 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-5
- Switch to %%ldconfig_scriptlets
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Feb 01 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-3
- Add patch to fix unintialize value in badsalt test
2018-01-31 00:24:17 +00:00
* Wed Jan 31 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-2
- Add patch to fix bcrypt test with GCC8
2018-01-27 15:46:57 +00:00
* Sat Jan 27 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-1
- New upstream release
* Mon Jan 22 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.0.0-0.204.20180120git3436e7b
- Fix Obsoletes
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-0.203.20180120git3436e7b
- Update to new snapshot fixing cast-align
2018-01-20 20:21:31 +00:00
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-0.202.20180120gitde99d27
- Update to new snapshot (rhbz#1536752)
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-0.201.20171109git15447aa
- Use archful Obsoletes for libcrypt
- Add versioned Requires on glibc packages not shipping libcrypt
- Add comments about the packaging logic for replacing former libcrypt
2018-01-12 19:49:45 +00:00
* Fri Jan 12 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-0.200.20171109git15447aa
- Initial import (rhbz#1532794)
2018-01-19 21:34:00 +00:00
- Add Obsoletes/Provides for libcrypt
2018-01-12 19:49:45 +00:00
* Wed Jan 10 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-0.101.20171109git15447aa
- Fix style of %%git_{rel,ver}
* Tue Jan 09 2018 Björn Esser <besser82@fedoraproject.org> - 4.0.0-0.100.git20171109.15447aa
- Initial rpm release (rhbz#1532794)
- Start revision at 0.100 to superseed builds from COPR