/srv/hg/libpwquality: Add the python3 subpackage.
by admin@fedoraproject.org
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}
9 years, 8 months
/srv/hg/libpwquality: 3 new changesets
by admin@fedoraproject.org
changeset 45d57c553bc8 in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=45d5...
summary: Added tag libpwquality-1.2.4 for changeset a2155b2f7633
changeset 1159779d1733 in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=1159...
summary: Backing out unnecessary change.
changeset d07ff25946ce in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=d07f...
summary: Backing out unnecessary change.
diffstat:
.hgtags | 1 +
src/check.c | 7 -------
2 files changed, 1 insertions(+), 7 deletions(-)
diffs (25 lines):
diff -r a2155b2f7633 -r d07ff25946ce .hgtags
--- a/.hgtags Wed Aug 06 15:05:52 2014 +0200
+++ b/.hgtags Wed Aug 06 15:16:05 2014 +0200
@@ -11,3 +11,4 @@
e5ff4472b3cd8dd15dcd681af44e1fd6dcc7c739 libpwquality-1.2.3
e5ff4472b3cd8dd15dcd681af44e1fd6dcc7c739 libpwquality-1.2.3
a97c63e34e79a0b98caae4bd041fb473dcc5f3c9 libpwquality-1.2.3
+a2155b2f7633870edf57306bbad898c57ad2bff1 libpwquality-1.2.4
diff -r a2155b2f7633 -r d07ff25946ce src/check.c
--- a/src/check.c Wed Aug 06 15:05:52 2014 +0200
+++ b/src/check.c Wed Aug 06 15:16:05 2014 +0200
@@ -503,13 +503,6 @@
char *oldmono = NULL, *newmono, *wrapped = NULL;
char *usermono = NULL;
- /* Sanitize the old and user values */
- if (old && *old == '\0')
- old = NULL;
-
- if (user && *user == '\0')
- user = NULL;
-
newmono = str_lower(x_strdup(new));
if (!newmono)
rv = PWQ_ERROR_MEM_ALLOC;
9 years, 8 months
/srv/hg/libpwquality: fix license handling (by Tom Callaway)
by admin@fedoraproject.org
changeset a2155b2f7633 in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=a215...
summary: fix license handling (by Tom Callaway)
diffstat:
libpwquality.spec.in | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (26 lines):
diff -r 4d7a726a9c31 -r a2155b2f7633 libpwquality.spec.in
--- a/libpwquality.spec.in Wed Aug 06 14:57:14 2014 +0200
+++ b/libpwquality.spec.in Wed Aug 06 15:05:52 2014 +0200
@@ -86,7 +86,9 @@
%files -f libpwquality.lang
%defattr(-,root,root,-)
-%doc COPYING README NEWS AUTHORS
+%{!?_licensedir:%global license %%doc}
+%license COPYING
+%doc README NEWS AUTHORS
%{_bindir}/pwmake
%{_bindir}/pwscore
%{_moduledir}/pam_pwquality.so
@@ -107,6 +109,11 @@
%{python_sitearch}/pwquality.so
%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
- fix problem with parsing the pam_pwquality options
patch by Vladimir Sorokin.
9 years, 8 months
/srv/hg/libpwquality: Oops... a typo.
by admin@fedoraproject.org
changeset 4d7a726a9c31 in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=4d7a...
summary: Oops... a typo.
diffstat:
src/check.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (16 lines):
diff -r bf0b0d15575b -r 4d7a726a9c31 src/check.c
--- a/src/check.c Wed Aug 06 14:56:37 2014 +0200
+++ b/src/check.c Wed Aug 06 14:57:14 2014 +0200
@@ -504,10 +504,10 @@
char *usermono = NULL;
/* Sanitize the old and user values */
- if (old && *old = '\0')
+ if (old && *old == '\0')
old = NULL;
- if (user && *user = '\0')
+ if (user && *user == '\0')
user = NULL;
newmono = str_lower(x_strdup(new));
9 years, 8 months
/srv/hg/libpwquality: Sanitize the old and user values before th...
by admin@fedoraproject.org
changeset bf0b0d15575b in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=bf0b...
summary: Sanitize the old and user values before the check.
diffstat:
src/check.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (17 lines):
diff -r 962b02c76a19 -r bf0b0d15575b src/check.c
--- a/src/check.c Wed Aug 06 14:48:57 2014 +0200
+++ b/src/check.c Wed Aug 06 14:56:37 2014 +0200
@@ -503,6 +503,13 @@
char *oldmono = NULL, *newmono, *wrapped = NULL;
char *usermono = NULL;
+ /* Sanitize the old and user values */
+ if (old && *old = '\0')
+ old = NULL;
+
+ if (user && *user = '\0')
+ user = NULL;
+
newmono = str_lower(x_strdup(new));
if (!newmono)
rv = PWQ_ERROR_MEM_ALLOC;
9 years, 8 months
/srv/hg/libpwquality: Preparing release 1.2.4.
by admin@fedoraproject.org
changeset 962b02c76a19 in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=962b...
summary: Preparing release 1.2.4.
diffstat:
AUTHORS | 4 +
ChangeLog | 12 +++
configure.ac | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.in | 163 ----------------------------------------------------
po/ChangeLog | 5 +
python/pwquality.c | 4 +-
python/setup.py | 72 -----------------------
python/setup.py.in | 72 +++++++++++++++++++++++
8 files changed, 259 insertions(+), 237 deletions(-)
diffs (543 lines):
diff -r cd3ed1aaa98c -r 962b02c76a19 AUTHORS
--- a/AUTHORS Wed Aug 06 14:29:33 2014 +0200
+++ b/AUTHORS Wed Aug 06 14:48:57 2014 +0200
@@ -8,3 +8,7 @@
Authors of the pwquality library:
Tomáš Mráz <tm(a)t8m.info>
+
+Python3 port of the python module:
+
+Bohuslav Kabrda <bkabrda(a)redhat.com>
diff -r cd3ed1aaa98c -r 962b02c76a19 ChangeLog
--- a/ChangeLog Wed Aug 06 14:29:33 2014 +0200
+++ b/ChangeLog Wed Aug 06 14:48:57 2014 +0200
@@ -1,3 +1,15 @@
+2014-08-06 gettextize <bug-gnu-gettext(a)gnu.org>
+
+ * m4/gettext.m4: Upgrade to gettext-0.18.2.
+ * m4/iconv.m4: Upgrade to gettext-0.18.2.
+ * m4/lib-ld.m4: Upgrade to gettext-0.18.2.
+ * m4/lib-link.m4: Upgrade to gettext-0.18.2.
+ * m4/lib-prefix.m4: Upgrade to gettext-0.18.2.
+ * m4/nls.m4: Upgrade to gettext-0.18.2.
+ * m4/po.m4: Upgrade to gettext-0.18.2.
+ * m4/progtest.m4: Upgrade to gettext-0.18.2.
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.18.2.
+
2011-09-16 gettextize <bug-gnu-gettext(a)gnu.org>
* m4/gettext.m4: New file, from gettext-0.18.1.
diff -r cd3ed1aaa98c -r 962b02c76a19 configure.ac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/configure.ac Wed Aug 06 14:48:57 2014 +0200
@@ -0,0 +1,164 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT([libpwquality], [1.2.4])
+AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip -Wall])
+AC_PREREQ(2.61)
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_HOST
+
+dnl We don't build with srcdir != builddir at present; the Python
+dnl bindings fail
+echo \#buildapi-variable-no-builddir > /dev/null
+
+dnl LT Version numbers, remember to change them *before* a release.
+dnl (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
+dnl (Interfaces added: CURRENT++, AGE++, REVISION=0)
+dnl (No interfaces changed: REVISION++)
+PWQUALITY_LT_CURRENT=1
+PWQUALITY_LT_AGE=0
+PWQUALITY_LT_REVISION=2
+
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_SUBST(PWQUALITY_LT_CURRENT)
+AC_SUBST(PWQUALITY_LT_AGE)
+AC_SUBST(PWQUALITY_LT_REVISION)
+
+dnl Checks for programs.
+AC_USE_SYSTEM_EXTENSIONS
+AM_PROG_AR
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_LIBTOOL
+
+dnl and some hacks to use /etc
+test "${prefix}" = "NONE" && prefix="/usr"
+if test ${prefix} = '/usr'
+then
+dnl If we use /usr as prefix, use /etc for config files
+ if test ${sysconfdir} = '${prefix}/etc'
+ then
+ sysconfdir="/etc"
+ fi
+dnl If we use /usr as prefix, use /usr/share/man for manual pages
+ if test ${mandir} = '${prefix}/man'
+ then
+ mandir='${prefix}/share/man'
+ fi
+fi
+
+dnl Localization support
+AM_GNU_GETTEXT_VERSION([0.18.2])
+AM_GNU_GETTEXT([external])
+AH_BOTTOM([#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(msgid) dgettext(PACKAGE, msgid)
+#define N_(msgid) msgid
+#else
+#define _(msgid) (msgid)
+#define N_(msgid) msgid
+#endif /* ENABLE_NLS */])
+
+dnl Library version scripts
+
+dnl For some systems we know that we have ld_version scripts.
+dnl Use it then as default.
+have_ld_version_script=no
+case "${host}" in
+ *-*-linux*)
+ have_ld_version_script=yes
+ ;;
+ *-*-gnu*)
+ have_ld_version_script=yes
+ ;;
+esac
+
+AC_ARG_ENABLE([ld-version-script],
+ AC_HELP_STRING([--enable-ld-version-script],
+ [enable/disable use of linker version script.
+ (default is system dependent)]),
+ [have_ld_version_script=$enableval],
+ [ : ] )
+AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+
+dnl PAM support
+PAM_LIBS=
+AC_ARG_ENABLE([pam],
+ AS_HELP_STRING([--enable-pam],[build PAM module @<:@default=check@:>@]),
+ [],
+ [enable_pam=check])
+if test "$enable_pam" != "no"; then
+ if test "$enable_pam" = "check"; then
+ AC_CHECK_LIB([pam], [pam_start], [enable_pam=yes], [enable_pam=no])
+ else
+ fail=0
+ AC_CHECK_LIB([pam], [pam_start], [], [fail=1])
+ test $fail = 1 &&
+ AC_MSG_ERROR([You must install the PAM development package in order to compile libpwquality])
+ fi
+fi
+
+if test "$enable_pam" = "yes"; then
+ PAM_LIBS="${PAM_LIBS} -lpam"
+fi
+AC_SUBST(PAM_LIBS)
+AM_CONDITIONAL(HAVE_PAM, test "$enable_pam" = "yes")
+
+dnl options and defaults
+AC_ARG_WITH(securedir,
+ AS_HELP_STRING([--with-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
+ SECUREDIR=$withval, SECUREDIR=$libdir/security)
+AC_SUBST(SECUREDIR)
+
+AC_ARG_WITH(sconfigdir,
+ AS_HELP_STRING([--with-sconfigdir=DIR],[path to PAM conf files @<:@default=$sysconfdir/security@:>@]),
+ SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
+AC_SUBST(SCONFIGDIR)
+
+AC_ARG_ENABLE([python-bindings],
+ AC_HELP_STRING([--enable-python-bindings],
+ [enable Python bindings (default: yes)]),
+ [enable_python_bindings=$enableval],
+ enable_python_bindings=yes)
+AM_CONDITIONAL(BUILD_PYTHON_BINDINGS, test x"$enable_python_bindings" = xyes)
+
+AC_ARG_WITH(python-rev,
+ [ --with-pythonrev=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])'`]
+ AC_MSG_RESULT($PYTHONREV)
+ ])
+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])
+ [PYTHONSITEDIR=$libdir/python$PYTHONREV/site-packages]
+ AC_MSG_RESULT($PYTHONSITEDIR)
+ ])
+AC_SUBST(PYTHONSITEDIR)
+
+AC_ARG_WITH([randomdev], AS_HELP_STRING([--with-randomdev=(<path>|yes)],[use specified random device instead of /dev/urandom]), opt_randomdev=$withval)
+if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then
+ opt_randomdev="/dev/urandom"
+fi
+AC_DEFINE_UNQUOTED(CONF_PATH_RANDOMDEV, "$opt_randomdev", [Random device path.])
+
+dnl Check for cracklib
+AC_CHECK_HEADERS([crack.h],
+ AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
+if test x$LIBCRACK = x ; then
+ AC_MSG_ERROR([No or unusable cracklib library])
+fi
+AC_SUBST([LIBCRACK])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_BIGENDIAN
+
+dnl Files to be created from when we run configure
+AC_CONFIG_FILES([Makefile libpwquality.spec src/Makefile src/pwquality.pc po/Makefile.in python/Makefile
+ doc/Makefile doc/man/Makefile python/setup.py])
+AC_OUTPUT
diff -r cd3ed1aaa98c -r 962b02c76a19 configure.in
--- a/configure.in Wed Aug 06 14:29:33 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT([libpwquality], [1.2.3])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip -Wall])
-AC_PREREQ(2.61)
-AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_HOST
-
-dnl We don't build with srcdir != builddir at present; the Python
-dnl bindings fail
-echo \#buildapi-variable-no-builddir > /dev/null
-
-dnl LT Version numbers, remember to change them *before* a release.
-dnl (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
-dnl (Interfaces added: CURRENT++, AGE++, REVISION=0)
-dnl (No interfaces changed: REVISION++)
-PWQUALITY_LT_CURRENT=1
-PWQUALITY_LT_AGE=0
-PWQUALITY_LT_REVISION=2
-
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-AC_SUBST(PWQUALITY_LT_CURRENT)
-AC_SUBST(PWQUALITY_LT_AGE)
-AC_SUBST(PWQUALITY_LT_REVISION)
-
-dnl Checks for programs.
-AC_USE_SYSTEM_EXTENSIONS
-AC_PROG_CC
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_LIBTOOL
-
-dnl and some hacks to use /etc
-test "${prefix}" = "NONE" && prefix="/usr"
-if test ${prefix} = '/usr'
-then
-dnl If we use /usr as prefix, use /etc for config files
- if test ${sysconfdir} = '${prefix}/etc'
- then
- sysconfdir="/etc"
- fi
-dnl If we use /usr as prefix, use /usr/share/man for manual pages
- if test ${mandir} = '${prefix}/man'
- then
- mandir='${prefix}/share/man'
- fi
-fi
-
-dnl Localization support
-AM_GNU_GETTEXT_VERSION([0.15])
-AM_GNU_GETTEXT([external])
-AH_BOTTOM([#ifdef ENABLE_NLS
-#include <libintl.h>
-#define _(msgid) dgettext(PACKAGE, msgid)
-#define N_(msgid) msgid
-#else
-#define _(msgid) (msgid)
-#define N_(msgid) msgid
-#endif /* ENABLE_NLS */])
-
-dnl Library version scripts
-
-dnl For some systems we know that we have ld_version scripts.
-dnl Use it then as default.
-have_ld_version_script=no
-case "${host}" in
- *-*-linux*)
- have_ld_version_script=yes
- ;;
- *-*-gnu*)
- have_ld_version_script=yes
- ;;
-esac
-
-AC_ARG_ENABLE([ld-version-script],
- AC_HELP_STRING([--enable-ld-version-script],
- [enable/disable use of linker version script.
- (default is system dependent)]),
- [have_ld_version_script=$enableval],
- [ : ] )
-AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
-
-dnl PAM support
-PAM_LIBS=
-AC_ARG_ENABLE([pam],
- AS_HELP_STRING([--enable-pam],[build PAM module @<:@default=check@:>@]),
- [],
- [enable_pam=check])
-if test "$enable_pam" != "no"; then
- if test "$enable_pam" = "check"; then
- AC_CHECK_LIB([pam], [pam_start], [enable_pam=yes], [enable_pam=no])
- else
- fail=0
- AC_CHECK_LIB([pam], [pam_start], [], [fail=1])
- test $fail = 1 &&
- AC_MSG_ERROR([You must install the PAM development package in order to compile libpwquality])
- fi
-fi
-
-if test "$enable_pam" = "yes"; then
- PAM_LIBS="${PAM_LIBS} -lpam"
-fi
-AC_SUBST(PAM_LIBS)
-AM_CONDITIONAL(HAVE_PAM, test "$enable_pam" = "yes")
-
-dnl options and defaults
-AC_ARG_WITH(securedir,
- AS_HELP_STRING([--with-securedir=DIR],[path to location of PAMs @<:@default=$libdir/security@:>@]),
- SECUREDIR=$withval, SECUREDIR=$libdir/security)
-AC_SUBST(SECUREDIR)
-
-AC_ARG_WITH(sconfigdir,
- AS_HELP_STRING([--with-sconfigdir=DIR],[path to PAM conf files @<:@default=$sysconfdir/security@:>@]),
- SCONFIGDIR=$enableval, SCONFIGDIR=$sysconfdir/security)
-AC_SUBST(SCONFIGDIR)
-
-AC_ARG_ENABLE([python-bindings],
- AC_HELP_STRING([--enable-python-bindings],
- [enable Python bindings (default: yes)]),
- [enable_python_bindings=$enableval],
- enable_python_bindings=yes)
-AM_CONDITIONAL(BUILD_PYTHON_BINDINGS, test x"$enable_python_bindings" = xyes)
-
-AC_ARG_WITH(python-rev,
- [ --with-pythonrev=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])'`]
- AC_MSG_RESULT($PYTHONREV)
- ])
-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])
- [PYTHONSITEDIR=$libdir/python$PYTHONREV/site-packages]
- AC_MSG_RESULT($PYTHONSITEDIR)
- ])
-AC_SUBST(PYTHONSITEDIR)
-
-AC_ARG_WITH([randomdev], AS_HELP_STRING([--with-randomdev=(<path>|yes)],[use specified random device instead of /dev/urandom]), opt_randomdev=$withval)
-if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then
- opt_randomdev="/dev/urandom"
-fi
-AC_DEFINE_UNQUOTED(CONF_PATH_RANDOMDEV, "$opt_randomdev", [Random device path.])
-
-dnl Check for cracklib
-AC_CHECK_HEADERS([crack.h],
- AC_CHECK_LIB([crack], [FascistCheck], LIBCRACK="-lcrack", LIBCRACK=""))
-if test x$LIBCRACK = x ; then
- AC_MSG_ERROR([No or unusable cracklib library])
-fi
-AC_SUBST([LIBCRACK])
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_BIGENDIAN
-
-dnl Files to be created from when we run configure
-AC_CONFIG_FILES([Makefile libpwquality.spec src/Makefile src/pwquality.pc po/Makefile.in python/Makefile
- doc/Makefile doc/man/Makefile])
-AC_OUTPUT
diff -r cd3ed1aaa98c -r 962b02c76a19 po/ChangeLog
--- a/po/ChangeLog Wed Aug 06 14:29:33 2014 +0200
+++ b/po/ChangeLog Wed Aug 06 14:48:57 2014 +0200
@@ -1,3 +1,8 @@
+2014-08-06 gettextize <bug-gnu-gettext(a)gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.18.2.
+ * Rules-quot: Upgrade to gettext-0.18.2.
+
2011-09-16 gettextize <bug-gnu-gettext(a)gnu.org>
* Makefile.in.in: Upgrade to gettext-0.18.1.
diff -r cd3ed1aaa98c -r 962b02c76a19 python/pwquality.c
--- a/python/pwquality.c Wed Aug 06 14:29:33 2014 +0200
+++ b/python/pwquality.c Wed Aug 06 14:48:57 2014 +0200
@@ -1,8 +1,8 @@
/*
* libpwquality Python bindings
*
- * Copyright (c) Red Hat, Inc, 2011
- * Copyright (c) Tomas Mraz <tm(a)t8m.info>, 2011
+ * Copyright (c) Red Hat, Inc, 2011,2014
+ * Copyright (c) Tomas Mraz <tm(a)t8m.info>, 2011,2014
*
* See the end of the file for the License Information
*/
diff -r cd3ed1aaa98c -r 962b02c76a19 python/setup.py
--- a/python/setup.py Wed Aug 06 14:29:33 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# See the end of the file for Copyright and License Information
-#
-
-from distutils.core import setup, Extension
-from distutils.command.build_ext import build_ext as _build_ext
-
-class build_ext(_build_ext):
- def genconstants(self, headerfile, outputfile):
- hf = open(headerfile, 'r')
- of = open(outputfile, 'w')
- of.write('/* This file is generated during build time from pwquality.h */\n\n')
- for line in hf:
- if line.startswith('#define PWQ_'):
- s = line.split()
- of.write('PyModule_AddIntConstant(module, "%s", %s);\n' % (s[1], s[2]))
-
- def run(self):
- self.genconstants('../src/pwquality.h', 'constants.c')
- _build_ext.run(self)
-
-pwqmodule = Extension('pwquality',
- sources = ['pwquality.c'],
- include_dirs = ['../src'],
- library_dirs = ['../src/.libs'],
- libraries = ['pwquality'])
-
-setup(
- name = 'pwquality',
- version = '0.9.1',
- description = 'Python bindings for the libpwquality library for password quality checking',
- author = 'Tomáš Mráz',
- author_email = 'tm(a)t8m.info',
- url = 'http://fedorahosted.org/libpwquality',
- license = 'BSD or GPLv2+',
- ext_modules = [pwqmodule],
- cmdclass = {'build_ext': build_ext}
-)
-
-# Copyright (c) Red Hat, Inc, 2011
-# Copyright (c) Tomas Mraz <tm(a)t8m.info>, 2011
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, and the entire permission notice in its entirety,
-# including the disclaimer of warranties.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. The name of the author may not be used to endorse or promote
-# products derived from this software without specific prior
-# written permission.
-#
-# ALTERNATIVELY, this product may be distributed under the terms of
-# the GNU General Public License version 2 or later, in which case the
-# provisions of the GPL are required INSTEAD OF the above restrictions.
-#
-# THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-# OF THE POSSIBILITY OF SUCH DAMAGE.
diff -r cd3ed1aaa98c -r 962b02c76a19 python/setup.py.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/python/setup.py.in Wed Aug 06 14:48:57 2014 +0200
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# See the end of the file for Copyright and License Information
+#
+
+from distutils.core import setup, Extension
+from distutils.command.build_ext import build_ext as _build_ext
+
+class build_ext(_build_ext):
+ def genconstants(self, headerfile, outputfile):
+ hf = open(headerfile, 'r')
+ of = open(outputfile, 'w')
+ of.write('/* This file is generated during build time from pwquality.h */\n\n')
+ for line in hf:
+ if line.startswith('#define PWQ_'):
+ s = line.split()
+ of.write('PyModule_AddIntConstant(module, "%s", %s);\n' % (s[1], s[2]))
+
+ def run(self):
+ self.genconstants('../src/pwquality.h', 'constants.c')
+ _build_ext.run(self)
+
+pwqmodule = Extension('pwquality',
+ sources = ['pwquality.c'],
+ include_dirs = ['../src'],
+ library_dirs = ['../src/.libs'],
+ libraries = ['pwquality'])
+
+setup(
+ name = 'pwquality',
+ version = '@VERSION@',
+ description = 'Python bindings for the libpwquality library for password quality checking',
+ author = 'Tomáš Mráz',
+ author_email = 'tm(a)t8m.info',
+ url = 'http://fedorahosted.org/libpwquality',
+ license = 'BSD or GPLv2+',
+ ext_modules = [pwqmodule],
+ cmdclass = {'build_ext': build_ext}
+)
+
+# Copyright (c) Red Hat, Inc, 2011
+# Copyright (c) Tomas Mraz <tm(a)t8m.info>, 2011
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, and the entire permission notice in its entirety,
+# including the disclaimer of warranties.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote
+# products derived from this software without specific prior
+# written permission.
+#
+# ALTERNATIVELY, this product may be distributed under the terms of
+# the GNU General Public License version 2 or later, in which case the
+# provisions of the GPL are required INSTEAD OF the above restrictions.
+#
+# THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+# OF THE POSSIBILITY OF SUCH DAMAGE.
9 years, 8 months
/srv/hg/libpwquality: Add support for python3.
by admin@fedoraproject.org
changeset cd3ed1aaa98c in /srv/hg/libpwquality
details: http://hg.fedorahosted.org/hg/srv/hg/libpwquality?cmd=changeset;node=cd3e...
summary: Add support for python3.
diffstat:
python/pwquality.c | 83 +++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 70 insertions(+), 13 deletions(-)
diffs (178 lines):
diff -r 47ad324eaeb9 -r cd3ed1aaa98c python/pwquality.c
--- a/python/pwquality.c Thu Mar 13 10:57:07 2014 +0100
+++ b/python/pwquality.c Wed Aug 06 14:29:33 2014 +0200
@@ -10,6 +10,15 @@
#include <Python.h>
#include "pwquality.h"
+#if PY_MAJOR_VERSION >= 3
+#define IS_PY3K
+#define PWQLong_FromLong PyLong_FromLong
+#define PWQLong_AsLong PyLong_AsLong
+#else
+#define PWQLong_FromLong PyInt_FromLong
+#define PWQLong_AsLong PyInt_AsLong
+#endif
+
static PyObject *PWQError;
typedef struct {
@@ -132,8 +141,7 @@
static PyTypeObject pwqsettings_type = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(NULL, 0)
"pwquality.PWQSettings", /* tp_name */
sizeof(PWQSettings), /* tp_basicsize */
0, /* tp_itemsize */
@@ -223,7 +231,7 @@
pwqsettings_dealloc(PWQSettings *self)
{
pwquality_free_settings(self->pwq);
- self->ob_type->tp_free((PyObject *)self);
+ Py_TYPE(self)->tp_free((PyObject *)self);
}
static PyObject *
@@ -235,7 +243,7 @@
if ((rc = pwquality_get_int_value(self->pwq, (int)(ssize_t)setting, &value)) < 0) {
return pwqerror(rc, NULL);
}
- return PyInt_FromLong((long)value);
+ return PWQLong_FromLong((long)value);
}
static int
@@ -244,7 +252,7 @@
long l;
int rc;
- l = PyInt_AsLong(value);
+ l = PWQLong_AsLong(value);
if (PyErr_Occurred() == NULL) {
if ((rc = pwquality_set_int_value(self->pwq,
(int)(ssize_t)setting, (int)l)) < 0) {
@@ -269,19 +277,36 @@
Py_INCREF(Py_None);
return Py_None;
}
+#ifdef IS_PY3K
+ return PyUnicode_FromString(value);
+#else
return PyString_FromString(value);
+#endif
}
static int
pwqsettings_setstr(PWQSettings *self, PyObject *value, void *setting)
{
- const char *s;
+ const char *s = NULL;
int rc;
- if (value == (PyObject *)Py_None)
- s = NULL;
- else
+ if (value != (PyObject *)Py_None) {
+#ifdef IS_PY3K
+ if (PyUnicode_Check(value)) {
+ PyObject *value_as_bytes = PyUnicode_AsUTF8String(value);
+ if (!value_as_bytes)
+ return -1;
+ s = PyBytes_AsString(value_as_bytes);
+ Py_DECREF(value_as_bytes);
+ if (!s)
+ return -1;
+ } else {
+ PyErr_SetString(PyExc_TypeError, "expected unicode string");
+ }
+#else
s = PyString_AsString(value);
+#endif
+ }
if (PyErr_Occurred() == NULL) {
if ((rc = pwquality_set_str_value(self->pwq,
@@ -339,7 +364,11 @@
return pwqerror(rc, NULL);
}
+#ifdef IS_PY3K
+ passobj = PyUnicode_FromString(password);
+#else
passobj = PyString_FromString(password);
+#endif
free(password);
return passobj;
}
@@ -360,21 +389,46 @@
return pwqerror(rc, auxerror);
}
- return PyInt_FromLong((long)rc);
+ return PWQLong_FromLong((long)rc);
}
+#ifdef IS_PY3K
+static struct PyModuleDef pwqualitydef = {
+ PyModuleDef_HEAD_INIT,
+ "pwquality",
+ "Libpwquality wrapper module",
+ -1,
+ pwquality_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+};
+
+#define INITERROR return NULL
+
+PyObject *
+PyInit_pwquality(void)
+#else
+#define INITERROR return
+
PyMODINIT_FUNC
initpwquality(void)
+#endif
{
PyObject *module;
if (PyType_Ready(&pwqsettings_type) < 0)
- return;
+ INITERROR;
+#ifdef IS_PY3K
+ module = PyModule_Create(&pwqualitydef);
+#else
module = Py_InitModule3("pwquality", pwquality_methods,
"Libpwquality wrapper module");
+#endif
if (module == NULL)
- return;
+ INITERROR;
PWQError = PyErr_NewExceptionWithDoc("pwquality.PWQError",
"Standard exception thrown from PWQSettings method calls\n\n"
@@ -382,7 +436,7 @@
NULL, NULL);
if (PWQError == NULL) {
Py_DECREF(module);
- return;
+ INITERROR;
}
Py_INCREF(PWQError);
PyModule_AddObject(module, "PWQError", PWQError);
@@ -391,6 +445,9 @@
PyModule_AddObject(module, "PWQSettings", (PyObject *)&pwqsettings_type);
#include "constants.c"
+#ifdef IS_PY3K
+ return module;
+#endif
}
/*
9 years, 8 months