2021-07-04 01:48:15 +08:00
|
|
|
#!/bin/bash
|
2017-04-11 01:18:02 +08:00
|
|
|
|
|
|
|
# Slackware build script for mobiperl
|
|
|
|
|
2022-06-09 00:29:23 +08:00
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
2017-04-11 01:18:02 +08:00
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2021-07-04 17:41:06 +08:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2017-04-11 01:18:02 +08:00
|
|
|
PRGNAM=mobiperl
|
|
|
|
VERSION=${VERSION:-0.0.43}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 18:23:38 +08:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2017-04-11 01:18:02 +08:00
|
|
|
|
|
|
|
ARCH=noarch
|
|
|
|
|
2021-07-04 18:23:38 +08:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-04-11 01:18:02 +08:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2021-09-30 04:41:45 +08:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2017-04-11 01:18:02 +08:00
|
|
|
|
|
|
|
# Get rid of some perl module dependencies, replacing with stuff that's
|
|
|
|
# shipped with Slackware's perl package. Specifically:
|
|
|
|
# The obsolete Getopt::Mixed module is replaced by Getopt::Long.
|
|
|
|
# Date::Format is only used for ctime(), which is replaced by POSIX::ctime().
|
|
|
|
# Date::Parse is supposedly required, but is never used (removed it).
|
|
|
|
# For anyone reading this, no, this didn't break opf2mobi (it was
|
|
|
|
# already broken).
|
|
|
|
patch -p1 < $CWD/reduce_dependency_hell.diff
|
|
|
|
|
|
|
|
# lit2mobi calls convertlit by its old name, which might trigger
|
|
|
|
# stupid content filters. Replace with modern inoffensive name, in
|
|
|
|
# silly obfuscated way so this script doesn't contain the old name.
|
|
|
|
# (In case you're wondering, I'm not offended by this, I just don't want
|
|
|
|
# to get complaints from easily-offended people).
|
|
|
|
sed -i 's,\<cl[^\000-\150\152-]t\>,convertlit,g' MobiPerl/Util.pm lit2mobi
|
|
|
|
|
|
|
|
# It's pure Perl code (no shared libs), but not packaged as a perl module.
|
|
|
|
# We'll install the modules in the standard place for 3rd-party perl modules.
|
|
|
|
mkdir -p $PKG/usr/share/perl5/vendor_perl
|
|
|
|
cp -a Palm MobiPerl $PKG/usr/share/perl5/vendor_perl
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/man/man1 $PKG/usr/bin
|
|
|
|
EXES="html2mobi lit2mobi mobi2html mobi2mobi opf2mobi mobils"
|
|
|
|
for exe in $EXES; do
|
|
|
|
pod2man -c 'SlackBuilds.org' -r $VERSION $exe | gzip -9c > $PKG/usr/man/man1/$exe.1.gz
|
|
|
|
install -m0755 -oroot -groot $exe $PKG/usr/bin/$exe
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a README *.txt $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 18:23:38 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|