Drop Python 2 support in RHEL

This commit is contained in:
Tomas Mraz 2018-02-21 13:14:59 +01:00
parent 09348f50cb
commit 68dc49109f

View File

@ -1,11 +1,12 @@
# Reflects the values hard-coded in various Makefile.am's in the source tree.
%define dictdir %{_datadir}/cracklib
%define dictpath %{dictdir}/pw_dict
%define rhel 1
Summary: A password-checking library
Name: cracklib
Version: 2.9.6
Release: 12%{?dist}
Release: 13%{?dist}
Group: System Environment/Libraries
Source0: https://github.com/cracklib/cracklib/releases/download/cracklib-%{version}/cracklib-%{version}.tar.gz
Source1: https://github.com/cracklib/cracklib/releases/download/cracklib-%{version}/cracklib-words-%{version}.gz
@ -29,9 +30,13 @@ Patch8: cracklib-2.9.6-cve-2016-6318.patch
URL: http://sourceforge.net/projects/cracklib/
License: LGPLv2+
Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: python2-devel, words, gettext
BuildRequires: gcc
BuildRequires: words, gettext
BuildRequires: gettext-autopoint
BuildRequires: zlib-devel
%if 0%{?rhel} == 0
BuildRequires: python2-devel
%endif
Conflicts: cracklib-dicts < 2.8
# The cracklib-format script calls gzip, but without a specific path.
Requires: gzip
@ -63,6 +68,7 @@ Requires: %{name} = %{version}-%{release}
The cracklib-devel package contains the header files and libraries needed
for compiling applications which use cracklib.
%if 0%{?rhel} == 0
%package -n python2-cracklib
Summary: Python bindings for applications which use cracklib
Group: Development/Libraries
@ -76,6 +82,7 @@ Obsoletes: %{name}-python < %{version}-%{release}
%description -n python2-cracklib
The cracklib-python package contains a module which permits applications
written in the Python programming language to use cracklib.
%endif
%package dicts
Summary: The standard CrackLib dictionaries
@ -113,7 +120,13 @@ done
chmod +x util/cracklib-format
%build
%configure --with-pic --with-python --with-default-dict=%{dictpath} --disable-static
%configure --with-pic \
%if 0%{?rhel} == 0
--with-python \
%else
--without-python \
%endif
--with-default-dict=%{dictpath} --disable-static
make -C po update-gmo
make
@ -158,6 +171,7 @@ fi
%check
make test
%if 0%{?rhel} == 0
# We want to check that the new library is able to open the new dictionaries,
# using the new python module.
LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} %{__python} 2>&1 << EOF
@ -185,6 +199,7 @@ except ValueError, message:
finally:
sys.exit(0)
EOF
%endif
%ldconfig_scriptlets
@ -213,12 +228,17 @@ EOF
%{_sbindir}/mkdict
%{_sbindir}/packer
%if 0%{?rhel} == 0
%files -n python2-cracklib
%defattr(-,root,root)
%{_libdir}/python*/site-packages/_cracklib*.so
%{_libdir}/python*/site-packages/*.py*
%endif
%changelog
* Wed Feb 21 2018 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-13
- Drop Python 2 support in RHEL
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild