From 71e6a8efcef33b5b77310e1d02c7ea2fffb987a6 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 7 Jan 2012 15:40:45 +0100 Subject: [PATCH] cracklib: Update to 2.8.18. Rework the whole installation process as the cracklib-format/-packer commands tended to hang forever. --- cracklib/cracklib.nm | 77 +++++++++++++------ .../patches/cracklib-2.8.12-gettext.patch | 13 ++++ .../patches/cracklib-2.8.15-inttypes.patch | 68 ++++++++++++++++ 3 files changed, 136 insertions(+), 22 deletions(-) create mode 100644 cracklib/patches/cracklib-2.8.12-gettext.patch create mode 100644 cracklib/patches/cracklib-2.8.15-inttypes.patch diff --git a/cracklib/cracklib.nm b/cracklib/cracklib.nm index 12790b628..dcb90034b 100644 --- a/cracklib/cracklib.nm +++ b/cracklib/cracklib.nm @@ -4,8 +4,8 @@ ############################################################################### name = cracklib -version = 2.8.12 -release = 2 +version = 2.8.18 +release = 1 groups = Security/Password url = http://sourceforge.net/projects/cracklib/ @@ -22,14 +22,20 @@ description in a dictionary. end -source_dl = +source_dl = http://prdownloads.sourceforge.net/cracklib/ sources += cracklib-words-20080507.gz build requires + autoconf + automake + gettext-devel python-devel end + dictdir = %{datadir}/cracklib + dictpath = %{dictdir}/pw_dict + configure_options += \ --with-default-dict=/lib/cracklib/pw_dict \ --with-python \ @@ -38,31 +44,58 @@ build # Only extract the source tarball. prepare cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/%{thisapp}.tar.gz + cd %{DIR_APP} + + cp lib/packer.h lib/packer.h.in + chmod +x util/cracklib-format # Apply all patches. %{MACRO_PATCHES} + + #autoreconf -fi + + mkdir cracklib-dicts + cp -vf %{DIR_DL}/cracklib-words-20080507.gz cracklib-dicts + + # Create distribution dict. + echo -ne "%{DISTRO_NAME}\n%{DISTRO_SNAME}\n" >> \ + cracklib-dicts/cracklib-distro-words + gzip -9 cracklib-dicts/cracklib-distro-words end install_cmds + # Install python bindings + make install DESTDIR=%{BUILDROOT} INSTALL="install -c -p" -C python + mkdir -pv %{BUILDROOT}/{,usr/}%{lib} mv -v %{BUILDROOT}%{libdir}/libcrack.so.2* %{BUILDROOT}/%{lib} - ln -vsf ../../%{lib}/libcrack.so.2.8.0 %{BUILDROOT}%{libdir}/libcrack.so - - mkdir -pv %{BUILDROOT}/usr/share/dict - install -v -m644 -D %{DIR_DL}/cracklib-words-20080507.gz \ - %{BUILDROOT}/usr/share/dict/cracklib-words.gz - gunzip -v %{BUILDROOT}/usr/share/dict/cracklib-words.gz - ln -v -s cracklib-words %{BUILDROOT}/usr/share/dict/words - echo -ne "%{DISTRO_NAME}\n%{DISTRO_SNAME}\n" >> \ - %{BUILDROOT}/usr/share/dict/cracklib-extra-words - - mkdir -pv %{BUILDROOT}/lib/cracklib - chmod a+x util/cracklib-{format,packer} - util/cracklib-format \ - %{BUILDROOT}/usr/share/dict/cracklib-words \ - %{BUILDROOT}/usr/share/dict/cracklib-extra-words | \ - util/cracklib-packer \ - %{BUILDROOT}/lib/cracklib/pw_dict + ln -vsf ../../%{lib}/libcrack.so.2.8.1 %{BUILDROOT}%{libdir}/libcrack.so + + mkdir -pv %{BUILDROOT}{%{dictdir},%{dictpath}} + util/cracklib-format cracklib-dicts/* | \ + util/cracklib-packer %{BUILDROOT}%{dictpath} + util/cracklib-format %{BUILDROOT}%{dictdir}/cracklib-small | \ + util/cracklib-packer %{BUILDROOT}%{dictdir}/cracklib-small + rm -f %{BUILDROOT}%{dictdir}/cracklib-small + + sed -e "s@/usr/lib/cracklib_dict@%{dictpath}@g" lib/crack.h \ + > %{BUILDROOT}%{includedir}/crack.h + + ln -svf cracklib-format %{BUILDROOT}%{sbindir}/mkdict + ln -svf cracklib-packer %{BUILDROOT}%{sbindir}/packer + + toprelpath=.. + touch %{BUILDROOT}/top + while ! test -f %{BUILDROOT}%{libdir}/${toprelpath}/top; do + toprelpath=../${toprelpath} + done + rm -f %{BUILDROOT}/top + + if [ "%{dictpath}" != "%{libdir}/cracklib_dict" ]; then + ln -svf ${toprelpath}%{dictpath}.hwm %{BUILDROOT}%{libdir}/cracklib_dict.hwm + ln -svf ${toprelpath}%{dictpath}.pwd %{BUILDROOT}%{libdir}/cracklib_dict.pwd + ln -svf ${toprelpath}%{dictpath}.pwi %{BUILDROOT}%{libdir}/cracklib_dict.pwi + fi end end @@ -81,8 +114,8 @@ packages description = %{summary} files - /lib/cracklib - /usr/share/dict* + %{dictdir} + %{dictpath} end end diff --git a/cracklib/patches/cracklib-2.8.12-gettext.patch b/cracklib/patches/cracklib-2.8.12-gettext.patch new file mode 100644 index 000000000..8608187df --- /dev/null +++ b/cracklib/patches/cracklib-2.8.12-gettext.patch @@ -0,0 +1,13 @@ +Newer autopoint chokes if we don't explicitly list a version here. +diff -up cracklib-2.8.12/configure.in cracklib-2.8.12/configure.in +--- cracklib-2.8.12/configure.in 2008-10-28 13:27:06.000000000 -0400 ++++ cracklib-2.8.12/configure.in 2008-10-28 13:27:07.000000000 -0400 +@@ -58,7 +58,7 @@ AC_CHECK_FUNCS(strdup) + AC_CHECK_FUNCS(getpwuid_r) + + dnl internationalization macros +-AM_GNU_GETTEXT_VERSION ++AM_GNU_GETTEXT_VERSION(0.14) + AM_GNU_GETTEXT([external]) + + dnl Control default dictname diff --git a/cracklib/patches/cracklib-2.8.15-inttypes.patch b/cracklib/patches/cracklib-2.8.15-inttypes.patch new file mode 100644 index 000000000..d1d6a23ab --- /dev/null +++ b/cracklib/patches/cracklib-2.8.15-inttypes.patch @@ -0,0 +1,68 @@ +Don't depend on a consumer of to be using autoconf, and to be +checking for for the presence of and , and including +its own "config.h" before including , in order for this to be +correct on 64-bit machines. + +diff -up cracklib-2.8.15/configure.in cracklib-2.8.15/configure.in +--- cracklib-2.8.15/configure.in 2009-11-18 18:58:21.000000000 -0500 ++++ cracklib-2.8.15/configure.in 2009-12-01 15:16:35.000000000 -0500 +@@ -26,6 +26,19 @@ AC_CHECK_HEADERS(zlib.h, AC_DEFINE(HAVE_ + + AC_SEARCH_LIBS(gzopen, z) + ++if test x$ac_cv_header_inttypes_h = xyes ; then ++ CRACKLIB_INTEGER_TYPES1="#include " ++ CRACKLIB_INTEGER_TYPES2= ++elif test x$ac_cv_header_stdint_h = xyes ; then ++ CRACKLIB_INTEGER_TYPES1="#include " ++ CRACKLIB_INTEGER_TYPES2= ++else ++ CRACKLIB_INTEGER_TYPES1="typedef unsigned int uint32_t;" ++ CRACKLIB_INTEGER_TYPES2="typedef unsigned short uint16_t;" ++fi ++AC_SUBST(CRACKLIB_INTEGER_TYPES1) ++AC_SUBST(CRACKLIB_INTEGER_TYPES2) ++ + dnl Cygwin workaround + AC_MSG_CHECKING(if LINE_MAX is defined) + AC_EGREP_CPP(yes, +@@ -92,5 +105,6 @@ AC_SUBST(CROSS_COMPILING, $cross_compili + + AC_OUTPUT(util/Makefile lib/Makefile doc/Makefile python/Makefile Makefile \ + python/setup.py \ ++ lib/packer.h \ + po/Makefile.in m4/Makefile dicts/Makefile cracklib.spec) + +diff -up cracklib-2.8.15/lib/packer.h.in cracklib-2.8.15/lib/packer.h.in +--- cracklib-2.8.15/lib/packer.h.in 2009-12-01 15:15:38.000000000 -0500 ++++ cracklib-2.8.15/lib/packer.h.in 2009-12-01 15:15:38.000000000 -0500 +@@ -30,17 +30,8 @@ + #define _(String) (String) + #endif + +-#if defined(HAVE_INTTYPES_H) +-#include +-#else +-#if defined(HAVE_STDINT_H) +-#include +-#else +-typedef unsigned int uint32_t; +-typedef unsigned short uint16_t; +-#endif +-#endif +- ++@CRACKLIB_INTEGER_TYPES1@ ++@CRACKLIB_INTEGER_TYPES2@ + + struct pi_header + { +@@ -83,6 +74,9 @@ typedef struct { + int dummy; + } PWDICT; + ++@CRACKLIB_INTEGER_TYPES1@ ++@CRACKLIB_INTEGER_TYPES2@ ++ + #endif + + extern PWDICT *PWOpen(const char *prefix, char *mode); -- 2.39.2