slackbuilds/doc/learnpythonthehardway/learnpythonthehardway.SlackBuild
Gwenhael Le Moine 2d3c96f8e7 replace TMP by OUTPUT
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2011-02-17 11:54:04 +07:00

47 lines
922 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=$(date +"%Y.%m.%d_%H.%M")
BUILD=1
ARCH=$(uname -m)
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
PREFIX=/usr
# cleaning
rm -fr $PKG
# get sources
[ -e $CWD/LearnPythonTheHardWay.pdf ] && mv $CWD/LearnPythonTheHardWay.pdf $CWD/LearnPythonTheHardWay.pdf.orig
wget -c http://learnpythonthehardway.org/static/LearnPythonTheHardWay.pdf -O $CWD/LearnPythonTheHardWay.pdf
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp -R $CWD/LearnPythonTheHardWay.pdf $PKG$PREFIX/doc/$PRGNAM
( cd $PKG
mkdir -p install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM («Learn Python the Hard way» book)
$PRGNAM:
$PRGNAM: Zed Shaw Python learning book project
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://learnpythonthehardway.com/
$PRGNAM:
EOF
chown -R root:root *
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
)