46 lines
970 B
Bash
Executable file
46 lines
970 B
Bash
Executable file
#!/bin/sh
|
||
|
||
CWD=$(pwd)
|
||
|
||
PRGNAM=$(basename $CWD)
|
||
VERSION=$(date +"%Y.%m.%d_%H.%M")
|
||
BUILD=1
|
||
PACKAGER=cyco
|
||
ARCH=$(uname -m)
|
||
|
||
TMP=/tmp/$PACKAGER
|
||
PKG=$TMP/pkg-$PRGNAM
|
||
OUTPUT=/tmp
|
||
|
||
PREFIX=/usr
|
||
|
||
# cleaning
|
||
rm -fr $PKG
|
||
|
||
mkdir -p $PKG$PREFIX/doc/$PRGNAM
|
||
for fmt in pdf epub mobi ; do
|
||
[ -e $CWD/$PRGNAM.$fmt ] && mv $CWD/$PRGNAM.$fmt $CWD/$PRGNAM.$fmt.orig
|
||
wget -c http://dailyjs.com/files/$PRGNAM.$fmt -O $CWD/$PRGNAM.$fmt
|
||
cp $CWD/$PRGNAM.$fmt $PKG$PREFIX/doc/$PRGNAM
|
||
done
|
||
|
||
cd $PKG
|
||
mkdir -p install
|
||
cat <<EOF > install/slack-desc
|
||
$PRGNAM: $PRGNAM (Let's Make a Framework: Free eBook)
|
||
$PRGNAM:
|
||
$PRGNAM: I’ve collected and edited the Let’s Make a Framework articles into a book
|
||
$PRGNAM: that suitable for e-readers. Consider this a Christmas present!
|
||
$PRGNAM:
|
||
$PRGNAM:
|
||
$PRGNAM:
|
||
$PRGNAM:
|
||
$PRGNAM:
|
||
$PRGNAM: http://dailyjs.com/2010/12/02/framework-review/
|
||
$PRGNAM:
|
||
EOF
|
||
|
||
chown -R root:root *
|
||
|
||
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$PACKAGER.txz
|
||
|