void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

commit 9f80826f974f2a72fa65ff627625c55063b3b52e
parent 556082af9a9630a4f305c5050f2c80f4ae6584cc
Author: Dash Eclipse <dash@ezup.dev>
Date:   Sat, 18 Jul 2020 21:54:30 +0000

Add srcpkgs/xbps-triggers

Diffstat:
Asrcpkgs/xbps-triggers/files/appstream-cache | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/binfmts | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/dkms | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gconf-schemas | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gdk-pixbuf-loaders | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gio-modules | 39+++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gsettings-schemas | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gtk-icon-cache | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gtk-immodules | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/gtk-pixbuf-loaders | 6++++++
Asrcpkgs/xbps-triggers/files/gtk3-immodules | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/hwdb.d-dir | 36++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/info-files | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/kernel-hooks | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/mimedb | 40++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/mkdirs | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/pango-modules | 43+++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/pycompile | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/register-shell | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/system-accounts | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/texmf-dist | 39+++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/update-desktopdb | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/x11-fonts | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/files/xml-catalog | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrcpkgs/xbps-triggers/template | 23+++++++++++++++++++++++
25 files changed, 1583 insertions(+), 0 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/appstream-cache b/srcpkgs/xbps-triggers/files/appstream-cache @@ -0,0 +1,65 @@ +#!/bin/sh +# +# Updates the appstream AppData cache during installation of packages and +# deletes it when AppStream is removed +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +# The appstreamcli binary program. +APPSTREAMCLI="usr/bin/appstreamcli" + +# Paths that hold appstream metadata files +# the first one is the traditional one where most package reside but it is +# considered deprecated by upstream +# the other 3 are the ones used by upstream as noted in as-pool.c#L93-95 +APPDATA_DATAPATHS="usr/share/appdata usr/share/app-info var/lib/app-info var/cache/app-info" + +# Location where the cache files go when they are generated they are most +# of the time compressed with gvz extension +APPSTREAM_CACHE="var/cache/app-info/gv" + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + case "$TARGET" in + post-install|post-remove) + if [ $PKGNAME = "AppStream" -a $TARGET = "post-remove" ]; then + for f in ${APPSTREAM_CACHE}/*; do + rm -f ${f} + done + echo "Removing AppStream cache..." + rmdir ${APPSTREAM_CACHE} + exit 0 + fi + + if [ ! -x "$APPSTREAMCLI" ]; then + exit 0 + fi + + for path in ${APPDATA_DATAPATHS}; do + APPSTREAM_PATHS="${APPSTREAM_PATHS} --datapath ${path}" + done + + echo "Updating AppStream cache..." + ${APPSTREAMCLI} refresh-cache --force ${APPSTREAM_PATHS} --cachepath ${APPSTREAM_CACHE} + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/binfmts b/srcpkgs/xbps-triggers/files/binfmts @@ -0,0 +1,61 @@ +#!/bin/sh +# +# binfmts trigger. +# +# Binaries can be specified like: +# binfmts="<path> [<args> ...]" +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin" + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + [ -x /usr/bin/update-binfmts ] || exit 0 + [ -z "${binfmts}" ] && exit 0 + + case "$TARGET" in + post-install) + echo "$binfmts" | tr '\' '&' 2> /dev/null | while read line; do + line=$(echo $line | tr '&' '\' 2> /dev/null) + set -- ${line} + _bin="$1"; shift; _args="$@"; _bname="$(basename ${_bin})" + update-binfmts --package ${PKGNAME} --install ${_bname} ${_bin} ${_args} + done + ;; + pre-remove) + echo "$binfmts" | tr '\' '&' 2> /dev/null | while read line; do + line=$(echo $line | tr '&' '\' 2> /dev/null) + set -- ${line} + _bin="$1"; shift; _args="$@"; _bname="$(basename ${_bin})" + if [ -f /var/lib/binfmts/${_bname} ]; then + update-binfmts --package ${PKGNAME} --remove ${_bname} ${_bin} + fi + done + ;; + *) + exit 1 + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 +# end +# end diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms @@ -0,0 +1,143 @@ +#!/bin/sh +# +# DKMS trigger. Used to add/build/install or remove the specified modules +# from all kernels. +# +# Modules can be specified like: +# dkms_modules="<modulename> <version> ..." +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin" + +remove_modules() { + local _modver _kver + + # Remove the specified modules from all kernels. + set -- ${dkms_modules} + while [ $# -gt 0 ]; do + $DKMS status -m "$1" | while read line; do + if $(echo "$line" | egrep -vq '(added|built|installed)'); then + shift 2; continue + fi + _modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d") + _kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/") + echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... " + $DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "done." + else + echo "FAILED!" + fi + done + shift 2 + done +} + +add_modules() { + local rval= + + # Add/build and install the specified modules for all kernels. + set -- ${dkms_modules} + while [ $# -gt 0 ]; do + $DKMS add -m "$1" -v "$2" >/dev/null 2>&1 + rval=$? + if [ $rval -eq 0 ]; then + echo "Added DKMS module '$1-$2'." + elif [ $rval -eq 3 ]; then + echo "DKMS module '$1-$2' already added, skipping." + else + echo "Failed to add DKMS module: '$1-$2'..." + err=1 + fi + shift 2 + done + [ -n "$err" ] && exit $err + + for f in $(echo lib/modules/*); do + _kver=$(basename $f) + if [ ! -e "${f}/build/include" ]; then + echo "Skipping kernel-${_kver}. kernel-headers package not installed..." + continue + fi + if [ ! -f ${f}/build/scripts/basic/fixdep ] ; then + echo -n "Building scripts for kernel-${_kver}... " + yes "" | make -j$(nproc) -C ${f}/build scripts > ${f}/build/make.log 2>&1 + if [ $? -eq 0 ]; then + echo "done." + else + echo "FAILED!" + echo "Kernel scripts failed to build, please check /${f}/build/make.log" + echo "for errors in the log file." + fi + fi + set -- ${dkms_modules} + while [ $# -gt 0 ]; do + echo -n "Building DKMS module '$1-$2' for kernel-${_kver}... " + $DKMS build -m "$1" -v "$2" -k "${_kver}" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "done." + else + echo "FAILED!" + echo "DKMS module '$1-$2' failed to build, please check /var/lib/dkms" + echo "for errors in the log file." + shift 2; continue + fi + echo -n "Installing DKMS module '$1-$2' for kernel-${_kver}... " + $DKMS install -m "$1" -v "$2" -k "${_kver}" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "done." + else + echo "FAILED!" + echo "DKMS module '$1-$2' failed to install, please do this manually" + echo "and check for errors in the log file." + fi + shift 2 + done + done +} + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + if [ -x /usr/bin/dkms ]; then + DKMS=/usr/bin/dkms + elif [ -x /usr/sbin/dkms ]; then + DKMS=/usr/sbin/dkms + else + exit 0 + fi + + [ ! -x $DKMS -o -z "$dkms_modules" ] && exit 0 + + case "$TARGET" in + post-install) + export IGNORE_CC_MISMATCH=1 + add_modules + ;; + pre-remove) + remove_modules + ;; + *) + exit 1 + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gconf-schemas b/srcpkgs/xbps-triggers/files/gconf-schemas @@ -0,0 +1,104 @@ +#!/bin/sh +# +# (Un)registers GConf schemas/entries into the schemas database directory. +# +# The following variables can be defined by a package to register .entries +# and .schemas files: +# +# gconf_entries - A list of .entries files to register. When using this +# variable, packages need to be fixed to not register +# them and to install those files to GCONF_SCHEMAS_DIR. +# gconf_schemas - A list of .schemas files to register. When using this +# variable, packages need to be fixed to not register +# them and to install those files to GCONF_SCHEMAS_DIR. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +# The gconftool-2 binary program. +GCONFTOOL2="usr/bin/gconftool-2" + +# Default configuration source (database). +GCONF_CONFIG_SOURCE="xml::/etc/gconf/gconf.xml.defaults" + +# Where .schemas files go. +GCONF_SCHEMAS_DIR="usr/share/gconf/schemas" + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + if [ ! -x "$GCONFTOOL2" ]; then + exit 0 + fi + if [ -z "$gconf_entries" -a -z "$gconf_schemas" ]; then + return 0 + fi + + case "$TARGET" in + post-install) + for f in ${gconf_schemas}; do + if [ ! -f "${GCONF_SCHEMAS_DIR}/${f}" ]; then + continue + fi + GCONF_CONFIG_SOURCE="$GCONF_CONFIG_SOURCE" \ + ${GCONFTOOL2} --makefile-install-rule \ + ${GCONF_SCHEMAS_DIR}/${f} >/dev/null + if [ $? -eq 0 ]; then + echo "Registered GConf schema: ${f}." + fi + done + for f in ${gconf_entries}; do + if [ ! -f "${GCONF_SCHEMAS_DIR}/${f}" ]; then + continue + fi + ${GCONFTOOL2} --config-source=${GCONF_CONFIG_SOURCE} \ + --direct --load ${GCONF_SCHEMAS_DIR}/${f} \ + >/dev/null + if [ $? -eq 0 ]; then + echo "Registered GConf entry: ${f}." + fi + done + ;; + pre-remove) + for f in ${gconf_entries}; do + if [ ! -f "${GCONF_SCHEMAS_DIR}/${f}" ]; then + continue + fi + ${GCONFTOOL2} --config-source=${GCONF_CONFIG_SOURCE} \ + --direct --unload ${GCONF_SCHEMAS_DIR}/${f} \ + >/dev/null + if [ $? -eq 0 ]; then + echo "Unregistered GConf entry: ${f}." + fi + done + for f in ${gconf_schemas}; do + if [ ! -f "${GCONF_SCHEMAS_DIR}/${f}" ]; then + continue + fi + GCONF_CONFIG_SOURCE="${GCONF_CONFIG_SOURCE}" \ + ${GCONFTOOL2} --makefile-uninstall-rule \ + ${GCONF_SCHEMAS_DIR}/${f} >/dev/null + if [ $? -eq 0 ]; then + echo "Unregistered GConf schema: ${f}." + fi + done + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gdk-pixbuf-loaders b/srcpkgs/xbps-triggers/files/gdk-pixbuf-loaders @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Updates's GDK Pixbuf loaders cache with gdk-pixbuf-query-loaders(1). +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders +pixbuf_cache=usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache + +case "$ACTION" in +targets) + echo "post-install pre-remove post-remove" + ;; +run) + [ ! -x ${pixbuf_bin} ] && exit 0 + + if [ "$TARGET" = "pre-remove" -a "${PKGNAME}" = "gdk-pixbuf" ]; then + [ -f ${pixbuf_cache} ] && rm -f ${pixbuf_cache} + break + fi + case "$TARGET" in + post-*) + if [ -f etc/gtk-2.0/gdk-pixbuf.loaders ]; then + echo " Removing obsolete conf file: etc/gtk-2.0/gdk-pixbuf.loaders" + rm -f etc/gtk-2.0/gdk-pixbuf.loaders + fi + if [ -x ${pixbuf_bin} ]; then + echo "Updating GDK Pixbuf loaders cache..." + ${pixbuf_bin} --update-cache + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gio-modules b/srcpkgs/xbps-triggers/files/gio-modules @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Updates GLib GIO module cache with gio-querymodules. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +gioquery=usr/bin/gio-querymodules +giocachedir=usr/lib/gio/modules + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + case "$TARGET" in + post-*) + if [ -x ${gioquery} -a -d ${giocachedir} ]; then + echo "Updating GLib GIO modules cache..." + ${gioquery} ${giocachedir} + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gsettings-schemas b/srcpkgs/xbps-triggers/files/gsettings-schemas @@ -0,0 +1,58 @@ +#!/bin/sh +# +# GLib's GSettings XML schema files. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +# The glib-compile-schemas binary program. +GSCHEMASCOMP="usr/bin/glib-compile-schemas" + +# Where .schemas files go. +GLIB_SCHEMAS_DIR="usr/share/glib-2.0/schemas" + +case "$ACTION" in +targets) + echo "post-install post-remove pre-remove" + ;; +run) + if [ ! -x "$GSCHEMASCOMP" ]; then + exit 0 + fi + + case "$TARGET" in + post-*) + [ ! -d ${GLIB_SCHEMAS_DIR} ] && exit 0 + # Compile all GSettings schema files. + echo -n "Refreshing GSettings database from " + echo -n "${GLIB_SCHEMAS_DIR}... " + ${GSCHEMASCOMP} ${GLIB_SCHEMAS_DIR} + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed!" + fi + ;; + pre-remove) + if [ "${PKGNAME}" = "glib" ]; then + rm -f ${GLIB_SCHEMAS_DIR}/*.compiled + echo "Removed GSettings database file." + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gtk-icon-cache b/srcpkgs/xbps-triggers/files/gtk-icon-cache @@ -0,0 +1,56 @@ +#!/bin/sh +# +# Updates GTK+ icon cache file with gtk-update-icon-cache(1). +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +iconcache_bin=usr/bin/gtk-update-icon-cache + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then + for dir in ${gtk_iconcache_dirs}; do + if [ -f ${dir}/icon-theme.cache ]; then + rm -f ${dir}/icon-theme.cache + echo -n "Removed GTK+ icon theme " + echo "cache for ${dir}." + fi + done + exit 0 + fi + + if [ ! -x $iconcache_bin ]; then + exit 0 + fi + + case "$TARGET" in + post-*) + for dir in ${gtk_iconcache_dirs}; do + if [ -d "${dir}" ]; then + echo -n "Updating GTK+ icon cache for " + echo "${dir}..." + ${iconcache_bin} -q -f -t ${dir} + fi + done + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gtk-immodules b/srcpkgs/xbps-triggers/files/gtk-immodules @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Updates GTK+ IM modules file with gtk-query-immodules-2.0(1). +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +immodules_bin=usr/bin/gtk-query-immodules-2.0 +immodules_cache=usr/lib/gtk-2.0/2.10.0/immodules.cache + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then + [ -f ${immodules_cache} ] && rm -f ${immodules_cache} + exit 0 + fi + case "$TARGET" in + post-*) + if [ -f etc/gtk-2.0/gtk.immodules ]; then + echo "Removing obsolete conf file: etc/gtk-2.0/gtk.immodules" + rm -f etc/gtk-2.0/gtk.immodules + fi + + if [ ! -x $immodules_bin ]; then + exit 0 + fi + + echo "Updating GTK+ immodules cache..." + $immodules_bin --update-cache + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/gtk-pixbuf-loaders b/srcpkgs/xbps-triggers/files/gtk-pixbuf-loaders @@ -0,0 +1,6 @@ +#!/bin/sh +# +# This trigger retains the old name of the current 'gdk-pixbuf-loaders' trigger +# and redirects all args there +# +exec usr/libexec/xbps-triggers/gdk-pixbuf-loaders "$@" diff --git a/srcpkgs/xbps-triggers/files/gtk3-immodules b/srcpkgs/xbps-triggers/files/gtk3-immodules @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Updates GTK+3 IM modules file with gtk-query-immodules-3.0(1). +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +immodules_bin=usr/bin/gtk-query-immodules-3.0 +immodules_cache=usr/lib/gtk-3.0/3.0.0/immodules.cache + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+3" ]; then + [ -f ${immodules_cache} ] && rm -f ${immodules_cache} + exit 0 + fi + case "$TARGET" in + post-*) + if [ -f etc/gtk-3.0/gtk.immodules ]; then + echo "Removing obsolete conf file: etc/gtk-3.0/gtk.immodules" + rm -f etc/gtk-3.0/gtk.immodules + fi + + if [ ! -x $immodules_bin ]; then + exit 0 + fi + + echo "Updating GTK+3 immodules cache..." + $immodules_bin --update-cache + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/hwdb.d-dir b/srcpkgs/xbps-triggers/files/hwdb.d-dir @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Updates hardware database +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +udevadm=usr/bin/udevadm + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + if [ ! -x $udevadm ]; then + exit 0 + fi + + echo "Updating udev hardware database ..." + $udevadm hwdb --root=. --update + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/info-files b/srcpkgs/xbps-triggers/files/info-files @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Registers or unregisters info files for a package. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +installinfo=usr/bin/install-info +infodir=usr/share/info + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + [ ! -x "$installinfo" ] && exit 0 + + if [ -z "$info_files" ]; then + echo "Trigger info-files: empty info_files." + exit 1 + fi + + for f in ${info_files}; do + if [ "$f" = "/usr/share/info/dir" ]; then + continue + elif [ ! -f ".$f" ]; then + echo "WARNING: $f does not exist! skipping..." + continue + fi + + case "$TARGET" in + post-install) + echo -n "Registering info file: $f... " + ;; + pre-remove) + echo -n "Unregistering info file: $f... " + infoargs="--delete" + ;; + esac + + $installinfo $infoargs ./$f $infodir/dir 2>/dev/null + if [ $? -eq 0 ]; then + echo "done." + else + echo "failed!" + fi + done + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/kernel-hooks b/srcpkgs/xbps-triggers/files/kernel-hooks @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Run scripts found in /etc/kernel.d/ directories. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +RUN_TARGETS="pre-install post-install pre-remove post-remove" + +case "$ACTION" in +targets) + echo "${RUN_TARGETS}" + ;; +run) + # Ignore pre-remove when updating a package. + if [ "${TARGET}" = "pre-remove" ]; then + [ "${UPDATE}" = "yes" ] && exit 0 + fi + + # Create required dirs when necessary. + for _dir_ in ${RUN_TARGETS}; do + [ ! -d etc/kernel.d/${_dir_} ] && mkdir -p etc/kernel.d/${_dir_} + done + + # Execute kernel hooks for the specified target. + for _file_ in etc/kernel.d/${TARGET}/*; do + [ ! -x "${_file_}" ] && continue + echo "Executing ${TARGET} kernel hook: $(basename ${_file_}) ..." + + # A package may export "kernel_hooks_version" as a hint + # to pass this version to the hooks. + if [ -n "${kernel_hooks_version}" ]; then + env ROOTDIR="." ${_file_} ${PKGNAME} ${kernel_hooks_version} + else + env ROOTDIR="." ${_file_} ${PKGNAME} ${VERSION} + fi + done + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/mimedb b/srcpkgs/xbps-triggers/files/mimedb @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Updates the shared-mime-info db file with update-mime-database(1). +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +mimedb_bin=usr/bin/update-mime-database + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + case "$TARGET" in + post-*) + if [ ! -x ${mimedb_bin} ]; then + exit 0 + fi + + echo "Updating shared-mime-info database..." + PKGSYSTEM_ENABLE_FSYNC=0 ${mimedb_bin} -n usr/share/mime > /dev/null + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/mkdirs b/srcpkgs/xbps-triggers/files/mkdirs @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Creates or removes directories as specified by the make_dirs +# environment variable, as follows (relative to rootdir): +# +# dir mode uid gid +# blah 0755 0 0 +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + [ -z "$make_dirs" ] && return 0 + + if [ "$TARGET" = "post-install" ]; then + # create directories + set -- ${make_dirs} + while [ $# -gt 0 ]; do + _dir="$1"; _mode="$2"; _uid="$3"; _gid="$4" + if [ ! -d ".${_dir}" ]; then + mkdir -p ".${_dir}" || \ + echo "Failed to create .${_dir}!" + fi + chown "${_uid}:${_gid}" ".${_dir}" && \ + chmod ${_mode} ".${_dir}" || \ + echo "Failed to set perms ${_mode} ${_uid}:${_gid} to .${_dir}!" + shift; shift; shift; shift + done + else + # remove directories + set -- ${make_dirs} + while [ $# -gt 0 ]; do + _dir="$1" + if [ -d ".${_dir}" ]; then + rmdir ".${_dir}" >/dev/null 2>&1 + fi + shift; shift; shift; shift + done + fi + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/pango-modules b/srcpkgs/xbps-triggers/files/pango-modules @@ -0,0 +1,43 @@ +#!/bin/sh +# +# This is a reduced version for the pango-modules trigger which is now +# obsolete upstream. +# The pango-modulesquery binary was removed from upstream and isn't provided +# anymore by our 'pango' package +# +# This reduced version just removes the pango.modules file if it exists during +# the removal of the 'pango' package +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +pango_modules=etc/pango/pango.modules + +case "$ACTION" in +targets) + echo "post-remove" + ;; +run) + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "pango" ]; then + if [ -f ${pango_modules} ]; then + echo "Removing pango modules file..." + rm -f ${pango_modules} + fi + break + fi + ;; +*) + exit 0 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/pycompile b/srcpkgs/xbps-triggers/files/pycompile @@ -0,0 +1,116 @@ +#!/bin/sh +# +# Trigger to compile python code into native bytecode and remove +# generated bytecode files. +# +# Packages need to set the variable pycompile_dirs with a list +# of directories (absolute path) separated by spaces, and WITHOUT +# the first slash, e.g: +# +# pycompile_dirs="usr/blah/foo usr/zoo/d00d" +# +# or if the code resides in standard site-packages directory, +# need to set the pycompile_module variable: +# +# pycompile_module="blah foo" +# +# Or if a module is stored in top-level site-packages directory: +# +# pycompile_module="foo.py" +# +# Additionally another var can be used to specify the target python version: +# +# pycompile_version="3.4" +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +export PATH="usr/bin:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin" + +update_ldcache() { + if [ -x sbin/ldconfig -o -x bin/ldconfig ]; then + echo "Updating ldconfig(8) cache..." + ldconfig -X || : + fi +} + +compile() +{ + for f in ${pycompile_dirs}; do + echo "Byte-compiling python code in ${f}..." + python${pycompile_version} -m compileall -f -q ${f} && \ + python${pycompile_version} -O -m compileall -f -q ${f} + done + for f in ${pycompile_module}; do + echo "Byte-compiling python${pycompile_version} code for module ${f}..." + if [ -d "usr/lib/python${pycompile_version}/site-packages/${f}" ]; then + python${pycompile_version} -m compileall -f -q \ + usr/lib/python${pycompile_version}/site-packages/${f} && \ + python${pycompile_version} -O -m compileall -f -q \ + usr/lib/python${pycompile_version}/site-packages/${f} + else + python${pycompile_version} -m compileall -f -q \ + usr/lib/python${pycompile_version}/site-packages/${f} && \ + python${pycompile_version} -O -m compileall -f -q \ + usr/lib/python${pycompile_version}/site-packages/${f} + fi + done + update_ldcache +} + +remove() +{ + for f in ${pycompile_dirs}; do + echo "Removing byte-compiled python${pycompile_version} files in ${f}..." + find ${f} -type f -name \*.py[co] -delete 2>&1 >/dev/null + find ${f} -type d -name __pycache__ -delete 2>&1 >/dev/null + done + for f in ${pycompile_module}; do + echo "Removing byte-compiled python${pycompile_version} code for module ${f}..." + if [ -d usr/lib/python${pycompile_version}/site-packages/${f} ]; then + find usr/lib/python${pycompile_version}/site-packages/${f} \ + -type f -name \*.py[co] -delete 2>&1 >/dev/null + find usr/lib/python${pycompile_version}/site-packages/${f} \ + -type d -name __pycache__ -delete 2>&1 >/dev/null + else + rm -f usr/lib/python${pycompile_version}/site-packages/${f%.py}.py[co] + fi + done + update_ldcache +} + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + [ ! -x usr/bin/python${pycompile_version} ] && exit 0 + [ -z "${pycompile_dirs}" -a -z "${pycompile_module}" ] && exit 0 + + case "$TARGET" in + post-install) + compile + ;; + pre-remove) + remove + ;; + *) + exit 1 + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/register-shell b/srcpkgs/xbps-triggers/files/register-shell @@ -0,0 +1,66 @@ +#!/bin/sh +# +# Registers or unregisters a shell in /etc/shells. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + [ "$TARGET" != "post-install" -a "$TARGET" != "post-remove" ] && exit 1 + + if [ -z "$register_shell" ]; then + echo "Trigger register-shell: empty \$register_shell!" + exit 1 + fi + + case "$TARGET" in + post-install) + if [ ! -f etc/shells ]; then + for f in ${register_shell}; do + echo $f >> etc/shells + echo "Registered $f into /etc/shells." + done + chmod 644 etc/shells + else + for f in ${register_shell}; do + if ! grep -qFx "$f" etc/shells; then + echo "$f" >> etc/shells + echo -n "Registered $f into " + echo "/etc/shells." + fi + done + fi + ;; + post-remove) + if [ -f etc/shells ]; then + for f in ${register_shell}; do + if grep -q $f etc/shells; then + shell=$(echo $f|sed "s|\\/|\\\/|g") + sed -i -e "/$shell/d" etc/shells + echo -n "Unregistered $f from " + echo "/etc/shells." + fi + done + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/system-accounts b/srcpkgs/xbps-triggers/files/system-accounts @@ -0,0 +1,162 @@ +#!/bin/sh +# +# (Un)registers systems accounts (users/groups). +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +export PATH="usr/sbin:usr/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +group_add() { + local _grname _gid use_gid + + _grname="${1%:*}" + _gid="${1#*:}" + + if [ "${_gid}" != "${_grname}" ]; then + use_gid="gid ${_gid}" + fi + + if ! getent group ${_grname} >/dev/null; then + if [ -n "$use_gid" ]; then + groupadd -r ${_grname} -g ${_gid} >/dev/null 2>&1 + else + groupadd -r ${_grname} >/dev/null 2>&1 + fi + if [ $? -eq 0 ]; then + echo "Created ${_grname} ($use_gid) system group." + else + echo "Failed to create ${_grname} ($use_gid) system group!" + exit 1 + fi + fi +} + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + if [ -z "$system_accounts" -a -z "$system_groups" ]; then + exit 0 + fi + + if [ -x sbin/useradd -o -x bin/useradd ]; then + USERADD=1 + fi + if [ -x sbin/usermod -o -x bin/usermod ]; then + USERMOD=1 + fi + if [ -x sbin/groupadd -o -x bin/groupadd ]; then + GROUPADD=1 + fi + if [ -x bin/getent -o -x sbin/getent ]; then + GETENT=1 + fi + if [ -x bin/passwd -o -x sbin/passwd ]; then + PASSWD=1 + fi + + case "$TARGET" in + post-install) + # System groups required by a package. + for grp in ${system_groups}; do + if [ -z "$GROUPADD" -a -z "$GETENT" ]; then + echo "WARNING: cannot create ${grp} system group (missing groupadd/getent)" + echo "The following group must be created manually: $grp" + continue + fi + group_add $grp + done + + # System user/group required by a package. + for acct in ${system_accounts}; do + _uname="${acct%:*}" + _uid="${acct#*:}" + + eval homedir="\$${_uname}_homedir" + eval shell="\$${_uname}_shell" + eval descr="\$${_uname}_descr" + eval groups="\$${_uname}_groups" + eval pgroup="\$${_uname}_pgroup" + [ -z "$homedir" ] && homedir="/var/empty" + [ -z "$shell" ] && shell="/sbin/nologin" + [ -z "$descr" ] && descr="${_uname} unprivileged user" + [ -n "$groups" ] && user_groups="-G $groups" + + [ "${_uid}" != "${_uname}" ] && + use_id="-u ${_uid} -g ${pgroup:-${_uid}}" + + if [ -z "$USERADD" -a -z "$GETENT" -a -z "$PASSWD" ]; then + echo "WARNING: cannot create ${acct} system user/group (missing useradd/getent/passwd)" + echo "The following system account must be created:" + echo " Account: ${uname:-${_uid}} (uid: '${_uid}')" + echo " Description: '${descr}'" + echo " Homedir: '${homedir}'" + echo " Shell: '${shell}'" + echo " Additional groups: '${groups}'" + continue + fi + + group_add ${pgroup:-${acct}} + + if ! getent passwd ${_uname} >/dev/null; then + useradd -c "$descr" -d "$homedir" -s "$shell" ${user_groups} \ + ${pgroup:+-N} ${use_id:=-g ${pgroup:-${_uname}}} -r ${_uname} && \ + passwd -l ${_uname} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "Created ${_uname} (${_uid}) system user." + else + echo "Failed to create ${acct} system user!" + exit 1 + fi + else + if [ -z "$USERMOD" ]; then + echo "WARNING: cannot update ${acct} system user/group (missing usermod)" + continue + fi + usermod -c "${descr}" -d "${homedir}" -s "${shell}" ${user_groups} \ + -g "${pgroup:-${_uname}}" ${_uname} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "Updated ${_uname} (${_uid}) system user." + else + echo "Failed to update ${acct} system user!" + exit 1 + fi + fi + done + ;; + pre-remove) + if [ "$UPDATE" = "no" ]; then + for acct in ${system_accounts}; do + _uname="${acct%:*}" + _uid="${acct#*:}" + comment="$(getent passwd "${_uname}" |cut -d: -f5 |head -n1) - for uninstalled package ${PKGNAME}" + if [ -z "$USERMOD" ]; then + echo "WARNING: cannot disable ${acct} system user/group (missing usermod)" + continue + fi + usermod -L -d /var/empty -s /bin/false -c "${comment}" ${_uname} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "Disabled ${_uname} (${_uid}) system user/group." + fi + done + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/texmf-dist b/srcpkgs/xbps-triggers/files/texmf-dist @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Updates texmf-dist hashes and format library. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +texhash=usr/bin/texhash +fmtutil=usr/bin/fmtutil-sys + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + if [ -x ${texhash} ]; then + echo "Updating texmf-dist hashes..." + ${texhash} 2>&1 >/dev/null || true # silence strange errors + fi + if [ -x ${fmtutil} ]; then + echo "Updating texmf-dist formats..." + ${fmtutil} --all >/dev/null || true + fi + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/update-desktopdb b/srcpkgs/xbps-triggers/files/update-desktopdb @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Updates the MIME database that connects with applications, through +# the update-desktop-database(1) utility. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +desktopdb_bin=usr/bin/update-desktop-database +desktopdb_dir=usr/share/applications +desktopdb_cache=${desktopdb_dir}/mimeinfo.cache + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "desktop-file-utils" ]; then + [ -f ${desktopdb_cache} ] && rm -f ${desktopdb_cache} + exit 0 + fi + case "$TARGET" in + post-*) + if [ ! -x $desktopdb_bin ]; then + exit 0 + fi + + if [ -d $desktopdb_dir ]; then + echo "Updating MIME database..." + ${desktopdb_bin} ${desktopdb_dir} + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/x11-fonts b/srcpkgs/xbps-triggers/files/x11-fonts @@ -0,0 +1,57 @@ +#!/bin/sh +# +# This trigger rebuilds the fonts.dir and fonts.scale files +# for packages that install X11 fonts, and update fontconfig's +# cache for those fonts. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +mkfontdir=usr/bin/mkfontdir +mkfontscale=usr/bin/mkfontscale +fccache=usr/bin/fc-cache + +case "$ACTION" in +targets) + echo "post-install post-remove" + ;; +run) + if [ ! -x $mkfontdir ]; then + exit 0 + fi + + if [ ! -x $mkfontscale ]; then + exit 0 + fi + + [ -z "${font_dirs}" ] && exit 0 + + case "$TARGET" in + post-install|post-remove) + for dir in ${font_dirs}; do + echo "Building ${dir}/fonts.dir..." + ${mkfontdir} .${dir} + echo "Building ${dir}/fonts.scale..." + ${mkfontscale} .${dir} + echo "Updating fontconfig's cache..." + ${fccache} -f .${dir} + done + ;; + esac + + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/files/xml-catalog b/srcpkgs/xbps-triggers/files/xml-catalog @@ -0,0 +1,96 @@ +#!/bin/sh +# +# Registers or unregisters SGML/XML catalog entries, through +# the xmlcatmgr application. +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +sgml_catalog=usr/share/sgml/catalog +xml_catalog=usr/share/xml/catalog + +xmlcatmgr=usr/bin/xmlcatmgr + +register_entries() +{ + if [ -n "${sgml_entries}" ]; then + echo -n "Registering SGML catalog entries... " + set -- ${sgml_entries} + while [ $# -gt 0 ]; do + $xmlcatmgr -sc ${sgml_catalog} add "$1" "$2" "$3" + shift; shift; shift; + done + echo "done." + fi + + if [ -n "${xml_entries}" ]; then + echo -n "Registering XML catalog entries... " + set -- ${xml_entries} + while [ $# -gt 0 ]; do + $xmlcatmgr -c ${xml_catalog} add "$1" "$2" "$3" + shift; shift; shift; + done + echo "done." + fi +} + +unregister_entries() +{ + if [ -n "${sgml_entries}" ]; then + echo -n "Unregistering SGML catalog entries... " + set -- ${sgml_entries} + while [ $# -gt 0 ]; do + $xmlcatmgr -sc ${sgml_catalog} remove "$1" "$2" \ + 2>/dev/null + shift; shift; shift + done + echo "done." + fi + if [ -n "${xml_entries}" ]; then + echo -n "Unregistering XML catalog entries... " + set -- ${xml_entries} + while [ $# -gt 0 ]; do + $xmlcatmgr -c ${xml_catalog} remove "$1" "$2" \ + 2>/dev/null + shift; shift; shift + done + echo "done." + fi +} + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + [ ! -x $xmlcatmgr ] && exit 0 + [ -n "${sgml_entries}" -a ! -f "${sgml_catalog}" ] && exit 0 + [ -n "${xml_entries}" -a ! -f "${xml_catalog}" ] && exit 0 + + case "$TARGET" in + post-install) + register_entries + ;; + pre-remove) + unregister_entries + ;; + *) + exit 1 + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template @@ -0,0 +1,23 @@ +# Template file for 'xbps-triggers' +pkgname=xbps-triggers +version=0.115 +revision=1 +archs=noarch +bootstrap=yes +short_desc="XBPS triggers for Void Linux" +maintainer="Enno Boland <gottox@voidlinux.org>" +license="Public Domain" +homepage="https://voidlinux.org" + +do_install() { + _triggersdir=usr/libexec/${pkgname} + + for f in ${FILESDIR}/*; do + _trigger=$(basename $f) + vinstall ${FILESDIR}/${_trigger} 750 ${_triggersdir} + echo "# end" >> ${DESTDIR}/${_triggersdir}/${_trigger} + done + vmkdir var/db/xbps + cd ${DESTDIR}/var/db/xbps + ln -sf ../../../${_triggersdir} triggers +}