summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@redhat.com>2014-08-06 16:44:48 +0200
committerTomas Mraz <tmraz@redhat.com>2014-08-06 16:44:48 +0200
commit9e63ee6bc3bb2e09e512479199e108202721cc75 (patch)
treef2d08cb7e76ee7d75747967a65992f934bc25709
parenta95e7dc723b470583e62ad6b387e866a94040b1e (diff)
downloadlibpwquality-9e63ee6bc3bb2e09e512479199e108202721cc75.tar.gz
Add the python3 subpackage.
-rw-r--r--NEWS3
-rw-r--r--configure.ac11
-rw-r--r--libpwquality.spec.in39
-rw-r--r--python/Makefile.am9
4 files changed, 53 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index f6f66db..6e9e16e 100644
--- a/NEWS
+++ b/NEWS
@@ -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 --git a/configure.ac b/configure.ac
index d5b3fb3..60ae31b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,11 +123,16 @@ AC_ARG_ENABLE([python-bindings],
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_SUBST(PYTHONREV)
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 --git a/libpwquality.spec.in b/libpwquality.spec.in
index fc4e7f7..f72e04e 100644
--- a/libpwquality.spec.in
+++ b/libpwquality.spec.in
@@ -18,11 +18,12 @@ BuildRequires: cracklib-devel
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 the libpwquality library. These bindings can be used
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 @@ rm -f $RPM_BUILD_ROOT%{_moduledir}/*.la
%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@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@redhat.com> 1.2.3-1
diff --git a/python/Makefile.am b/python/Makefile.am
index d32b2f3..abc5cd3 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -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}