2c99795a7c
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
82 lines
2 KiB
Bash
Executable file
82 lines
2 KiB
Bash
Executable file
#!/bin/sh -x
|
|
|
|
CWD=$(pwd)
|
|
PRGNAM=$(basename $CWD)
|
|
TAG=cyco
|
|
TMP=${TMP:-/tmp/cyco}
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
VERSION=${VERSION:-$(date +%Y.%m.%d_%H.%M)}
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-cyco}
|
|
|
|
PREFIX=/usr
|
|
|
|
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
fi
|
|
|
|
set -e
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
rm -rf $PRGNAM-$VERSION
|
|
if [ ! -e $REPOSITORY ]; then
|
|
git clone http://github.com/ariya/phantomjs.git $REPOSITORY
|
|
else
|
|
( cd $REPOSITORY
|
|
git pull
|
|
)
|
|
fi
|
|
cp -R $REPOSITORY $TMP/$PRGNAM-$VERSION
|
|
|
|
cd $PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find . \
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
-exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
-exec chmod 644 {} \;
|
|
|
|
#set the real version
|
|
#VERSION=$(git rev-parse HEAD)
|
|
|
|
# launching tests hangs, so we don't run them -.-
|
|
qmake
|
|
make
|
|
|
|
mkdir -p $PKG$PREFIX/bin
|
|
cp bin/* $PKG$PREFIX/bin
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM
|
|
cp -a ChangeLog LICENSE.BSD README.md examples $PKG/usr/doc/$PRGNAM
|
|
|
|
cd $PKG
|
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
mkdir -p $PKG/install
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
$PRGNAM: $PRGNAM (minimalistic headless WebKit-based JavaScript-driven tool)
|
|
$PRGNAM:
|
|
$PRGNAM: PhantomJS is a minimalistic, headless, WebKit-based, JavaScript-driven tool.
|
|
$PRGNAM:
|
|
$PRGNAM: It has native support for different web technologies: DOM handling,
|
|
$PRGNAM: CSS selector, JSON, Canvas, SVG, and of course JavaScript.
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: http://code.google.com/p/phantomjs/
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|