]> git.pld-linux.org Git - packages/cracklib.git/commitdiff
- only python 2 or 3 stuff can be built, not both, prefer python 3
authorMarcin Krol <hawk@tld-linux.org>
Sat, 26 Feb 2022 23:43:10 +0000 (23:43 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Sat, 26 Feb 2022 23:43:10 +0000 (23:43 +0000)
cracklib-python3.patch [new file with mode: 0644]
cracklib.spec

diff --git a/cracklib-python3.patch b/cracklib-python3.patch
new file mode 100644 (file)
index 0000000..7c7a08d
--- /dev/null
@@ -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
index 17f0217e4c6e32561b4792e8bc40e9c765b0de39..38088769a0eefa8620ec38bade1edcfdc62c5efb 100644 (file)
@@ -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
This page took 0.080352 seconds and 4 git commands to generate.