From e13224f9602ac25ce7d139cc3e88ec99e6037604 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 7 Feb 2013 05:06:39 +0100 Subject: [PATCH] cracklib: split library into its own subpkg; add cross build support. --- common/shlibs | 2 +- srcpkgs/cracklib/INSTALL | 8 ++++++ srcpkgs/cracklib/REMOVE | 8 ++++++ srcpkgs/cracklib/cracklib-devel.template | 2 +- srcpkgs/cracklib/libcracklib.template | 8 ++++++ srcpkgs/cracklib/template | 31 +++++++++++++++++------- srcpkgs/libcracklib | 1 + 7 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 srcpkgs/cracklib/INSTALL create mode 100644 srcpkgs/cracklib/REMOVE create mode 100644 srcpkgs/cracklib/libcracklib.template create mode 120000 srcpkgs/libcracklib diff --git a/common/shlibs b/common/shlibs index f655631132c..edda11e8e5b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -169,7 +169,7 @@ libattr.so.1 attr-2.4.43_1 libacl.so.1 acl-2.2.47_1 libpython2.7.so.1.0 python-2.7_1 libffi.so.5 libffi-3.0.8_1 -libcrack.so.2 cracklib-2.8.0_1 +libcrack.so.2 libcracklib-2.8.22_2 libpam.so.0 pam-1.0.0_1 libpam_misc.so.0 pam-1.0.0_1 libcap.so.2 libcap-2.16_1 diff --git a/srcpkgs/cracklib/INSTALL b/srcpkgs/cracklib/INSTALL new file mode 100644 index 00000000000..321027ca369 --- /dev/null +++ b/srcpkgs/cracklib/INSTALL @@ -0,0 +1,8 @@ +case ${ACTION} in +post) + echo "Generating cracklib dictionary..." + usr/bin/create-cracklib-dict -o usr/share/cracklib/pw_dict \ + usr/share/cracklib/cracklib-words || exit 1 + ;; +esac + diff --git a/srcpkgs/cracklib/REMOVE b/srcpkgs/cracklib/REMOVE new file mode 100644 index 00000000000..40188acd5e4 --- /dev/null +++ b/srcpkgs/cracklib/REMOVE @@ -0,0 +1,8 @@ +case ${ACTION} in +pre) + if [ "$UPDATE" = "no" ]; then + rm -f usr/share/cracklib/pw_dict.* + fi + ;; +esac + diff --git a/srcpkgs/cracklib/cracklib-devel.template b/srcpkgs/cracklib/cracklib-devel.template index 13fbb2f4c67..9dd103db271 100644 --- a/srcpkgs/cracklib/cracklib-devel.template +++ b/srcpkgs/cracklib/cracklib-devel.template @@ -1,7 +1,7 @@ # Template file for 'cracklib-devel'. # noarch=yes -depends="zlib-devel cracklib>=${version}" +depends="zlib-devel libcracklib>=${version}" short_desc="${short_desc} -- development files" do_install() { diff --git a/srcpkgs/cracklib/libcracklib.template b/srcpkgs/cracklib/libcracklib.template new file mode 100644 index 00000000000..27e91c003ec --- /dev/null +++ b/srcpkgs/cracklib/libcracklib.template @@ -0,0 +1,8 @@ +# Template file for 'libcracklib'. +# +short_desc="${short_desc} -- runtime library" +replaces="cracklib<2.8.22_2" + +do_install() { + vmove "usr/lib/*.so*" usr/lib +} diff --git a/srcpkgs/cracklib/template b/srcpkgs/cracklib/template index 7f4b9126749..c8a2de8d83a 100644 --- a/srcpkgs/cracklib/template +++ b/srcpkgs/cracklib/template @@ -1,21 +1,34 @@ # Template file for 'cracklib' pkgname=cracklib version=2.8.22 -revision=1 -subpackages="${pkgname}-devel ${pkgname}-python" +revision=2 +subpackages="libcracklib ${pkgname}-devel ${pkgname}-python" +create_wrksrc=yes +build_wrksrc="${pkgname}-${version}" build_style=gnu-configure configure_args="--disable-static" -makedepends="python-devel zlib-devel" +makedepends="python-devel" +crossmakedepends="${makedepends}" short_desc="Password Checking Library" maintainer="Juan RP " license="LGPL-2.1" homepage="http://cracklib.sourceforge.net/" -distfiles="${SOURCEFORGE_SITE}/cracklib/$pkgname-$version.tar.gz" -checksum=feaff49bfb513ec10b2618c00d2f7f60776ba93fcc5fa22dd3479dd9cad9f770 +distfiles=" + ${SOURCEFORGE_SITE}/cracklib/${pkgname}-${version}.tar.gz + ${SOURCEFORGE_SITE}/cracklib/${pkgname}-words-1.2.gz" +checksum=" + feaff49bfb513ec10b2618c00d2f7f60776ba93fcc5fa22dd3479dd9cad9f770 + 9b323c100780f2a817ab3de082b8bfaa4478bfa174dcbd016810ed8be60cbe16" + +if [ -n "$XBPS_CROSS_TRIPLET" ]; then + makedepends="automake gettext-devel ${makedepends}" + pre_configure() { + sed -i "s|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|g" -i configure.in + autoreconf -fi + } +fi post_install() { - # Create default small wordlist. - vmkdir usr/share/cracklib - sh ./util/cracklib-format dicts/cracklib-small \ - | sh ./util/cracklib-packer ${DESTDIR}/usr/share/cracklib/pw_dict + [ -e ../cracklib-words-1.2.gz ] && gunzip ../cracklib-words-1.2.gz + vinstall ../cracklib-words-1.2 644 usr/share/cracklib cracklib-words } diff --git a/srcpkgs/libcracklib b/srcpkgs/libcracklib new file mode 120000 index 00000000000..741275aec92 --- /dev/null +++ b/srcpkgs/libcracklib @@ -0,0 +1 @@ +cracklib \ No newline at end of file