2011-10-03 23:32:36 +02:00
|
|
|
#!/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
|
|
|
|
|
|
|
|
REPOSITORIES=/home/installs/SlackBuilds/repositories
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
# cleaning
|
|
|
|
rm -fr $PKG
|
|
|
|
|
|
|
|
# get sources
|
|
|
|
if [ ! -e $REPOSITORIES/$PRGNAM ]; then
|
|
|
|
mkdir -p $REPOSITORIES/$PRGNAM
|
|
|
|
( cd $REPOSITORIES/$PRGNAM
|
|
|
|
httrack http://c.learncodethehardway.org/book -*.dmg -*.exe +*.txt
|
|
|
|
)
|
|
|
|
else
|
|
|
|
( cd $REPOSITORIES/$PRGNAM
|
|
|
|
httrack --update
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p $PKG$PREFIX/doc/
|
|
|
|
cp -R $REPOSITORIES/$PRGNAM $PKG$PREFIX/doc/$PRGNAM
|
2012-10-09 21:02:56 +02:00
|
|
|
rm -fr $PKG$PREFIX/doc/$PRGNAM/hts-*
|
|
|
|
|
|
|
|
ebook-convert $PKG$PREFIX/doc/$PRGNAM/c.learncodethehardway.org/book/index.html \
|
|
|
|
$PKG$PREFIX/doc/$PRGNAM/learncthehardway.epub \
|
|
|
|
--authors="Zed A. Shaw" \
|
|
|
|
--author-sort="Shaw, Zed A." \
|
|
|
|
--title="Learn C The Hard Way" \
|
|
|
|
--title-sort="Learn C The Hard Way" \
|
|
|
|
--language=English \
|
|
|
|
--rating=5 \
|
|
|
|
--series="Learn Code The Hard Way" \
|
|
|
|
--series-index=3
|
2011-10-03 23:32:36 +02:00
|
|
|
|
|
|
|
( cd $PKG
|
|
|
|
mkdir -p install
|
|
|
|
cat <<EOF > install/slack-desc
|
|
|
|
$PRGNAM: $PRGNAM («Learn C the Hard way» book)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: Zed Shaw Python learning book project, for C
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM: http://c.learncodethehardway.org/
|
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chown -R root:root *
|
|
|
|
|
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|
|
|
|
)
|