slackbuilds/doc/modern_perl/modern_perl.SlackBuild
Gwenhael Le moine e3f0a2ee94 cleaning
2011-01-10 14:48:20 +07:00

47 lines
1,021 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
BUILD=${BUILD:-1}
PACKAGER=${PACKAGER:-cyco}
ARCH=${ARCH:-$(uname -m)}
TMP=${TMP:-/tmp/$PACKAGER}
PKG=${PKG:-$TMP/pkg-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
PREFIX=${PREFIX:-/usr}
FORMAT=${FORMAT:-a4} # or letter
# cleaning
rm -fr $PKG
# get sources
[ -e $CWD/modern_perl_$FORMAT.pdf ] && mv $CWD/modern_perl_$FORMAT.pdf $CWD/modern_perl_$FORMAT.pdf.orig
wget -c http://www.onyxneon.com/books/modern_perl/modern_perl_$FORMAT.pdf -O $CWD/modern_perl_$FORMAT.pdf
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp -R $CWD/modern_perl_$FORMAT.pdf $PKG$PREFIX/doc/$PRGNAM
cd $PKG
mkdir -p install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM («Modern Perl» book)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://www.modernperlbooks.com/
$PRGNAM: http://www.onyxneon.com/books/modern_perl/index.html
$PRGNAM:
EOF
chown -R root:root *
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$PACKAGER.txz