slackbuilds/doc/eloquentjavascript/eloquentjavascript.SlackBuild
Gwenhael Le Moine 76919911cb multilingual
2013-06-08 08:54:35 +02:00

74 lines
2 KiB
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/$PRGNAM.zip ] && mv $CWD/$PRGNAM.zip $CWD/$PRGNAM.zip.orig
wget -c http://eloquentjavascript.net/Eloquent%20JavaScript.zip -O $CWD/$PRGNAM.zip
mkdir -p $PKG$PREFIX/doc/$PRGNAM
unzip -d $PKG$PREFIX/doc/$PRGNAM $CWD/$PRGNAM.zip
mv $PKG$PREFIX/doc/$PRGNAM/Eloquent\ JavaScript $PKG$PREFIX/doc/$PRGNAM/EN
ebook-convert $PKG$PREFIX/doc/$PRGNAM/EN/index.html \
$PKG$PREFIX/doc/$PRGNAM/$PRGNAM.epub \
--authors="Marijn Haverbeke" \
--author-sort="Haverbeke, Marijn" \
--title="Eloquent JavaScript, A Modern Introduction to Programming" \
--title-sort="Eloquent JavaScript, A Modern Introduction to Programming" \
--language=English \
--rating=5
# French Version
[ -e $CWD/$PRGNAM.fr.zip ] && mv $CWD/$PRGNAM.fr.zip $CWD/$PRGNAM.fr.zip.orig
wget -c http://fr.eloquentjavascript.net/Eloquent%20JavaScript.zip -O $CWD/$PRGNAM.fr.zip
mkdir -p $PKG$PREFIX/doc/$PRGNAM
unzip -d $PKG$PREFIX/doc/$PRGNAM $CWD/$PRGNAM.fr.zip
mv $PKG$PREFIX/doc/$PRGNAM/Eloquent\ JavaScript $PKG$PREFIX/doc/$PRGNAM/FR
ebook-convert $PKG$PREFIX/doc/$PRGNAM/FR/index.html \
$PKG$PREFIX/doc/$PRGNAM/$PRGNAM.FR.epub \
--authors="Marijn Haverbeke" \
--author-sort="Haverbeke, Marijn" \
--title="JavaScript Éloquent, Une introduction moderne à la programmation" \
--title-sort="JavaScript Éloquent, Une introduction moderne à la programmation" \
--language=French \
--rating=5
( cd $PKG
mkdir -p install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (Javascript book)
$PRGNAM:
$PRGNAM: An Modern Introduction to Programming
$PRGNAM: by Marijn Haverbeke
$PRGNAM:
$PRGNAM: Eloquent JavaScript is a book providing an introduction to the
$PRGNAM: JavaScript programming language and programming in general.
$PRGNAM:
$PRGNAM:
$PRGNAM: http://eloquentjavascript.net/
$PRGNAM:
EOF
chown -R root:root *
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
)