[packages/cracklib] - only python 2 or 3 stuff can be built, not both, prefer python 3

hawk hawk at pld-linux.org
Sun Feb 27 00:44:36 CET 2022


commit 3c736fab931dca346ef39a23c9dfd1431d43a1da
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Sat Feb 26 23:43:10 2022 +0000

    - only python 2 or 3 stuff can be built, not both, prefer python 3

 cracklib-python3.patch | 19 +++++++++++++++++++
 cracklib.spec          | 20 +++++++++++++++-----
 2 files changed, 34 insertions(+), 5 deletions(-)
---
diff --git a/cracklib.spec b/cracklib.spec
index 17f0217..3808876 100644
--- a/cracklib.spec
+++ b/cracklib.spec
@@ -1,6 +1,10 @@
-%bcond_without	python2	# Don't build python 2 bindings
+%bcond_with	python2	# Don't build python 2 bindings
 %bcond_without	python3	# Don't build python 3 bindings
 
+%if %{with python3}
+%undefine with_python2
+%endif
+
 Summary:	Password checking library
 Summary(es.UTF-8):	Biblioteca de chequeo de contraseñas
 Summary(fr.UTF-8):	Bibliothèque de vérification de mots de passe
@@ -20,6 +24,7 @@ Source0:	https://github.com/cracklib/cracklib/releases/download/v%{version}/%{na
 # for manuals (note: update when available)
 Source1:	http://ftp.debian.org/debian/pool/main/c/cracklib2/%{name}2_2.9.6-2.debian.tar.xz
 # Source1-md5:	6af239dbba1fa8ce3ecc0724babe5078
+Patch0:		%{name}-python3.patch
 URL:		https://github.com/cracklib/cracklib
 BuildRequires:	gettext-tools >= 0.17
 %{?with_python2:BuildRequires:	python-devel}
@@ -178,8 +183,13 @@ Wiązanie Pythona do crackliba.
 
 %prep
 %setup -q -a1
+%{?with_python3:%patch0 -p1}
 
 %build
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 %configure \
 	--with-default-dict=%{_datadir}/dict/cracklib_dict
 %{__make}
@@ -210,8 +220,8 @@ util/cracklib-packer $RPM_BUILD_ROOT%{_datadir}/dict/cracklib-small
 
 %if %{with python3}
 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*.{la,a}
-%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/test_cracklib.py*
-%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/__pycache__/test_cracklib.*.py*
+%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/test_cracklib.py*
+%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/__pycache__/test_cracklib.*.py*
 %endif
 
 # already in file(1) database
@@ -260,6 +270,6 @@ rm -rf $RPM_BUILD_ROOT
 %files -n python3-cracklib
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py3_sitedir}/_cracklib.so
-%{py3_sitedir}/cracklib.py
-%{py3_sitedir}/__pycache__/cracklib.*.py[co]
+%{py3_sitescriptdir}/cracklib.py
+%{py3_sitescriptdir}/__pycache__/cracklib.*.py[co]
 %endif
diff --git a/cracklib-python3.patch b/cracklib-python3.patch
new file mode 100644
index 0000000..7c7a08d
--- /dev/null
+++ b/cracklib-python3.patch
@@ -0,0 +1,19 @@
+diff -u cracklib-2.9.7.orig/configure.ac cracklib-2.9.7/configure.ac
+--- cracklib-2.9.7.orig/configure.ac	2019-03-03 17:49:19.000000000 +0000
++++ cracklib-2.9.7/configure.ac	2022-02-26 23:30:53.361504964 +0000
+@@ -72,7 +72,7 @@
+ AC_HELP_STRING(--without-python,[Build a python module @<:@default=auto@:>@]),
+ build_python=$withval,build_python=auto)
+ if test "$build_python" != no ; then
+-   AM_PATH_PYTHON(,,
++   AM_PATH_PYTHON([3],,
+                   [if test "$build_python" != yes ; then
+                       AC_MSG_WARN([python was not found, continuing])
+                       build_python=no
+Common subdirectories: cracklib-2.9.7.orig/dicts and cracklib-2.9.7/dicts
+Common subdirectories: cracklib-2.9.7.orig/doc and cracklib-2.9.7/doc
+Common subdirectories: cracklib-2.9.7.orig/lib and cracklib-2.9.7/lib
+Common subdirectories: cracklib-2.9.7.orig/m4 and cracklib-2.9.7/m4
+Common subdirectories: cracklib-2.9.7.orig/po and cracklib-2.9.7/po
+Common subdirectories: cracklib-2.9.7.orig/python and cracklib-2.9.7/python
+Common subdirectories: cracklib-2.9.7.orig/util and cracklib-2.9.7/util
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cracklib.git/commitdiff/3c736fab931dca346ef39a23c9dfd1431d43a1da



More information about the pld-cvs-commit mailing list