slackbuilds/xap/chromium/chromium.SlackBuild
2010-08-11 11:03:57 +07:00

112 lines
3.3 KiB
Bash
Executable file

#!/bin/sh
#
# Slackware build script for Google Chrome
# Copyright 2009-2010 Erik Hanson, Minneapolis, MN, USA
# 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.
# Adapted by Gwenhael Le Moine for Chromium snapshot
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=snapshot
ARCH=${ARCH:-$(uname -m)}
BUILD=${BUILD:-1}
TAG=${TAG:-cyco}
TMP=${TMP:-/tmp/$TAG}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# Just in case:
case "$ARCH" in
i?86) REL="chromium-rel-linux" ; LIBDIRSUFFIX="" ; ARCH=i386 ;;
x86_64) REL="chromium-rel-linux-64" ; LIBDIRSUFFIX="64" ;;
arm*) REL="chromium-rel-arm"; LIBDIRSUFFIX="" ; ARCH=arm ;;
esac
#set -eu
rm -rf $PKG
mkdir -p $TMP $PKG/opt $OUTPUT
cd $PKG/opt
#get latest revision number
[ -e ./LATEST ] && rm ./LATEST
wget -c http://build.chromium.org/buildbot/snapshots/$REL/LATEST
REVISION=$(cat ./LATEST)
VERSION=${VERSION}_$REVISION
rm ./LATEST
#get chromium
[ -e chrome-linux.zip ] && rm chrome-linux.zip
wget -c http://build.chromium.org/buildbot/snapshots/$REL/$REVISION/chrome-linux.zip
unzip ./chrome-linux.zip && rm ./chrome-linux.zip
cd ..
# We need bits of Moz, do this as dynamically as possible:
MISSING_LIBS=$(ldd opt/chrome-linux/chrome | grep "not found" | cut -d\ -f1 | xargs)
for MLIB in $MISSING_LIBS ; do
ln -s /usr/lib${LIBDIRSUFFIX}/seamonkey/${MLIB%.?d} opt/chrome-linux/$MLIB
done
mkdir -p $PKG/usr/man/man1/
mv $PKG/opt/chrome-linux/chrome.1 $PKG/usr/man/man1/
gzip -9 $PKG/usr/man/man?/*.?
mkdir -p $PKG/usr/bin
cat <<EOF > $PKG/usr/bin/$PRGNAM
#!/bin/sh
cd /opt/chrome-linux/
LD_LIBRARY_PATH=/opt/chrome-linux/:$LD_LIBRARY_PATH ./chrome $*
EOF
( cd $PKG/usr/bin/
ln -s $PRGNAM chrome
ln -s $PRGNAM google-chrome
)
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Web browser)
$PRGNAM:
$PRGNAM: Chromium is an open-source browser project that aims to build a safer,
$PRGNAM: faster, and more stable way for all users to experience the web.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://chromium.org
$PRGNAM:
EOF
cd $PKG
chown -R root:root .
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod 755 $PKG/opt/chrome-linux/{chrome,chrome_sandbox,xdg-settings,chrome-wrapper} $PKG/usr/bin/*
chmod +s $PKG/opt/chrome-linux/chrome_sandbox
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}