xbps-src: remove the triggers, they will be handled by the xbps-triggers pkg.
This commit is contained in:
parent
38081de483
commit
7f522a8cf4
19 changed files with 2 additions and 1038 deletions
|
@ -1,7 +1,7 @@
|
|||
include vars.mk
|
||||
|
||||
BINS = xbps-src
|
||||
SUBDIRS = etc common libexec helpers triggers shutils
|
||||
SUBDIRS = etc common libexec helpers shutils
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
|
|
|
@ -29,7 +29,6 @@ set_defvars()
|
|||
|
||||
instsharedir=@@XBPS_INSTALL_SHAREDIR@@
|
||||
|
||||
: ${XBPS_TRIGGERSDIR:=$instsharedir/triggers}
|
||||
: ${XBPS_HELPERSDIR:=$instsharedir/helpers}
|
||||
: ${XBPS_SHUTILSDIR:=$instsharedir/shutils}
|
||||
: ${XBPS_COMMONVARSDIR:=$instsharedir/common}
|
||||
|
@ -41,6 +40,7 @@ set_defvars()
|
|||
: ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/pkg-binpkgs}
|
||||
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/pkg-builddir}
|
||||
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/pkg-srcdistdir}
|
||||
: ${XBPS_TRIGGERSDIR:=$XBPS_SRCPKGDIR/xbps-triggers/files}
|
||||
|
||||
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
|
||||
DDIRS="$DDIRS DISTRIBUTIONDIR"
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
include ../vars.mk
|
||||
|
||||
TRIGGERS= gtk-icon-cache info-files mimedb register-shell
|
||||
TRIGGERS+= xml-catalog gtk-immodules initramfs-tools openrc-service
|
||||
TRIGGERS+= update-desktopdb gtk-pixbuf-loaders pango-modules x11-fonts
|
||||
TRIGGERS+= system-accounts gconf-schemas gio-modules gsettings-schemas
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
install -d $(DESTDIR)$(SHAREDIR)/triggers
|
||||
install -m 755 $(TRIGGERS) $(DESTDIR)$(SHAREDIR)/triggers
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
-rm -rf $(DESTDIR)$(SHAREDIR)/triggers
|
|
@ -1,92 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# (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
|
||||
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
|
||||
${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
|
||||
${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
|
||||
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
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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
|
|
@ -1,57 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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-*)
|
||||
# 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
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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
|
||||
break
|
||||
fi
|
||||
case "$TARGET" in
|
||||
post-*)
|
||||
for dir in ${gtk_iconcache_dirs}; do
|
||||
if [ -x ${iconcache_bin} ]; then
|
||||
echo -n "Updating GTK+ icon cache for "
|
||||
echo "${dir}..."
|
||||
${iconcache_bin} -q -f -t ${dir}
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,43 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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_db=etc/gtk-2.0/gtk.immodules
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then
|
||||
[ -f ${immodules_db} ] rm -f ${immodules_db}
|
||||
break
|
||||
fi
|
||||
case "$TARGET" in
|
||||
post-*)
|
||||
if [ -x ${immodules_bin} ]; then
|
||||
echo "Updating GTK's immodules database..."
|
||||
${immodules_bin} > ${immodules_db}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gdk-pixbuf" ]; then
|
||||
_cache_file=$(${pixbuf_bin} --print-cache-file)
|
||||
[ -f .${_cache_file} ] && rm -f .${_cache_file}
|
||||
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
|
|
@ -1,58 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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
|
||||
[ "$f" = "/usr/share/info/dir" ] && continue
|
||||
|
||||
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
|
|
@ -1,72 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# Runs update-initramfs(8) to create/update an initramfs for specified
|
||||
# version (if the pkg that is triggering it) or for the currently
|
||||
# installed kernel otherwise.
|
||||
#
|
||||
# Arguments: $ACTION = [run/targets]
|
||||
# $TARGET = [post-install/post-remove]
|
||||
# $PKGNAME
|
||||
# $VERSION
|
||||
# $UPDATE = [yes/no]
|
||||
#
|
||||
ACTION="$1"
|
||||
TARGET="$2"
|
||||
PKGNAME="$3"
|
||||
VERSION="$4"
|
||||
UPDATE="$5"
|
||||
|
||||
update_initramfs=usr/sbin/update-initramfs
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
[ ! -x ${update_initramfs} ] && exit 0
|
||||
|
||||
if [ "$PKGNAME" = "kernel" ]; then
|
||||
if [ "$TARGET" = "post-remove" ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f var/lib/initramfs-tools/${VERSION} ]; then
|
||||
# Create new initramfs
|
||||
initramfs_args="-B -c -t -k ${VERSION}"
|
||||
else
|
||||
# Update existing initramfs
|
||||
initramfs_args="-B -u -t -k ${VERSION}"
|
||||
fi
|
||||
else
|
||||
# Update initramfs for all kernels
|
||||
initramfs_args="-B -u -t -k all"
|
||||
fi
|
||||
|
||||
if [ ! -e /proc/filesystems ]; then
|
||||
mount -t proc proc /proc
|
||||
proc_mounted=1
|
||||
fi
|
||||
|
||||
if [ ! -e /sys/kernel/vmcoreinfo ]; then
|
||||
mount -t sysfs sysfs /sys
|
||||
sys_mounted=1
|
||||
fi
|
||||
|
||||
${update_initramfs} ${initramfs_args}
|
||||
|
||||
if [ -x usr/sbin/grub-mkconfig ]; then
|
||||
usr/sbin/grub-mkconfig -o boot/grub/grub.cfg
|
||||
fi
|
||||
|
||||
if [ -n "$proc_mounted" ]; then
|
||||
umount /proc
|
||||
fi
|
||||
if [ -n "$sys_mounted" ]; then
|
||||
umount /sys
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,38 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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
|
||||
echo "Updating shared-mime-info database..."
|
||||
${mimedb_bin} usr/share/mime > /dev/null
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,117 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Registers or unregisters OpenRC services into the specified
|
||||
# runlevel. This works by specifying three arguments as follows:
|
||||
#
|
||||
# service_name runlevel register
|
||||
# --------------------------------------------------
|
||||
# dbus default boolean
|
||||
# --------------------------------------------------
|
||||
#
|
||||
# Arguments: $ACTION = [run/targets]
|
||||
# $TARGET = [post-install/pre-remove]
|
||||
# $PKGNAME
|
||||
# $VERSION
|
||||
# $UPDATE = [yes/no]
|
||||
#
|
||||
ACTION="$1"
|
||||
TARGET="$2"
|
||||
PKGNAME="$3"
|
||||
VERSION="$4"
|
||||
UPDATE="$5"
|
||||
|
||||
initdir=etc/init.d
|
||||
metadatadir=var/db/xbps/metadata/${PKGNAME}
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install pre-remove"
|
||||
;;
|
||||
run)
|
||||
[ ! -x sbin/rc-update ] && exit 0
|
||||
[ ! -x sbin/rc-service ] && exit 0
|
||||
[ -z "$openrc_services" ] && exit 1
|
||||
|
||||
if [ "$TARGET" = "pre-remove" ]; then
|
||||
rcupdate_args="del"
|
||||
elif [ "$TARGET" = "post-install" ]; then
|
||||
rcupdate_args="add"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ ! -f etc/fstab ] && touch etc/fstab
|
||||
|
||||
set -- ${openrc_services}
|
||||
while [ $# -gt 0 ]; do
|
||||
unset skip_service
|
||||
srv_restart=$metadatadir/.$1_srv_restart
|
||||
if [ "$TARGET" = "post-install" ]; then
|
||||
# The service shouldn't be registered, so just show a message
|
||||
# explaining how to add it in the future.
|
||||
case "$3" in
|
||||
[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff]|0)
|
||||
skip_service=1
|
||||
;;
|
||||
[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
|
||||
unset skip_service
|
||||
;;
|
||||
esac
|
||||
if [ -n "$skip_service" ]; then
|
||||
cat <<_EOF
|
||||
================================================================
|
||||
|
||||
The system service '${1}' won't be added into the runlevel
|
||||
'${2}' by default, so it will remain disabled at boot.
|
||||
|
||||
To start it at boot time, use the following command:
|
||||
|
||||
$ rc-update add ${1} ${2}
|
||||
|
||||
To disable it again use:
|
||||
|
||||
$ rc-update del ${1} ${2}
|
||||
|
||||
================================================================
|
||||
_EOF
|
||||
shift; shift; shift;
|
||||
continue
|
||||
else
|
||||
echo "Registering '${1}' service to start at boot."
|
||||
fi
|
||||
if [ -f $srv_restart ]; then
|
||||
# Restart service if it was running previously.
|
||||
$initdir/$1 start
|
||||
rm -f $srv_restart
|
||||
else
|
||||
# Register service.
|
||||
if sbin/rc-service -e ${1}; then
|
||||
sbin/rc-update add ${1} ${2}
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# While removing always stop the service if running.
|
||||
$initdir/$1 -q status
|
||||
if [ $? -eq 0 ]; then
|
||||
$initdir/$1 stop
|
||||
fi
|
||||
#
|
||||
# While upgrading a package, don't remove the service.
|
||||
#
|
||||
if [ "$UPDATE" = "yes" ]; then
|
||||
touch -f $srv_restart
|
||||
else
|
||||
# Unregister the service.
|
||||
sbin/rc-update del ${1} ${2}
|
||||
fi
|
||||
fi
|
||||
unset srv_restart
|
||||
shift; shift; shift;
|
||||
done
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,46 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# Updates the list of pango modules with pango-querymodules(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"
|
||||
|
||||
pango_bin=usr/bin/pango-querymodules
|
||||
pango_modules=etc/pango/pango.modules
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install 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
|
||||
case "$TARGET" in
|
||||
post-*)
|
||||
if [ -x ${pango_bin} ]; then
|
||||
echo "Updating pango modules file..."
|
||||
${pango_bin} > ${pango_modules}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,66 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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 -q $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
|
|
@ -1,84 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# (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"
|
||||
|
||||
useradd_cmd=usr/sbin/useradd
|
||||
userdel_cmd=usr/sbin/userdel
|
||||
groupadd_cmd=usr/sbin/groupadd
|
||||
passwd_cmd=usr/bin/passwd
|
||||
getent_cmd=usr/bin/getent
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install pre-remove"
|
||||
;;
|
||||
run)
|
||||
if [ ! -x $useradd_cmd -a ! -x $groupadd_cmd -a ! -x $passwd_cmd \
|
||||
-a ! -x $getent_cmd ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$system_accounts" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$TARGET" in
|
||||
post-install)
|
||||
for acct in ${system_accounts}; do
|
||||
eval homedir="\$${acct}_homedir"
|
||||
eval shell="\$${acct}_shell"
|
||||
eval descr="\$${acct}_descr"
|
||||
eval groups="\$${acct}_groups"
|
||||
[ -z "$homedir" ] && homedir="/"
|
||||
[ -z "$shell" ] && shell="/sbin/nologin"
|
||||
[ -z "$descr" ] && descr="$acct unpriviledged user"
|
||||
[ -n "$groups" ] && groups="-G $groups"
|
||||
|
||||
if ! $getent_cmd group ${acct} >/dev/null; then
|
||||
$groupadd_cmd -r ${acct} \
|
||||
2>&1 >/dev/null || exit $?
|
||||
echo "Created ${acct} system group."
|
||||
fi
|
||||
if ! $getent_cmd passwd ${acct} >/dev/null; then
|
||||
$useradd_cmd -c "$descr" -d "$homedir" \
|
||||
-s "$shell" -g ${acct} $groups \
|
||||
-r ${acct} && \
|
||||
$passwd_cmd -l ${acct} \
|
||||
2>&1 >/dev/null || exit $?
|
||||
echo "Created ${acct} system user."
|
||||
fi
|
||||
done
|
||||
;;
|
||||
pre-remove)
|
||||
#
|
||||
# Only unregister if we aren't updating a package.
|
||||
#
|
||||
if [ "$UPDATE" = "no" ]; then
|
||||
for acct in ${system_accounts}; do
|
||||
$userdel_cmd ${acct} 2>&1 >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Removed ${acct} system user/group."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,45 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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}
|
||||
break
|
||||
fi
|
||||
case "$TARGET" in
|
||||
post-*)
|
||||
if [ -x ${desktopdb_bin} ]; then
|
||||
echo "Updating MIME database..."
|
||||
${desktopdb_bin} ${desktopdb_dir}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,66 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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 pre-remove"
|
||||
;;
|
||||
run)
|
||||
if [ ! -x ${mkfontdir} -a ! -x ${mkfontscale} ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[ -z "${font_dirs}" ] && exit 0
|
||||
|
||||
case "$TARGET" in
|
||||
post-install)
|
||||
for dir in ${font_dirs}; do
|
||||
echo "Building ${dir}/fonts.dir..."
|
||||
${mkfontdir} .${dir} || exit $?
|
||||
echo "Building ${dir}/fonts.scale..."
|
||||
${mkfontscale} .${dir} || exit $?
|
||||
echo "Updating fontconfig's cache..."
|
||||
${fccache} .${dir} 2>/dev/null
|
||||
done
|
||||
;;
|
||||
pre-remove)
|
||||
for dir in ${font_dirs}; do
|
||||
if [ -f .${dir}/fonts.dir ]; then
|
||||
rm -f .${dir}/fonts.dir
|
||||
fi
|
||||
if [ -f .${dir}/fonts.scale ]; then
|
||||
rm -f .${dir}/fonts.scale
|
||||
fi
|
||||
if [ -f .${dir}/encodings.dir ]; then
|
||||
rm -f .${dir}/encodings.dir
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,94 +0,0 @@
|
|||
#!/bin/sh -e
|
||||
#
|
||||
# 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
|
||||
|
||||
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
|
Loading…
Reference in a new issue