2021-09-29 12:57:35 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
2022-10-18 15:50:31 +02:00
|
|
|
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/BentonEdmondson/knock/tags | jq -r '.[1].name')}
|
2021-09-29 12:57:35 +02:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-gwh}
|
|
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2022-01-22 19:52:02 +01:00
|
|
|
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
2021-09-29 12:57:35 +02:00
|
|
|
|
|
|
|
mkdir -p $REPOSITORY
|
|
|
|
|
|
|
|
[ ! -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
|
|
|
|
|
2022-03-03 13:42:30 +01:00
|
|
|
DOCS="license readme.md demo.png"
|
2021-09-29 12:57:35 +02:00
|
|
|
for i in $DOCS; do
|
|
|
|
[ ! -e $REPOSITORY/${i}-${VERSION} ] && wget -c -O $REPOSITORY/${i}-${VERSION} https://raw.githubusercontent.com/BentonEdmondson/knock/${VERSION}/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -fr $PKG
|
|
|
|
mkdir -p $PKG/usr/{bin,doc/knock}/
|
|
|
|
|
|
|
|
cp $REPOSITORY/knock-${VERSION}-${ARCH}-linux $PKG/usr/bin/knock
|
2021-09-29 13:07:33 +02:00
|
|
|
chmod +x $PKG/usr/bin/knock
|
|
|
|
|
2021-09-29 12:57:35 +02:00
|
|
|
for i in $DOCS; do
|
|
|
|
cp $REPOSITORY/${i}-${VERSION} $PKG/usr/doc/knock/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
|
|
# 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
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2023-08-16 12:23:26 +02:00
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend ${OUTPUT}/${PRGNAM}-$(echo ${VERSION} | tr - _)-${ARCH}-${BUILD}${TAG}.txz
|