2010-05-13 01:01:04 +02:00
|
|
|
#!/bin/sh
|
2011-05-09 04:52:41 +02:00
|
|
|
|
2010-05-13 01:01:04 +02:00
|
|
|
# Slackware build script for pgAdmin
|
|
|
|
# Written by Iskar Enev (<iskar.enev[@]gmail.com>)
|
2011-05-09 04:52:41 +02:00
|
|
|
# Modified by slakmagik <slakmagik@gmail.com>
|
2010-05-13 01:01:04 +02:00
|
|
|
|
|
|
|
PRGNAM=pgadmin3
|
2011-05-09 04:52:41 +02:00
|
|
|
VERSION=${VERSION:-1.12.3}
|
2010-05-13 01:01:04 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:16:28 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 01:01:04 +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"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:16:28 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 01:01:04 +02:00
|
|
|
fi
|
|
|
|
|
2011-05-09 04:52:41 +02:00
|
|
|
DOCUMENTATION="BUGS CHANGELOG DEVELOPERS INSTALL LICENSE README TODO"
|
|
|
|
|
2010-05-13 01:01:04 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
2011-05-09 04:52:41 +02:00
|
|
|
\( -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 {} \;
|
2010-05-13 01:01:04 +02:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
2011-05-09 04:52:41 +02:00
|
|
|
make DESTDIR=$PKG install
|
2010-05-13 01:01:04 +02:00
|
|
|
|
2011-05-09 04:52:41 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF |
|
|
|
|
cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-13 01:01:04 +02:00
|
|
|
|
2011-05-09 04:52:41 +02:00
|
|
|
# add the range of pgAdmin3 images - only one can be used in the desktop file
|
|
|
|
# but the default might not be the one people would want
|
|
|
|
mkdir -p $PKG/usr/share/pixmaps
|
|
|
|
cp -a pgadmin/include/images/pgAdmin3* $PKG/usr/share/pixmaps
|
2010-05-13 01:01:04 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/applications
|
2011-05-09 04:52:41 +02:00
|
|
|
sed '/^Icon=/s/pgadmin3/pixmaps/' \
|
|
|
|
pkg/pgadmin3.desktop > $PKG/usr/share/applications/pgadmin3.desktop
|
2010-05-13 01:01:04 +02:00
|
|
|
|
2011-05-09 04:52:41 +02:00
|
|
|
# as with so many packages, --docdir is present but ignored
|
|
|
|
mkdir -p $PKG/usr/doc
|
|
|
|
ln -s ../share/pgadmin3/docs $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a $DOCUMENTATION $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 01:01:04 +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
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|