2010-06-17 10:19:16 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for amaya
|
|
|
|
|
2011-12-16 21:51:39 +01:00
|
|
|
# Copyright 2010 Vincent Batts, vbatts@hashbangbash.com, http://hashbangbash.com/
|
|
|
|
# Copyright 2010, 2011 Vincent Batts, Vienna, VA, 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.
|
2010-06-17 10:19:16 +02:00
|
|
|
|
2011-03-31 04:21:47 +02:00
|
|
|
# Modified by the SlackBuilds.org team
|
|
|
|
|
2010-06-17 10:19:16 +02:00
|
|
|
PRGNAM=amaya
|
2012-09-25 14:39:13 +02:00
|
|
|
VERSION=${VERSION:-11.4.4}
|
|
|
|
BUILD=${BUILD:-1}
|
2010-06-17 10:19:16 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf Amaya${VERSION}
|
|
|
|
tar xvf $CWD/$PRGNAM-sources-${VERSION}.tgz
|
|
|
|
cd Amaya${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 {} \;
|
|
|
|
|
2012-09-25 14:39:13 +02:00
|
|
|
# Apply some patches (thanks to archlinux)
|
|
|
|
for i in $CWD/patches/* ; do patch -p1 < $i ; done
|
2011-03-31 04:21:47 +02:00
|
|
|
|
2010-06-17 10:19:16 +02:00
|
|
|
mkdir -p Amaya/build
|
|
|
|
cd Amaya/build
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
../configure \
|
2012-09-25 14:39:13 +02:00
|
|
|
--prefix=/opt \
|
2010-06-17 10:19:16 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--with-gl \
|
2012-09-25 14:39:13 +02:00
|
|
|
--enable-system-wx \
|
2010-06-17 10:19:16 +02:00
|
|
|
--enable-system-raptor \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
make all || exit 1
|
|
|
|
make install DESTDIR=$PKG || exit 1
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
|
|
|
# silly hack to link correctly
|
2011-12-16 21:51:39 +01:00
|
|
|
if [ -d $PKG/opt/bin ] ; then
|
|
|
|
rm -r $PKG/opt/bin/
|
|
|
|
fi
|
2010-06-17 10:19:16 +02:00
|
|
|
mkdir -p $PKG/usr/bin
|
|
|
|
( cd $PKG/usr/bin/ ; ln -s ../../opt/Amaya/wx/bin/$PRGNAM )
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/{applications,pixmaps}
|
|
|
|
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
|
|
|
|
( cd $PKG/usr/share/pixmaps
|
|
|
|
ln -s ../../../opt/Amaya/resources/icons/misc/logo.png amaya.png
|
|
|
|
)
|
|
|
|
|
2012-09-25 14:39:13 +02:00
|
|
|
# Install the foreign dictionaries (English and French are already there)
|
|
|
|
for i in Dutch German Italian Spanish Swedish ; do tar xf $CWD/$i.tgz ; done
|
|
|
|
for i in G I N S W ; do
|
|
|
|
install -m 0644 -D ${i}princ.dic $PKG/opt/Amaya/dicopar/${i}princ.dic
|
|
|
|
done
|
|
|
|
|
2010-06-17 10:19:16 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2012-09-25 14:39:13 +02:00
|
|
|
cp -a README $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-06-17 10:19:16 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2011-12-16 21:51:39 +01:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2010-06-17 10:19:16 +02:00
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|