SUMMARY = "Library for password quality checking and generating random passwords" HOMEPAGE = "https://launchpad.net/libpwquality" LICENSE = "GPLv2+" LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "\ file://pwquality_conf.patch \ file://pam.configure \ " do_install_append() { install -d -m755 ${D}/${datadir_native}/${PN} install ${WORKDIR}/pam.configure ${D}/${datadir_native}/${PN} } # The postinstall installs libpwquality into PAM. # The prerm removes libpwquatlity from PAM. # The file we change is /etc/pam.d/common-password, # which is a configuration file for libpam-runtime. # We ignore failures in the post-install and pre-remove. # so if the patch does not apply, pam will not use us. pkg_postinst_${PN}() { PAM_CONFIGURE="/${datadir_native}/${PN}/pam.configure" if [[ -n $D ]] ; then LOG='printf %s\n' PAM_CONFIGURE="$D${PAM_CONFIGURE}" cd $D else LOG="logger -s -p user.info -t opkg\ libpwquality" cd / fi # -N busybox option for patch is broken if patch --dry-run -p1 < "$PAM_CONFIGURE" ; then logsave=$(patch -p1 < "$PAM_CONFIGURE" 2>&1 || true) if [[ -n ${logsave} ]] ; then ${LOG} "In directory $(pwd)" ${LOG} "patch -p1 < $PAM_CONFIGURE" ${LOG} "${PN} patch: ${logsave}" fi fi } pkg_prerm_${PN}() { PAM_CONFIGURE="/${datadir_native}/${PN}/pam.configure" if [[ -n $D ]] ; then LOG='printf %s\n' PAM_CONFIGURE="$D${PAM_CONFIGURE}" cd $D else LOG="logger -s -p user.info -t opkg\ libpwquality" cd / fi logsave=$(patch -p1 -R < "$PAM_CONFIGURE" 2>&1 || true) if [[ -n ${logsave} ]] ; then ${LOG} "In directory $(pwd)" ${LOG} "patch -p1 -R < "$PAM_CONFIGURE"" ${LOG} "${PN} remove patch: ${logsave}" fi }