blob: 9441485e6e9785e510114b03435a22d83de6a1a8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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:
|