remove python2

This commit is contained in:
yang_zhuang_zhuang 2020-10-22 16:05:48 +08:00
parent a03d5648f1
commit 2874dafc0e

View File

@ -1,4 +1,3 @@
%bcond_without python2
%bcond_without python3 %bcond_without python3
%define dictdir %{_datadir}/cracklib %define dictdir %{_datadir}/cracklib
@ -6,7 +5,7 @@
Name: cracklib Name: cracklib
Version: 2.9.7 Version: 2.9.7
Release: 4 Release: 5
Summary: A password-checking library Summary: A password-checking library
License: LGPLv2+ License: LGPLv2+
@ -16,9 +15,6 @@ Source1: https://github.com/cracklib/cracklib/releases/download/v%{version}/crac
Patch9000: fix-problem-of-error-message-about-simplistic-passwo.patch Patch9000: fix-problem-of-error-message-about-simplistic-passwo.patch
BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel
%if %{with python2}
BuildRequires: python2-devel
%endif
%if %{with python3} %if %{with python3}
BuildRequires: python3-devel BuildRequires: python3-devel
%endif %endif
@ -50,16 +46,6 @@ for compiling applications which use cracklib.
%package_help %package_help
%if %{with python2}
%package -n python2-cracklib
Summary: Python 2 bindings for applications which use cracklib
Requires: %{name} = %{version}-%{release}
%description -n python2-cracklib
The python2-cracklib package contains a module which permits applications
written in the Python 2 programming language to use cracklib.
%endif
%if %{with python3} %if %{with python3}
%package -n python3-cracklib %package -n python3-cracklib
Summary: Python 3 bindings for applications which use cracklib Summary: Python 3 bindings for applications which use cracklib
@ -80,26 +66,8 @@ do
done done
chmod +x util/cracklib-format chmod +x util/cracklib-format
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
%if %{with python2}
sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in
export PYTHON=%{__python2}
%configure \
--disable-static \
--with-pic \
--with-python \
--with-default-dict=%{dictpath}
make -C po update-gmo
make
%endif
%if %{with python3} %if %{with python3}
pushd %{py3dir}
sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in
py3include=`python3-config --includes | awk -F' ' '{print $1;}'` py3include=`python3-config --includes | awk -F' ' '{print $1;}'`
export PYTHON=%{__python3} export PYTHON=%{__python3}
@ -114,19 +82,12 @@ py_version="%{python3_version}$abiflags"
--with-default-dict=%{dictpath} --with-default-dict=%{dictpath}
make -C po update-gmo make -C po update-gmo
make make
popd
%endif %endif
%install %install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%if %{with python2}
make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}'
%endif
%if %{with python3} %if %{with python3}
pushd %{py3dir}
make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}' make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}'
popd
%endif %endif
./util/cracklib-format cracklib-dicts/* | \ ./util/cracklib-format cracklib-dicts/* | \
@ -181,12 +142,6 @@ make test
%files help %files help
%doc README README-WORDS NEWS %doc README README-WORDS NEWS
%if %{with python2}
%files -n python2-cracklib
%{_libdir}/python2*/site-packages/_cracklib*.so
%{_libdir}/python2*/site-packages/*.py*
%endif
%if %{with python3} %if %{with python3}
%files -n python3-cracklib %files -n python3-cracklib
%{_libdir}/python3*/site-packages/_cracklib*.so %{_libdir}/python3*/site-packages/_cracklib*.so
@ -195,6 +150,9 @@ make test
%endif %endif
%changelog %changelog
* Thu Oct 22 2020 yangzhuangzhuang <yangzhuangzhuang1@huawei.com> - 2.9.7-5
- remove python2
* Mon Sep 14 2020 wangchen <wangchen137@huawei.com> - 2.9.7-4 * Mon Sep 14 2020 wangchen <wangchen137@huawei.com> - 2.9.7-4
- Modify the URL of Source - Modify the URL of Source