summaryrefslogtreecommitdiff
path: root/recipes-support/libpwquality/libpwquality_%.bbappend
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-02-24 19:11:18 -0600
committerJohn Klug <john.klug@multitech.com>2021-02-24 19:11:18 -0600
commit10afbca28c9e8f061058df75d919b3ffa5f55706 (patch)
treed3c92f7d2f49f9253ea4f80852d4b2cbf2cbf5ef /recipes-support/libpwquality/libpwquality_%.bbappend
parent0f3070b6b8102507e27d9de6fc2b2a93f8de0a70 (diff)
downloadmeta-mlinux-10afbca28c9e8f061058df75d919b3ffa5f55706.tar.gz
meta-mlinux-10afbca28c9e8f061058df75d919b3ffa5f55706.tar.bz2
meta-mlinux-10afbca28c9e8f061058df75d919b3ffa5f55706.zip
Move libpwquality to dunfell
Diffstat (limited to 'recipes-support/libpwquality/libpwquality_%.bbappend')
-rw-r--r--recipes-support/libpwquality/libpwquality_%.bbappend60
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-support/libpwquality/libpwquality_%.bbappend b/recipes-support/libpwquality/libpwquality_%.bbappend
new file mode 100644
index 0000000..910929e
--- /dev/null
+++ b/recipes-support/libpwquality/libpwquality_%.bbappend
@@ -0,0 +1,60 @@
+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
+}