59 lines
1.5 KiB
Bash
Executable file
59 lines
1.5 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
VERSION=$(date +"%Y.%m.%d_%H.%M")
|
|
BUILD=1
|
|
|
|
ARCH=noarch
|
|
|
|
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
|
|
|
|
TAG=gwh
|
|
TMP=/tmp/$TAG
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
OUTPUT=/tmp
|
|
|
|
PREFIX=/usr
|
|
|
|
# cleaning
|
|
rm -fr $PKG
|
|
|
|
# get sources
|
|
[ ! -e $REPOSITORY/Book ] && git clone https://github.com/progit/progit.git $REPOSITORY/Book
|
|
( cd $REPOSITORY/Book && git pull )
|
|
VERSION="$( cd $REPOSITORY/Book && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
|
|
|
|
[ ! -e $REPOSITORY/Examples ] && git clone https://github.com/progit/book-examples.git $REPOSITORY/Examples
|
|
( cd $REPOSITORY/Examples && git pull )
|
|
|
|
|
|
[ ! -e $CWD/progit.en.pdf ] && wget -c http://progit.org/ebook/progit.pdf -O $CWD/progit.en.pdf
|
|
[ ! -e $CWD/progit.en.mobi ] && wget -c https://github.s3.amazonaws.com/media/pro-git.en.mobi -O $CWD/progit.en.mobi
|
|
[ ! -e $CWD/progit.en.epub ] && wget -c https://github.s3.amazonaws.com/media/progit.epub -O $CWD/progit.en.epub
|
|
|
|
mkdir -p $PKG$PREFIX/doc/
|
|
cp -R $REPOSITORY $PKG$PREFIX/doc/$PRGNAM
|
|
find $PKG$PREFIX/doc/$PRGNAM -name \.git\* -exec rm -fr {} \;
|
|
|
|
cd $PKG
|
|
mkdir -p install
|
|
cat <<EOF > install/slack-desc
|
|
$PRGNAM: $PRGNAM (eBook, Pro Git: professional version control)
|
|
$PRGNAM:
|
|
$PRGNAM: Pro Git book, written by Scott Chacon and published by Apress.
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: http://progit.org/
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
chown -R root:root *
|
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|