desktop-file-utils: simplify hooks
This commit is contained in:
parent
13efba8427
commit
e1e97fc99c
|
@ -3,13 +3,18 @@ TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||||
TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/desktop-file-utils
|
TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/desktop-file-utils
|
||||||
TERMUX_PKG_DESCRIPTION="Command line utilities for working with desktop entries"
|
TERMUX_PKG_DESCRIPTION="Command line utilities for working with desktop entries"
|
||||||
TERMUX_PKG_VERSION=0.23
|
TERMUX_PKG_VERSION=0.23
|
||||||
TERMUX_PKG_REVISION=9
|
TERMUX_PKG_REVISION=10
|
||||||
TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${TERMUX_PKG_VERSION}.tar.xz
|
TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${TERMUX_PKG_VERSION}.tar.xz
|
||||||
TERMUX_PKG_SHA256=6c094031bdec46c9f621708f919084e1cb5294e2c5b1e4c883b3e70cb8903385
|
TERMUX_PKG_SHA256=6c094031bdec46c9f621708f919084e1cb5294e2c5b1e4c883b3e70cb8903385
|
||||||
TERMUX_PKG_DEPENDS="glib"
|
TERMUX_PKG_DEPENDS="glib"
|
||||||
|
|
||||||
termux_step_create_debscripts() {
|
termux_step_create_debscripts() {
|
||||||
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
|
for i in postinst postrm triggers; do
|
||||||
cp "${TERMUX_PKG_BUILDER_DIR}/postrm" ./
|
sed \
|
||||||
cp "${TERMUX_PKG_BUILDER_DIR}/triggers" ./
|
"s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \
|
||||||
|
"${TERMUX_PKG_BUILDER_DIR}/hooks/${i}.in" > ./${i}
|
||||||
|
chmod 755 ./${i}
|
||||||
|
done
|
||||||
|
unset i
|
||||||
|
chmod 644 ./triggers
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!@TERMUX_PREFIX@/bin/sh
|
||||||
|
|
||||||
|
if [ -d "@TERMUX_PREFIX@/share/applications" ]; then
|
||||||
|
update-desktop-database -q
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!@TERMUX_PREFIX@/bin/sh
|
||||||
|
|
||||||
|
if [ "${1}" = "remove" ]; then
|
||||||
|
if [ -d "@TERMUX_PREFIX@/share/applications" ]; then
|
||||||
|
rm -f "@TERMUX_PREFIX@/share/applications/mimeinfo.cache"
|
||||||
|
rmdir --ignore-fail-on-non-empty "@TERMUX_PREFIX@/share/applications"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1 @@
|
||||||
|
interest-noawait @TERMUX_PREFIX@/share/applications
|
|
@ -1,10 +0,0 @@
|
||||||
#!/data/data/com.termux/files/usr/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ -d "/data/data/com.termux/files/usr/share/applications" ]; then
|
|
||||||
update-desktop-database -q
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${1}" = "triggered" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/data/data/com.termux/files/usr/bin/sh
|
|
||||||
set -e
|
|
||||||
APPDIR="/data/data/com.termux/files/usr/share/applications"
|
|
||||||
|
|
||||||
if [ "${1}" = "remove" ]; then
|
|
||||||
if [ -d "${APPDIR}" ]; then
|
|
||||||
rm -f "${APPDIR}/mimeinfo.cache"
|
|
||||||
if [ ! -L "${APPDIR}" ]; then
|
|
||||||
rmdir --ignore-fail-on-non-empty "${APPDIR}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -1 +0,0 @@
|
||||||
interest-noawait /data/data/com.termux/files/usr/share/applications
|
|
Loading…
Reference in New Issue