slackbuilds/doc/the_C_book/SlackBuild
2018-04-20 23:02:35 +02:00

47 lines
903 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
BUILD=${BUILD:-1}
ARCH=${ARCH:-$(uname -m)}
TAG=cyco
TMP=${TMP:-/tmp/$TAG}
PKG=${PKG:-$TMP/pkg-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
PREFIX=${PREFIX:-/usr}
# cleaning
rm -fr $PKG
# get sources
wget -c http://publications.gbdirect.co.uk/c_book/the_c_book.pdf -O $CWD/the_c_book.pdf
wget -c http://publications.gbdirect.co.uk/c_book/thecbook.pdf -O $CWD/thecbook.pdf
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp -R $CWD/*.pdf $PKG$PREFIX/doc/$PRGNAM
cd $PKG
mkdir -p install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (The C book)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://publications.gbdirect.co.uk/c_book/
$PRGNAM:
EOF
chown -R root:root *
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz