From 396c9d6c0628d5927b2ca697134b25e6e5012ce1 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 6 Aug 2014 14:48:57 +0200 Subject: Preparing release 1.2.4. --- 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(-) create mode 100644 configure.ac delete mode 100644 configure.in delete mode 100755 python/setup.py create mode 100755 python/setup.py.in diff --git a/AUTHORS b/AUTHORS index 9a4c51e..bf0585c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,3 +8,7 @@ Philip W. Dalrymple Authors of the pwquality library: Tomáš Mráz + +Python3 port of the python module: + +Bohuslav Kabrda diff --git a/ChangeLog b/ChangeLog index 3ab8e49..76a3e10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2014-08-06 gettextize + + * 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 * m4/gettext.m4: New file, from gettext-0.18.1. diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..d5b3fb3 --- /dev/null +++ b/configure.ac @@ -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 +#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=(|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 --git a/configure.in b/configure.in deleted file mode 100644 index f0b99cf..0000000 --- a/configure.in +++ /dev/null @@ -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 -#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=(|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 --git a/po/ChangeLog b/po/ChangeLog index 972a0a6..35d39d5 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,8 @@ +2014-08-06 gettextize + + * Makefile.in.in: Upgrade to gettext-0.18.2. + * Rules-quot: Upgrade to gettext-0.18.2. + 2011-09-16 gettextize * Makefile.in.in: Upgrade to gettext-0.18.1. diff --git a/python/pwquality.c b/python/pwquality.c index 55ee22d..fdf24f8 100644 --- a/python/pwquality.c +++ b/python/pwquality.c @@ -1,8 +1,8 @@ /* * libpwquality Python bindings * - * Copyright (c) Red Hat, Inc, 2011 - * Copyright (c) Tomas Mraz , 2011 + * Copyright (c) Red Hat, Inc, 2011,2014 + * Copyright (c) Tomas Mraz , 2011,2014 * * See the end of the file for the License Information */ diff --git a/python/setup.py b/python/setup.py deleted file mode 100755 index 8174f32..0000000 --- a/python/setup.py +++ /dev/null @@ -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@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 , 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 --git a/python/setup.py.in b/python/setup.py.in new file mode 100755 index 0000000..6457595 --- /dev/null +++ b/python/setup.py.in @@ -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@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 , 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. -- cgit v1.2.1