2017-03-01 11:56:49 +01:00
|
|
|
#!/bin/sh
|
2015-04-01 16:48:51 +02:00
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
2015-06-15 13:28:54 +02:00
|
|
|
VERSION=${VERSION:-$(wget -O - -o /dev/null http://status.calibre-ebook.com/latest)}
|
2015-04-01 16:48:51 +02:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
BUILD=${BUILD:-1}
|
2020-06-25 11:23:11 +02:00
|
|
|
TAG=${TAG:-gwh}
|
2015-04-01 16:48:51 +02:00
|
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
[ ! -e $CWD/${PRGNAM}-${VERSION}-${ARCH}.txz ] && wget -c -O $CWD/${PRGNAM}-${VERSION}-${ARCH}.txz http://download.calibre-ebook.com/${VERSION}/${PRGNAM}-${VERSION}-${ARCH}.txz
|
|
|
|
|
|
|
|
rm -fr $PKG
|
|
|
|
mkdir -p $PKG/opt/${PRGNAM}
|
|
|
|
|
|
|
|
tar xvf $CWD/${PRGNAM}-${VERSION}-${ARCH}.txz -C $PKG/opt/${PRGNAM}
|
|
|
|
|
2016-09-21 22:15:20 +02:00
|
|
|
rm $CWD/${PRGNAM}-${VERSION}-${ARCH}.txz
|
|
|
|
|
2015-04-01 16:48:51 +02:00
|
|
|
mkdir -p $PKG/usr/bin
|
|
|
|
|
|
|
|
$PKG/opt/calibre/calibre_postinstall --root=$PKG/usr
|
|
|
|
|
2015-12-02 10:43:32 +01:00
|
|
|
mkdir -p $PKG/etc/rc.d/
|
2016-09-21 22:15:20 +02:00
|
|
|
cp $CWD/rc.calibre-server $PKG/etc/rc.d/rc.calibre-server.new
|
2015-12-02 10:43:32 +01:00
|
|
|
|
2015-04-01 16:48:51 +02:00
|
|
|
cd $PKG/usr/bin
|
|
|
|
find . -type l -exec sh -c 'rm "$1"; ln -s ../../opt/calibre/$(basename $1)' _ {} \;
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
2017-11-08 15:04:27 +01:00
|
|
|
cat <<EOF > $PKG/install/doinst.sh
|
|
|
|
#!/bin/sh
|
|
|
|
config() {
|
|
|
|
NEW="\$1"
|
|
|
|
OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
|
|
|
|
# If there's no config file by that name, mv it over:
|
|
|
|
if [ ! -r \$OLD ]; then
|
|
|
|
mv \$NEW \$OLD
|
|
|
|
elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
|
|
|
|
# toss the redundant copy
|
|
|
|
rm \$NEW
|
|
|
|
fi
|
|
|
|
# Otherwise, we leave the .new copy for the admin to consider...
|
|
|
|
}
|
|
|
|
|
|
|
|
config etc/rc.d/rc.calibre-server.new
|
|
|
|
EOF
|
|
|
|
|
2015-04-01 16:48:51 +02:00
|
|
|
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 ':'.
|
|
|
|
|
2015-12-02 10:43:32 +01:00
|
|
|
|-----handy-ruler------------------------------------------------------|
|
2015-04-01 16:48:51 +02:00
|
|
|
${PRGNAM}: ${PRGNAM} (e-book library management application)
|
|
|
|
${PRGNAM}:
|
|
|
|
${PRGNAM}: ${PRGNAM} is meant to be a complete e-library solution.
|
|
|
|
${PRGNAM}: It includes library management, format conversion, news feeds to ebook
|
|
|
|
${PRGNAM}: conversion as well as e-book reader sync features. ${PRGNAM} is
|
|
|
|
${PRGNAM}: primarily a ebook cataloging program. It manages your ebook collection
|
|
|
|
${PRGNAM}: for you. It is designed around the concept of the logical book, i.e.
|
|
|
|
${PRGNAM}: a single entry in the database that may correspond to ebooks in
|
|
|
|
${PRGNAM}: several formats. It also supports conversion to and from a dozen
|
|
|
|
${PRGNAM}: different ebook formats.
|
|
|
|
${PRGNAM}: ${PRGNAM} home: http://calibre-ebook.com/
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cd $PKG
|
2018-04-20 23:02:35 +02:00
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2015-04-01 16:48:51 +02:00
|
|
|
/sbin/makepkg -l y -c n ${OUTPUT}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz
|