From 932e4eb46465203fd5baedc73dd940930fb195d8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 18 May 2010 08:01:03 +0200 Subject: [PATCH] Added xbps-triggers-0.1 build template. This package contains the triggers used by the XBPS binary packages. --- srcpkgs/xbps-triggers/INSTALL | 25 +++++++++++++++++++++++++ srcpkgs/xbps-triggers/template | 20 ++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 srcpkgs/xbps-triggers/INSTALL create mode 100644 srcpkgs/xbps-triggers/template diff --git a/srcpkgs/xbps-triggers/INSTALL b/srcpkgs/xbps-triggers/INSTALL new file mode 100644 index 00000000000..c28c0ab5a1c --- /dev/null +++ b/srcpkgs/xbps-triggers/INSTALL @@ -0,0 +1,25 @@ +# +case "${ACTION}" in +pre) + # + # xbps-base-files 0.37 does not have the XBPS triggers anymore. + # If installed package is less than 0.37 remove them before + # upgrading the package. + # + if command -v xbps-uhelper.static 2>&1 >/dev/null; then + uhelper="$(command -v xbps-uhelper.static)" + elif command -v xbps-uhelper 2>&1 >/dev/null; then + uhelper="$(command -v xbps-uhelper)" + fi + [ -z "$uhelper" ] && break + + set +e + ${uhelper} cmpver $(${uhelper} version xbps-base-files) 0.37 + if [ $? -eq 255 ]; then + echo -n "Removing XBPS trigger files, now owned by the " + echo "xbps-triggers package..." + rm -vf var/db/xbps/triggers/* + fi + set -e + ;; +esac diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template new file mode 100644 index 00000000000..2093d47601c --- /dev/null +++ b/srcpkgs/xbps-triggers/template @@ -0,0 +1,20 @@ +# Template file for 'xbps-triggers' +pkgname=xbps-triggers +version=0.1 +build_style=custom-install +short_desc="XBPS Package System triggers" +maintainer="Juan RP " +long_desc=" + This package installs the triggers used by the XBPS binary packages." + +noarch=yes +base_chroot=yes + +do_install() +{ + install -d ${DESTDIR}/var/db/xbps/triggers + install -m750 ${XBPS_TRIGGERSDIR}/* ${DESTDIR}/var/db/xbps/triggers + for f in $(find ${DESTDIR}/var/db/xbps/triggers); do + echo "# end" > ${f} + done +}