From 63917944c1963c7a1f023eda5436141145045078 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Sun, 8 May 2022 15:39:43 +0900 Subject: [PATCH] new package: update-info-dir --- packages/update-info-dir/build.sh | 36 +++++++++++++++++++ .../update-info-dir/update-info-dir.8.patch | 11 ++++++ .../update-info-dir/update-info-dir.patch | 35 ++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 packages/update-info-dir/build.sh create mode 100644 packages/update-info-dir/update-info-dir.8.patch create mode 100644 packages/update-info-dir/update-info-dir.patch diff --git a/packages/update-info-dir/build.sh b/packages/update-info-dir/build.sh new file mode 100644 index 000000000..faece2ca9 --- /dev/null +++ b/packages/update-info-dir/build.sh @@ -0,0 +1,36 @@ +TERMUX_PKG_HOMEPAGE=https://packages.debian.org/sid/texinfo +TERMUX_PKG_DESCRIPTION="Update or create index file from all installed info files in directory" +TERMUX_PKG_LICENSE="GPL-2.0, GPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=6.8-4 +TERMUX_PKG_SRCURL=https://deb.debian.org/debian/pool/main/t/texinfo/texinfo_${TERMUX_PKG_VERSION}.debian.tar.xz +TERMUX_PKG_SHA256=1194b3f1a9480f1796fdf92fb366b02d855a17f8873ec5daa4b6befe51d69f57 +TERMUX_PKG_PLATFORM_INDEPENDENT=true +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_make_install() { + install -Dm700 -t $TERMUX_PREFIX/bin update-info-dir + install -Dm600 -t $TERMUX_PREFIX/share/man/man8 update-info-dir.8 +} + +termux_step_create_debscripts() { + local INFODIR=$TERMUX_PREFIX/share/info + + cat <<- EOF > ./triggers + interest-noawait $INFODIR + EOF + + cat <<- EOF > ./postinst + #!$TERMUX_PREFIX/bin/sh + if [ -d $INFODIR ]; then + $TERMUX_PREFIX/bin/update-info-dir + fi + exit 0 + EOF + + cat <<- EOF > ./prerm + #!$TERMUX_PREFIX/bin/sh + rm -rf $INFODIR/dir + exit 0 + EOF +} diff --git a/packages/update-info-dir/update-info-dir.8.patch b/packages/update-info-dir/update-info-dir.8.patch new file mode 100644 index 000000000..65865c901 --- /dev/null +++ b/packages/update-info-dir/update-info-dir.8.patch @@ -0,0 +1,11 @@ +--- a/update-info-dir.8 ++++ b/update-info-dir.8 +@@ -13,7 +13,7 @@ + Update, or create, the index file + .I dir + of available documentation in +-/usr/share/info/ (the default) or in given DIRECTORY. The ++@TERMUX_PREFIX@/share/info/ (the default) or in given DIRECTORY. The + index file + .I info + is the directory is usually presented by info browsers on startup. diff --git a/packages/update-info-dir/update-info-dir.patch b/packages/update-info-dir/update-info-dir.patch new file mode 100644 index 000000000..d865acfda --- /dev/null +++ b/packages/update-info-dir/update-info-dir.patch @@ -0,0 +1,35 @@ +--- a/update-info-dir ++++ b/update-info-dir +@@ -4,7 +4,7 @@ + # Copyright 2009, 2014 Norbert Preining + # GPLv2 + +-INFODIR=/usr/share/info ++INFODIR=@TERMUX_PREFIX@/share/info + + set -e + +@@ -14,13 +14,7 @@ + # the dir file. Unset LANGUAGE and reload /etc/environment to get + # the system wide settings. See bug #536476 + unset LANGUAGE +-unset LANG +-if [ -r /etc/environment ] ; then +- . /etc/environment +-fi +-if [ -r /etc/default/locale ] ; then +- . /etc/default/locale +-fi ++export LANG=C.UTF-8 + + Help () + { +@@ -28,7 +22,7 @@ + SYNOPSIS: update-info-dir [-h,--help] [info-directory] + + (re-)creates the index of available documentation in info format +-(the file /usr/share/info/dir) which is usually presented by info browsers ++(the file @TERMUX_PREFIX@/share/info/dir) which is usually presented by info browsers + on startup." + + exit 0