]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
cracklib: Update to 2.8.18.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Jan 2012 14:40:45 +0000 (15:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Jan 2012 14:40:45 +0000 (15:40 +0100)
Rework the whole installation process as the cracklib-format/-packer
commands tended to hang forever.

cracklib/cracklib.nm
cracklib/patches/cracklib-2.8.12-gettext.patch [new file with mode: 0644]
cracklib/patches/cracklib-2.8.15-inttypes.patch [new file with mode: 0644]

index 12790b628a37d305757591553de3c8a1c80aadb6..dcb90034b4d05a06471adaf985dee15148a7438d 100644 (file)
@@ -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 (file)
index 0000000..8608187
--- /dev/null
@@ -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 (file)
index 0000000..d1d6a23
--- /dev/null
@@ -0,0 +1,68 @@
+Don't depend on a consumer of <packer.h> to be using autoconf, and to be
+checking for for the presence of <inttypes.h> and <stdint.h>, and including
+its own "config.h" before including <packer.h>, 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 <inttypes.h>"
++      CRACKLIB_INTEGER_TYPES2=
++elif test x$ac_cv_header_stdint_h = xyes ; then
++      CRACKLIB_INTEGER_TYPES1="#include <stdint.h>"
++      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 <inttypes.h>
+-#else
+-#if defined(HAVE_STDINT_H)
+-#include <stdint.h>
+-#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);