2010-03-01 11:29:17 +01:00
|
|
|
|
#!/bin/sh -x
|
|
|
|
|
|
|
|
|
|
# variables
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
|
|
PRGNAM=$(basename $(pwd))
|
|
|
|
|
BRANCH=
|
2010-03-23 01:42:00 +01:00
|
|
|
|
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
|
2010-03-01 11:29:17 +01:00
|
|
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
|
|
|
BUILD=1
|
|
|
|
|
|
2011-02-17 05:54:04 +01:00
|
|
|
|
|
|
|
|
|
TAG=cyco
|
|
|
|
|
TMP=/tmp/$TAG
|
2010-03-01 11:29:17 +01:00
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
|
OUTPUT=/tmp
|
|
|
|
|
|
|
|
|
|
REPOSITORIES=/home/cycojesus/projets/packages/repositories
|
|
|
|
|
|
|
|
|
|
DOCS="*.txt"
|
|
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
|
|
SLCKFLAGS=""
|
|
|
|
|
|
2010-03-04 13:07:22 +01:00
|
|
|
|
if [ ! -e $REPOSITORIES/$PRGNAM ]; then
|
|
|
|
|
hg clone https://sigil.googlecode.com/hg/ $REPOSITORIES/$PRGNAM
|
2010-03-01 11:29:17 +01:00
|
|
|
|
else
|
2010-03-04 13:07:22 +01:00
|
|
|
|
( cd $REPOSITORIES/$PRGNAM
|
2010-03-01 11:29:17 +01:00
|
|
|
|
hg pull -u
|
|
|
|
|
)
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# nettoyage pr<70>alable
|
|
|
|
|
rm -fr $PKG $TMP/$PRGNAM-$VERSION
|
|
|
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
|
|
|
|
# mise en place
|
|
|
|
|
cd $TMP
|
|
|
|
|
SRC_PATH=$REPOSITORIES/$PRGNAM
|
|
|
|
|
if [ -e $CWD/$PRGNAM-$VERSION.tar.?z* ] ; then
|
|
|
|
|
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
|
|
|
|
|
SRC_PATH=.
|
|
|
|
|
cd $TMP/$PRGNAM-$VERSION
|
|
|
|
|
else
|
|
|
|
|
mkdir -p $TMP/$PRGNAM-$VERSION
|
|
|
|
|
cd $TMP/$PRGNAM-$VERSION
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# configuration
|
|
|
|
|
cmake \
|
|
|
|
|
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
|
|
|
|
$SRC_PATH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# compilation
|
|
|
|
|
make -j3
|
|
|
|
|
|
|
|
|
|
# installation
|
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# correction
|
|
|
|
|
cd $PKG
|
|
|
|
|
chown -R root:root *
|
|
|
|
|
|
|
|
|
|
find $PKG -name \.hg\* -exec rm -fr {} \;
|
|
|
|
|
|
|
|
|
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
|
|
|
|
|
|
# Strip binaries
|
|
|
|
|
( cd $PKG
|
|
|
|
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# embaumement
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
|
|
|
$PRGNAM: $PRGNAM (A WYSIWYG ebook editor.)
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM: Sigil is a multi-platform WYSIWYG ebook editor. It is designed to
|
|
|
|
|
$PRGNAM: edit books in ePub format.
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM: http://code.google.com/p/sigil/
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
# empaquetage
|
|
|
|
|
cd $PKG
|
2011-02-17 05:54:04 +01:00
|
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|