changeset c0003f0ccea1 in /srv/hg/libpwquality
details:
http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=c000...
summary: Add the python3 subpackage.
diffstat:
NEWS | 3 +++
configure.ac | 11 ++++++++---
libpwquality.spec.in | 39 +++++++++++++++++++++++++++++++++++++--
python/Makefile.am | 9 +++++----
4 files changed, 53 insertions(+), 9 deletions(-)
diffs (148 lines):
diff -r d07ff25946ce -r c0003f0ccea1 NEWS
--- a/NEWS Wed Aug 06 15:16:05 2014 +0200
+++ b/NEWS Wed Aug 06 16:44:48 2014 +0200
@@ -1,5 +1,8 @@
libpwquality NEWS -- history of user-visible changes.
+Release 1.2.4
+* Add Python3 module subpackage
+
Release 1.2.3
* Fix problem with parsing the pam_pwquality options
patch by Vladimir Sorokin.
diff -r d07ff25946ce -r c0003f0ccea1 configure.ac
--- a/configure.ac Wed Aug 06 15:16:05 2014 +0200
+++ b/configure.ac Wed Aug 06 16:44:48 2014 +0200
@@ -123,11 +123,16 @@
enable_python_bindings=yes)
AM_CONDITIONAL(BUILD_PYTHON_BINDINGS, test x"$enable_python_bindings" = xyes)
+AC_ARG_WITH(python-binary,
+ [ --with-python-binary=python3 python binary name with which modules
should be built],
+ PYTHONBINARY=$withval, [PYTHONBINARY=python])
+AC_SUBST(PYTHONBINARY)
+
AC_ARG_WITH(python-rev,
- [ --with-pythonrev=2.7 version of python for which modules should be
built],
+ [ --with-python-rev=2.7 version of python for which modules should be
built],
PYTHONREV=$withval,[
AC_MSG_CHECKING([python version])
- [PYTHONREV=`python -c 'import sys;print "%s.%s" %
(sys.version_info[0], sys.version_info[1])'`]
+ [PYTHONREV=`$PYTHONBINARY -c "import
sys;sys.stdout.write('%s.%s' % (sys.version_info[0],
sys.version_info[1]))"`]
AC_MSG_RESULT($PYTHONREV)
])
AC_SUBST(PYTHONREV)
@@ -135,7 +140,7 @@
AC_ARG_WITH(pythonsitedir,
[ --with-pythonsitedir=DIR directory of the python site packages
@<:@default=$libdir/python$PYTHONREV/site-packages@:>@],
PYTHONSITEDIR=$withval,[
- AC_MSG_CHECKING([python version])
+ AC_MSG_CHECKING([python site directory])
[PYTHONSITEDIR=$libdir/python$PYTHONREV/site-packages]
AC_MSG_RESULT($PYTHONSITEDIR)
])
diff -r d07ff25946ce -r c0003f0ccea1 libpwquality.spec.in
--- a/libpwquality.spec.in Wed Aug 06 15:16:05 2014 +0200
+++ b/libpwquality.spec.in Wed Aug 06 16:44:48 2014 +0200
@@ -18,11 +18,12 @@
BuildRequires: gettext
BuildRequires: pam-devel
BuildRequires: python2-devel
+BuildRequires: python3-devel
URL:
http://libpwquality.fedorahosted.org/
# we don't want to provide private python extension libs
-%define __provides_exclude_from ^%{python_sitearch}/.*\.so$.
+%define __provides_exclude_from ^(%{python_sitearch}|%{python3_sitearch})/.*\.so$.
%description
This is a library for password quality checks and generation
@@ -52,20 +53,49 @@
for easy password quality checking and generation of random
pronounceable passwords from Python applications.
+%package -n python3-pwquality
+Group: Development/Libraries
+Summary: Python bindings for the libpwquality library
+Requires: libpwquality%{?_isa} = %{version}-%{release}
+
+%description -n python3-pwquality
+This is pwquality Python module that provides Python bindings
+for the libpwquality library. These bindings can be used
+for easy password quality checking and generation of random
+pronounceable passwords from Python applications.
+
%prep
%setup -q
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+
%build
%configure \
--with-securedir=%{_moduledir} \
--with-pythonsitedir=%{python_sitearch} \
+ --with-python-binary=%{__python2} \
--disable-static
make %{?_smp_mflags}
+pushd %{py3dir}
+%configure \
+ --with-securedir=%{_moduledir} \
+ --with-pythonsitedir=%{python3_sitearch} \
+ --with-python-binary=%{__python3} \
+ --disable-static
+
+make %{?_smp_mflags}
+popd
+
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
+pushd %{py3dir}
+make -C python install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
+popd
+
%if "%{_pwqlibdir}" != "%{_libdir}"
pushd $RPM_BUILD_ROOT%{_libdir}
mv libpwquality.so.* $RPM_BUILD_ROOT%{_pwqlibdir}
@@ -107,11 +137,16 @@
%files -n python-pwquality
%defattr(-,root,root,-)
%{python_sitearch}/pwquality.so
+%{python_sitearch}/*.egg-info
+
+%files -n python3-pwquality
+%defattr(-,root,root,-)
+%{python3_sitearch}/*.so
+%{python3_sitearch}/*.egg-info
%changelog
* Wed Aug 6 2014 Tomáš Mráz <tmraz(a)redhat.com> 1.2.4-1
- fix license handling (by Tom Callaway)
-- fix handling of empty user or old password in check
- add Python3 module subpackage
* Thu Sep 12 2013 Tomáš Mráz <tmraz(a)redhat.com> 1.2.3-1
diff -r d07ff25946ce -r c0003f0ccea1 python/Makefile.am
--- a/python/Makefile.am Wed Aug 06 15:16:05 2014 +0200
+++ b/python/Makefile.am Wed Aug 06 16:44:48 2014 +0200
@@ -6,11 +6,12 @@
pythonincdir = $(includedir)/python@PYTHONREV@
pythonsitedir = @PYTHONSITEDIR@
-CLEANFILES = *~ constants.c pwquality.so
+CLEANFILES = *~ constants.c *.so
EXTRA_DIST = pwquality.c setup.py
-pythonsite_SCRIPTS = pwquality.so
+all-local:
+ CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build
--build-lib=.
-pwquality.so: ../src/pwquality.h pwquality.c setup.py
- CFLAGS="${CFLAGS} -fno-strict-aliasing" python setup.py build --build-lib=.
+install-exec-local:
+ CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py install
--prefix=${DESTDIR}${prefix}