summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkj_sh6042026-01-13 22:08:40 -0500
committerkj_sh6042026-01-13 22:08:40 -0500
commit3aff57ede42925942e43baf51b166137f60ce6de (patch)
tree9a1483f03d42dd3b6d71cf75e5a54054d1be5018
parenta5ab6d341027c23c053de17d129ebc48c6dca9db (diff)
feat: add `arch` wrapper script
-rw-r--r--kj-arch-bin-wrapper/.SRCINFO10
-rw-r--r--kj-arch-bin-wrapper/.gitignore3
-rw-r--r--kj-arch-bin-wrapper/PKGBUILD74
3 files changed, 87 insertions, 0 deletions
diff --git a/kj-arch-bin-wrapper/.SRCINFO b/kj-arch-bin-wrapper/.SRCINFO
new file mode 100644
index 0000000..75ae75f
--- /dev/null
+++ b/kj-arch-bin-wrapper/.SRCINFO
@@ -0,0 +1,10 @@
+pkgbase = kj-arch-bin-wrapper
+ pkgdesc = kj_sh604's wrapper script for arch command (uname -m)
+ pkgver = 2026.01.13.2206
+ pkgrel = 1
+ url = https://www.gnu.org/software/coreutils/coreutils.html
+ arch = any
+ license = 0BSD
+ depends = coreutils
+
+pkgname = kj-arch-bin-wrapper
diff --git a/kj-arch-bin-wrapper/.gitignore b/kj-arch-bin-wrapper/.gitignore
new file mode 100644
index 0000000..0effd57
--- /dev/null
+++ b/kj-arch-bin-wrapper/.gitignore
@@ -0,0 +1,3 @@
+pkg/
+src/
+*.tar* \ No newline at end of file
diff --git a/kj-arch-bin-wrapper/PKGBUILD b/kj-arch-bin-wrapper/PKGBUILD
new file mode 100644
index 0000000..9441485
--- /dev/null
+++ b/kj-arch-bin-wrapper/PKGBUILD
@@ -0,0 +1,74 @@
+pkgname=kj-arch-bin-wrapper
+pkgver=$(date +%Y.%m.%d.%H%M)
+pkgrel=1
+pkgdesc="kj_sh604's wrapper script for arch command (uname -m)"
+arch=('any')
+url="https://www.gnu.org/software/coreutils/coreutils.html"
+license=('0BSD')
+depends=('coreutils')
+
+pkgver() {
+ date +%Y.%m.%d.%H%M
+}
+
+package() {
+ install -dm755 "$pkgdir/usr/bin"
+ cat > "$pkgdir/usr/bin/arch" << 'EOF'
+#!/bin/sh
+VERSION=$(date +%Y.%m.%d.%H%M)
+
+case "$1" in
+ --help)
+ cat << 'HELP'
+usage: arch [OPTION]...
+print machine architecture.
+
+ --help display this help and exit
+ --version display version information
+HELP
+ exit 0
+ ;;
+ --version)
+ echo "arch $VERSION"
+ echo "licensed under the BSD Zero Clause License (0BSD)"
+ exit 0
+ ;;
+ "")
+ # No arguments - just run uname -m
+ exec uname -m
+ ;;
+ *)
+ echo "arch: invalid option -- '$1'" >&2
+ echo "try 'arch --help' for more information" >&2
+ exit 1
+ ;;
+esac
+EOF
+
+ chmod 755 "$pkgdir/usr/bin/arch"
+
+ install -dm755 "$pkgdir/usr/share/man/man1"
+ cat > "$pkgdir/usr/share/man/man1/arch.1" << 'MANPAGE'
+.TH ARCH 1 "kj-arch-bin-wrapper" "User Commands"
+.SH NAME
+arch \- print machine hardware name (same as uname \-m)
+.SH SYNOPSIS
+.B arch
+[\fIOPTION\fR]...
+.SH DESCRIPTION
+print machine architecture.
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-\-version\fR
+display version information
+.SH AUTHOR
+wrapper script created by the `kj-arch-bin-wrapper` package.
+.SH SEE ALSO
+.BR uname (1),
+.BR uname (2)
+MANPAGE
+}
+
+# vim:set ts=2 sw=2 et: \ No newline at end of file