diff --git a/shfmt/.footprint b/shfmt/.footprint new file mode 100644 index 000000000..15cf5b356 --- /dev/null +++ b/shfmt/.footprint @@ -0,0 +1,3 @@ +drwxr-xr-x root/root usr/ +drwxr-xr-x root/root usr/bin/ +-rwxr-xr-x root/root usr/bin/shfmt diff --git a/shfmt/.signature b/shfmt/.signature new file mode 100644 index 000000000..21afb0735 --- /dev/null +++ b/shfmt/.signature @@ -0,0 +1,5 @@ +untrusted comment: verify with /etc/ports/contrib.pub +RWSagIOpLGJF3w1nSyzxTwMR6D3Lg3oqHtsTrtKWBP7SiP1zkDxuHCiE91cMjImOT1AV0LYyUToBcy9LbupevAjA1rzbKdcmTQw= +SHA256 (Pkgfile) = 4379dd20a6670932d4d03d96d7f9eb4f0250c631219bb9b7f2dc72fec274eefe +SHA256 (.footprint) = e76b7841309fdb6e5426809ab65c17f8b3f56ace07ad3811e7110236b2a2043c +SHA256 (shfmt-3.7.0.tar.gz) = 89eafc8790df93305dfa42233e262fb25e1c96726a3db420a7555abadf3111ed diff --git a/shfmt/Pkgfile b/shfmt/Pkgfile new file mode 100644 index 000000000..7ec5983d4 --- /dev/null +++ b/shfmt/Pkgfile @@ -0,0 +1,35 @@ +# Description: A shell parser, formatter, and interpreter with bash support +# URL: https://github.com/mvdan/sh +# Maintainer: Tim Biermann, tbier at posteo dot de +# Depends on: go +# Optional: scdoc + +name=shfmt +version=3.7.0 +release=1 +source=(https://github.com/mvdan/sh/archive/v$version/$name-$version.tar.gz) + +build() { + cd sh-$version/cmd/shfmt + + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + + mkdir "$PKGMK_SOURCE_DIR/gopath" || true + export GOPATH="$PKGMK_SOURCE_DIR/gopath" + + go build \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -o shfmt . + + install -Dm755 shfmt $PKG/usr/bin/shfmt + if prt-get isinst scdoc; then + scdoc < shfmt.1.scd | gzip > shfmt.1.gz + install -Dm644 -t $PKG/usr/share/man/man1/ shfmt.1.gz + fi +}