slackbuilds/ap/knock-bin/SlackBuild

63 lines
2.7 KiB
Text
Raw Permalink Normal View History

2021-09-29 12:57:35 +02:00
#!/bin/bash
CWD=$(pwd)
2024-06-17 09:37:04 +02:00
PRGNAM=$(basename "$CWD")
VERSION=1.3.1
2021-09-29 12:57:35 +02:00
ARCH=$(uname -m)
2024-06-17 09:37:04 +02:00
BUILD=${BUILD:-2}
2021-09-29 12:57:35 +02:00
TAG=${TAG:-gwh}
TMP=${TMP:-/tmp/$TAG}
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
REPOSITORY=${REPOSITORY:-/var/cache/SlackBuilds.gwh/$PRGNAM}
2021-09-29 12:57:35 +02:00
2024-06-17 09:37:04 +02:00
mkdir -p "$REPOSITORY"
2021-09-29 12:57:35 +02:00
2024-06-17 09:37:04 +02:00
#[ ! -e $REPOSITORY/knock-${VERSION}-${ARCH}-linux ] && wget -c -O $REPOSITORY/knock-${VERSION}-${ARCH}-linux https://github.com/BentonEdmondson/knock/releases/download/${VERSION}/knock-${VERSION}-${ARCH}-linux
[ ! -e "$REPOSITORY/knock-${VERSION}-${ARCH}-linux" ] && wget -c -O "$REPOSITORY/knock-${VERSION}-${ARCH}-linux" "https://web.archive.org/web/20220906155522/https://objects.githubusercontent.com/github-production-release-asset-2e65be/387297733/401c45b4-aa84-483a-a8ec-47bb4b74ac30?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220906%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220906T155522Z&X-Amz-Expires=300&X-Amz-Signature=f96d4fad08463e050e4bfa44d2035d604f81f5a054d7c6c7f705e18a9146cb67&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=387297733&response-content-disposition=attachment%3B%20filename%3Dknock-1.3.1-x86_64-linux&response-content-type=application%2Foctet-stream"
2021-09-29 12:57:35 +02:00
2024-06-17 09:37:04 +02:00
DOCS="license readme.md"
# for i in $DOCS; do
# [ ! -e $REPOSITORY/${i}-${VERSION} ] && wget -c -O $REPOSITORY/${i}-${VERSION} https://raw.githubusercontent.com/BentonEdmondson/knock/${VERSION}/$i
# done
2021-09-29 12:57:35 +02:00
2024-06-17 09:37:04 +02:00
rm -fr "$PKG"
mkdir -p "$PKG"/usr/bin/
2021-09-29 12:57:35 +02:00
2024-06-17 09:37:04 +02:00
cp "$REPOSITORY/knock-${VERSION}-${ARCH}-linux" "$PKG"/usr/bin/knock
chmod +x "$PKG"/usr/bin/knock
2021-09-29 13:07:33 +02:00
2024-06-17 09:37:04 +02:00
mkdir -p "$PKG"/usr/doc/knock/
2021-09-29 12:57:35 +02:00
for i in $DOCS; do
2024-06-17 09:37:04 +02:00
[ -e "$CWD/${i}" ] && cp "$CWD/${i}" "$PKG"/usr/doc/knock/"$i"
2021-09-29 12:57:35 +02:00
done
2024-06-17 09:37:04 +02:00
mkdir -p "$PKG"/install
2021-09-29 12:57:35 +02:00
2024-06-17 09:37:04 +02:00
cat <<EOF > "$PKG"/install/slack-desc
2021-09-29 12:57:35 +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} (Convert ACSM files to DRM-free EPUB files with one command)
${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}:
${PRGNAM}: usage:
${PRGNAM}: $ knock file.acsm
${PRGNAM}:
${PRGNAM}:
${PRGNAM}:
${PRGNAM}: https://github.com/BentonEdmondson/knock
EOF
2024-06-17 09:37:04 +02:00
cd "$PKG" || exit 1
/sbin/makepkg --linkadd y --chown n --prepend "${OUTPUT}/${PRGNAM}-${VERSION//-/_}-${ARCH}-${BUILD}${TAG}.txz"