2022-05-19 14:12:17 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
PRGNAM=$(basename "$CWD")
|
2022-05-19 14:12:17 +02:00
|
|
|
|
GITHUB_REPO=gohugoio/hugo
|
|
|
|
|
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/tags | jq -r '.[0].name' | tr -d v)}
|
2024-02-27 13:04:08 +01:00
|
|
|
|
FLAVOR=${FLAVOR:-_extended}
|
2022-05-19 14:12:17 +02:00
|
|
|
|
ARCH=$(uname -m)
|
2024-02-27 13:04:08 +01:00
|
|
|
|
BUILD=${BUILD:-2}
|
2022-05-19 14:12:17 +02:00
|
|
|
|
TAG=${TAG:-gwh}
|
2024-02-27 13:04:08 +01:00
|
|
|
|
|
2022-05-19 14:12:17 +02:00
|
|
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
|
|
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
mkdir -p "$REPOSITORY"
|
2022-05-19 14:12:17 +02:00
|
|
|
|
|
|
|
|
|
HUGO_ARCH="64bit"
|
|
|
|
|
case $(uname -m) in
|
|
|
|
|
"x86_64")
|
2024-02-27 13:04:08 +01:00
|
|
|
|
HUGO_ARCH="64bit"
|
|
|
|
|
;;
|
2022-05-19 14:12:17 +02:00
|
|
|
|
"aarch64")
|
2024-02-27 13:04:08 +01:00
|
|
|
|
HUGO_ARCH="ARM64"
|
|
|
|
|
;;
|
2022-05-19 14:12:17 +02:00
|
|
|
|
"arm*")
|
2024-02-27 13:04:08 +01:00
|
|
|
|
HUGO_ARCH="ARM"
|
|
|
|
|
;;
|
2022-05-19 14:12:17 +02:00
|
|
|
|
esac
|
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
[ ! -e "$REPOSITORY/hugo${FLAVOR}_${VERSION}_Linux-${HUGO_ARCH}.tar.gz" ] && wget -c -O "$REPOSITORY/hugo${FLAVOR}_${VERSION}_Linux-${HUGO_ARCH}.tar.gz" "https://github.com/gohugoio/hugo/releases/download/v${VERSION}/hugo${FLAVOR}_${VERSION}_Linux-${HUGO_ARCH}.tar.gz"
|
2022-05-19 14:12:17 +02:00
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
rm -fr "$PKG"
|
|
|
|
|
mkdir -p "$PKG"/usr/{bin,doc/hugo}/
|
2022-05-19 14:12:17 +02:00
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
cd "$PKG/usr/bin/" || exit 1
|
|
|
|
|
tar xf "$REPOSITORY/hugo${FLAVOR}_${VERSION}_Linux-${HUGO_ARCH}.tar.gz"
|
|
|
|
|
mv README.md LICENSE "$PKG/usr/doc/hugo/"
|
|
|
|
|
chmod +x "$PKG/usr/bin/hugo"
|
2022-05-19 14:12:17 +02:00
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
mkdir -p "$PKG/usr/share/zsh/site-functions"
|
|
|
|
|
"$PKG/usr/bin/hugo" completion zsh > "$PKG/usr/share/zsh/site-functions/_hugo"
|
2022-05-19 14:12:17 +02:00
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
mkdir -p "$PKG/install"
|
2022-05-19 14:12:17 +02:00
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
cat <<EOF > "$PKG/install/slack-desc"
|
2022-05-19 14:12:17 +02:00
|
|
|
|
# HOW TO EDIT THIS FILE:
|
|
|
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
|
|
|
# up the first '|' above the ':' following the base package name, and the '|'
|
|
|
|
|
# on the right side marks the last column you can put a character in. You must
|
|
|
|
|
# make exactly 11 lines for the formatting to be correct. It's also
|
|
|
|
|
# customary to leave one space after the ':'.
|
|
|
|
|
|
|
|
|
|
|-----handy-ruler------------------------------------------------------|
|
|
|
|
|
${PRGNAM}: ${PRGNAM} (The world’s fastest framework for building websites.)
|
|
|
|
|
${PRGNAM}:
|
|
|
|
|
${PRGNAM}: This software does not utilize Adobe Digital Editions nor Wine. It is
|
|
|
|
|
${PRGNAM}: completely free and open-source software written natively for Linux.
|
|
|
|
|
${PRGNAM}:
|
2024-02-27 13:04:08 +01:00
|
|
|
|
${PRGNAM}:
|
|
|
|
|
${PRGNAM}:
|
2022-05-19 14:12:17 +02:00
|
|
|
|
${PRGNAM}:
|
|
|
|
|
${PRGNAM}:
|
|
|
|
|
${PRGNAM}:
|
|
|
|
|
${PRGNAM}: https://gohugo.io
|
|
|
|
|
EOF
|
|
|
|
|
|
2024-02-27 13:04:08 +01:00
|
|
|
|
cd "$PKG" || exit 1
|
|
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend "${OUTPUT}/${PRGNAM}-$(echo "${VERSION}" | tr - _)-${ARCH}-${BUILD}${TAG}.txz"
|