diff --git a/Manual.md b/Manual.md index 584ab879bf7..f7fd6fa104d 100644 --- a/Manual.md +++ b/Manual.md @@ -166,6 +166,36 @@ The optional 4th argument can be used to change the `file name`. Creates a directory in the pkg `$DESTDIR`. The 2nd optional argument sets the mode of the directory. +- *vbin()* `vbin []` + + Installs `file` into usr/bin in the pkg `$DESTDIR` with the + permissions 0755. The optional 2nd argument can be used to change + the `file name`. + +- *vman()* `vman
[]` + + Installs `file` into usr/share/man/
in the pkg + `$DESTDIR`. The optional 3rd argument can be used to change the + `file name`. + +- *vdoc()* `vdoc []` + + Installs `file` into usr/share/doc/ in the pkg + `$DESTDIR`. The optional 2nd argument can be used to change the + `file name`. + +- *vsconf()* `vsconf []` + + Installs `file` into usr/share/examples/ in the pkg + `$DESTDIR`. The optional 2nd argument can be used to change the + `file name`. + +- *vlicense()* `vlicense []` + + Installs `file` into usr/share/licenses/ in the pkg + `$DESTDIR`. The optional 2nd argument can be used to change the + `file name`. + > Shell wildcards must be properly quoted, i.e `vmove "usr/lib/*.a"`. ### Global variables diff --git a/common/helpers/install.sh b/common/helpers/install.sh index 0546f0b7a1b..f62ea5de946 100644 --- a/common/helpers/install.sh +++ b/common/helpers/install.sh @@ -13,10 +13,66 @@ _noglob_helper() { } # Apply _noglob to v* commands -for cmd in vinstall vcopy vmove vmkdir; do +for cmd in vinstall vcopy vmove vmkdir vbin vman vdoc vsconf vlicense; do alias ${cmd}="set -f; _noglob_helper _${cmd}" done +_vbin() { + local file="$1" targetfile="$2" + + if [ $# -lt 1 ]; then + msg_red "$pkgver: vbin: 1 argument expected: \n" + return 1 + fi + + vinstall "$file" 755 usr/bin "$targetfile" +} + +_vman() { + local file="$1" section="$2" targetfile="$3" + + if [ $# -lt 2 ]; then + msg_red "$pkgver: vman: 2 arguments expected:
\n" + return 1 + fi + + vmkdir "usr/share/man/${section}" + vinstall "$file" 644 "usr/share/man/${section}" "$3" +} + +_vdoc() { + local file="$1" targetfile="$2" + + if [ $# -lt 1 ]; then + msg_red "$pkgver: vdoc: 1 argument expected: \n" + return 1 + fi + + vinstall "$file" 644 "usr/share/doc/${pkgname}" "$targetfile" +} + +_vsconf() { + local file="$1" targetfile="$2" + + if [ $# -lt 1 ]; then + msg_red "$pkgver: vsconf: 1 argument expected: \n" + return 1 + fi + + vinstall "$file" 644 "usr/share/examples/${pkgname}" "$targetfile" +} + +_vlicense() { + local file="$1" targetfile="$2" + + if [ $# -lt 1 ]; then + msg_red "$pkgver: vlicense: 1 argument expected: \n" + return 1 + fi + + vinstall "$file" 644 "usr/share/licenses/${pkgname}" "$targetfile" +} + _vinstall() { local file="$1" mode="$2" targetdir="$3" targetfile="$4" local _destdir=