1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #!/bin/bash
- #
- # Didier Charles 2011.05.21
- # dcharles@alumni.concordia.ca
- # written with the grateful assistance of the tutorial
- # "Writing A SlackBuild Script" at :
- # http://www.slackwiki.org/Writing_A_SlackBuild_Script
- # and with the guidance of the templates at:
- # http://slackbuilds.org/templates/
- #
- cd $(dirname $0) ; CWD=$(pwd)
- PRGNAM=verbiste
- VERSION=${VERSION:-0.1.40}
- BUILD=${BUILD:-1}
- TAG=${TAG:-_SBo}
- PKGTYPE=${PKGTYPE:-tgz}
- if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
- echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
- exit 0
- fi
- TMP=${TMP:-/tmp/SBo}
- PKG=$TMP/package-$PRGNAM
- OUTPUT=${OUTPUT:-/tmp}
- if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
- fi
- if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -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 $PRGNAM-$VERSION
- tar xvf $CWD/${PRGNAM}_$VERSION.orig.tar.gz
- cd $PRGNAM-$VERSION
- chown -R root:root .
- find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \+ -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
- CFLAGS="$SLKCFLAGS" \
- CXXFLAGS="$SLKCFLAGS -std=c++11" \
- ./configure \
- --prefix=/usr/ \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --libdir=/usr/lib$LIBDIRSUFFIX \
- --with-gtk-app \
- --without-gnome-app \
- --build=$ARCH-slackware-linux
- make
- make install-strip DESTDIR=$PKG
- mkdir -p $PKG/usr/share/applications/
- cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
- mv $PKG/usr/share/doc/ $PKG/usr/
- find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
- cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
- mv $PKG/usr/share/man $PKG/usr/
- find $PKG/usr/man -type f -exec gzip -9 {} \;
- rm -f $PKG/usr/lib*/*.la
- 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
|