Some spec-file optimizations

This commit is contained in:
Björn Esser 2018-11-14 14:14:23 +01:00
parent d692c1ed47
commit 1999735bf0
No known key found for this signature in database
GPG Key ID: F52E98007594C21D

View File

@ -38,7 +38,7 @@
%if %{with new_api} %if %{with new_api}
%global hash_methods glibc,strong %global hash_methods glibc,strong
%global obsolete_api no %global obsolete_api no
%global compat_methods glibc %global compat_methods all
%global compat_api glibc %global compat_api glibc
%else %else
%global hash_methods all %global hash_methods all
@ -47,16 +47,16 @@
# Needed for out-of-tree builds. # Needed for out-of-tree builds.
%global _configure ../configure %global _configure ../"configure"
# Common configure options. # Common configure options.
%global common_configure_options \\\ %global common_configure_options \\\
--libdir=/%{_lib} \\\ --libdir=/%{_lib} \\\
--disable-failure-tokens \\\
--disable-silent-rules \\\ --disable-silent-rules \\\
--enable-shared \\\ --enable-shared \\\
--enable-static \\\ --enable-static \\\
--disable-failure-tokens \\\
%if %{with memcheck} \ %if %{with memcheck} \
--enable-valgrind \\\ --enable-valgrind \\\
%else \ %else \
@ -96,14 +96,14 @@ License: LGPLv2+ and BSD and Public Domain
URL: https://github.com/besser82/%{name} URL: https://github.com/besser82/%{name}
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Patch 0001 - 3000: Backported patches from upstream. # Patch 0000 - 2999: Backported patches from upstream.
Patch0001: %{url}/commit/5e9199f293473a0c14f836b3df8ecf6aeed1e315.patch#/%{name}-4.3.3-alg_sha512_make_PAD_const.patch Patch0000: %{url}/commit/5e9199f293473a0c14f836b3df8ecf6aeed1e315.patch#/%{name}-4.3.3-alg_sha512_make_PAD_const.patch
Patch0002: %{url}/commit/65485d7891cfe50db941ab14e864bb485a54d71c.patch#/%{name}-4.3.3-skip_bcrypt_test_if_not_enabled.patch Patch0001: %{url}/commit/65485d7891cfe50db941ab14e864bb485a54d71c.patch#/%{name}-4.3.3-skip_bcrypt_test_if_not_enabled.patch
# Patch 3001 - 6000: Backported patches from pull requests. # Patch 3000 - 5999: Backported patches from pull requests.
# Patch 6001 - 9999: Downstream patches. # Patch 6000 - 9999: Downstream patches.
Patch6001: %{name}-4.3.3-gensalt_r_as_macro.patch Patch6000: %{name}-4.3.3-gensalt_r_as_macro.patch
BuildRequires: fipscheck BuildRequires: fipscheck
BuildRequires: libtool BuildRequires: libtool
@ -112,24 +112,25 @@ BuildRequires: valgrind
%endif %endif
# We do not need to keep this forever. # We do not need to keep this forever.
%if %{without new_api} && (0%{?fedora} && 0%{?fedora} <= 31) || (0%{?rhel} && 0%{?rhel} <= 10) %if (0%{?fedora} && 0%{?fedora} <= 31) || (0%{?rhel} && 0%{?rhel} <= 10)
# Inherited from former libcrypt package. # Inherited from former libcrypt package.
Obsoletes: libcrypt-nss <= 2.26.9000-33 Obsoletes: libcrypt-nss <= 2.26.9000-33
Provides: libcrypt-nss == 2.26.9000-34
# Obsolete former libcrypt properly. # 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 Obsoletes: libcrypt <= 2.26.9000-46
# Provide virtual libcrypt as it has been done
# by former libcrypt{,-nss} packages from glibc.
Provides: libcrypt == 2.26.9000-47 Provides: libcrypt == 2.26.9000-47
Provides: libcrypt%{?_isa} == 2.26.9000-47 Provides: libcrypt%{?_isa} == 2.26.9000-47
%endif
# Obsolete former libxcrypt-common properly. # Obsolete former libxcrypt-common properly.
Obsoletes: %{name}-common <= 4.3.3-3 Obsoletes: %{name}-common <= 4.3.3-3
Provides: %{name}-common == %{version}-%{release} Provides: %{name}-common == %{version}-%{release}
# We need a version of glibc, that doesn't build libcrypt anymore.
Requires: glibc%{_isa} >= 2.26.9000-46 Requires: glibc%{_isa} >= 2.26.9000-46
%endif
%description %description
@ -159,21 +160,7 @@ that have been provided by glibc's libcrypt.so.1.
%package compat %package compat
Summary: Compatibility library providing legacy API functions Summary: Compatibility library providing legacy API functions
# We do not need to keep this forever. Requires: %{name}%{_isa} == %{version}-%{release}
%if (0%{?fedora} && 0%{?fedora} <= 31) || (0%{?rhel} && 0%{?rhel} <= 10)
# Inherited from former libcrypt package.
Obsoletes: libcrypt-nss <= 2.26.9000-33
# Obsolete former libcrypt properly.
Obsoletes: libcrypt <= 2.26.9000-46
# Provide virtual libcrypt as it has been done
# by former libcrypt{,-nss} packages from glibc.
Provides: libcrypt == 2.26.9000-47
Provides: libcrypt%{?_isa} == 2.26.9000-47
%endif
Requires: %{name}%{?_isa} == %{version}-%{release}
%description compat %description compat
This package contains the library providing the compatibility API for This package contains the library providing the compatibility API for
@ -181,7 +168,7 @@ applications that are still using the unsafe and deprecated encrypt,
encrypt_r, setkey, setkey_r, and fcrypt functions. encrypt_r, setkey, setkey_r, and fcrypt functions.
All existing binary executables linked against glibc's libcrypt should All existing binary executables linked against glibc's libcrypt should
work unmodified with this version of the libxcrypt. work unmodified with this library.
%endif %endif
@ -191,8 +178,7 @@ Summary: Development files for %{name}
Conflicts: man-pages < 4.15-3 Conflicts: man-pages < 4.15-3
Requires: %{name}%{?_isa} == %{version}-%{release} Requires: %{name}%{?_isa} == %{version}-%{release}
Requires: glibc-devel%{?_isa} >= 2.26.9000-46 Requires: glibc-devel%{?_isa}
Requires: glibc-headers%{?_isa} >= 2.26.9000-46
%description devel %description devel
The %{name}-devel package contains libraries and header files for The %{name}-devel package contains libraries and header files for
@ -203,7 +189,7 @@ developing applications that use %{name}.
Summary: Static library for -static linking with %{name} Summary: Static library for -static linking with %{name}
Requires: %{name}-devel%{?_isa} == %{version}-%{release} Requires: %{name}-devel%{?_isa} == %{version}-%{release}
Requires: glibc-static%{?_isa} >= 2.26.9000-46 Requires: glibc-static%{?_isa}
%description static %description static
This package contains the libxcrypt static library for -static This package contains the libxcrypt static library for -static
@ -243,7 +229,7 @@ popd
%make_install -C %{_vpath_builddir}-compat %make_install -C %{_vpath_builddir}-compat
%{__rm} -fr %{buildroot}%{_bindir} \ %{__rm} -fr %{buildroot}%{_bindir} \
%{buildroot}%{_includedir} \ %{buildroot}%{_includedir} \
%{buildroot}%{_libdir}/libcrypt.{a,so} \ %{buildroot}/%{_lib}/libcrypt.{a,so} \
%{buildroot}%{_libdir}/pkgconfig \ %{buildroot}%{_libdir}/pkgconfig \
%{buildroot}%{_mandir} \ %{buildroot}%{_mandir} \
%{buildroot}%{_sbindir} %{buildroot}%{_sbindir}
@ -335,6 +321,7 @@ done
- Add two upstream patches with minor fixes - Add two upstream patches with minor fixes
- Add HMAC checksum file for the static library - Add HMAC checksum file for the static library
- Drop the common sub-package - Drop the common sub-package
- Some spec-file optimizations
* Tue Nov 13 2018 Björn Esser <besser82@fedoraproject.org> - 4.3.3-2 * 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 - Add a patch to define crypt_gensalt_r as macro, so applications