2011-05-12 15:59:03 +02:00
|
|
|
#!/bin/bash
|
2010-05-11 22:54:54 +02:00
|
|
|
|
2010-06-13 20:59:41 +02:00
|
|
|
# Slackware build script for midori.
|
2010-05-11 22:54:54 +02:00
|
|
|
|
|
|
|
# Copyright 2008 Andrew Brouwers <abrouwers@gmail.com>
|
2011-03-04 02:44:14 +01:00
|
|
|
# Copyright 2009-2011 Pierre Cazenave <pwcazenave {at} gmail [dot] com>
|
2013-02-11 09:05:15 +01:00
|
|
|
# Copyright 2012-2013 Roberto Neri, Palermo, Italy
|
2010-05-13 00:37:10 +02:00
|
|
|
#
|
2010-05-11 22:54:54 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
PRGNAM=midori
|
2013-10-28 19:39:06 +01:00
|
|
|
VERSION=${VERSION:-0.5.5}
|
2010-05-11 22:54:54 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-13 00:37:10 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 22:54:54 +02:00
|
|
|
|
2010-06-04 07:13:15 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
2010-06-13 20:59:41 +02:00
|
|
|
*) ARCH=$( uname -m ) ;;
|
2010-06-04 07:13:15 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 22:54:54 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:37:10 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-06-13 20:59:41 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:54:54 +02:00
|
|
|
elif [ "$ARCH" = "s390" ]; then
|
|
|
|
SLKCFLAGS="-O2"
|
2010-05-13 00:37:10 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:54:54 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:37:10 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:13:15 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:54:54 +02:00
|
|
|
fi
|
|
|
|
|
2013-04-08 11:58:51 +02:00
|
|
|
# GTK3 support is disabled by default but can be enabled
|
|
|
|
# by passing GTK3=yes to the script
|
|
|
|
if [ "${GTK3:-no}" = "yes" ]; then
|
|
|
|
ENABLE_GTK3="enable"
|
|
|
|
else
|
|
|
|
ENABLE_GTK3="disable"
|
|
|
|
fi
|
|
|
|
|
2010-05-13 00:37:10 +02:00
|
|
|
set -eu
|
|
|
|
|
2010-05-11 22:54:54 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-13 00:37:10 +02:00
|
|
|
cd $TMP
|
2010-05-11 22:54:54 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2013-10-28 19:39:06 +01:00
|
|
|
tar xvf $CWD/${PRGNAM}_${VERSION}_all_.tar.?z*
|
2010-05-13 00:37:10 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 22:54:54 +02:00
|
|
|
|
|
|
|
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 {} \;
|
|
|
|
|
|
|
|
export CCFLAGS="$SLKCFLAGS"
|
|
|
|
export CXXFLAGS="$SLKCFLAGS"
|
|
|
|
|
2010-05-13 00:37:10 +02:00
|
|
|
./waf configure \
|
|
|
|
--prefix=/usr \
|
2011-01-01 18:03:38 +01:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-13 00:37:10 +02:00
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
2011-01-01 18:03:38 +01:00
|
|
|
--datarootdir=/usr/share/ \
|
|
|
|
--mandir=/usr/man \
|
2013-04-08 11:58:51 +02:00
|
|
|
--$ENABLE_GTK3-gtk3 \
|
2013-02-11 09:05:15 +01:00
|
|
|
--disable-zeitgeist
|
2011-01-01 18:03:38 +01:00
|
|
|
|
2010-05-11 22:54:54 +02:00
|
|
|
./waf build
|
|
|
|
./waf install --destdir=$PKG
|
|
|
|
|
2010-05-13 00:37:10 +02:00
|
|
|
# Don't clobber existing configs
|
|
|
|
mv $PKG/etc/xdg/midori/search $PKG/etc/xdg/midori/search.new
|
2012-01-04 16:35:06 +01:00
|
|
|
mv $PKG/etc/xdg/midori/extensions/adblock/config $PKG/etc/xdg/midori/extensions/adblock/config.new
|
2010-05-11 22:54:54 +02:00
|
|
|
|
2013-04-08 11:58:51 +02:00
|
|
|
# The other doc files have already been copied into /usr/doc/$PRGNAM-$VERSION
|
|
|
|
# by "./waf install"
|
2013-10-28 19:39:06 +01:00
|
|
|
cp -a HACKING TODO TRANSLATE \
|
2013-02-11 09:05:15 +01:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 00:37:10 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2012-09-20 04:28:53 +02:00
|
|
|
ln -s $PRGNAM-$VERSION $PKG/usr/doc/$PRGNAM
|
2010-05-11 22:54:54 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2010-05-12 17:43:47 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-05-11 22:54:54 +02:00
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:37:10 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|