#!/usr/bin/bash # This SlackBuild like script is designed for Vector Linux packages by exeterdad. # This script assumes it will be launched within "/NAME/VERSION/src" dir. With all sources in "src" # Your Vector Linux .tlz package, slack-desc, and slack-required will be found in "VERSION" dir. # The extraction and build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. NAME="amaya" VERSION=9.55_2 ARCH=i586 BUILD=3vl59 VL_PACKAGER=exeterdad CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME if [ $UID != 0 ]; then echo "You need to be root to run this script." exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf Amaya* #tar xjvf $CWD/$NAME-$VERSION.tar.bz2 || exit 1 tar zxvf $CWD/$NAME-sources-9.55-2.tgz || exit 1 cd $TMP/Amaya9.55/Amaya echo "Setting permissions..." chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 2777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 2755 -exec chmod 755 {} \; find . -perm 774 -exec chmod 644 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a *.spec README* $PKG/usr/doc/$NAME-$VERSION autoconf mkdir linux cd linux export HOME=`pwd` echo "Here we go!" ../configure \ --prefix=/usr/share \ --disable-debug \ --mandir=/usr/man \ --with-included-gettext || exit 1 sed -i.old -e "s|-O2|-O2 -march=i586 -mtune=i686|g" Options.orig echo "LDFLAGS=$LDFLAGS" >> Options.orig # Installer doesn't honor prefix when making symbolic link. We don't # want the link in our build system do we? sed -i.old -e "s|\$LN_S \$PREFIX/\$AMAYA_INSTALLDIR/\$AMAYAGUI/bin/amaya \$BINDIR/amaya|\$LN_S /usr/share/Amaya/wx/bin/amaya $PKG/usr/bin/amaya|g" script_install # The script that makes menu hardcodes the path to amaya to our build invoirment. sed -i.old -e "s|Exec=env XLIB_SKIP_ARGB_VISUALS=1 \$PREFIX/\$AMAYA_INSTALLDIR/\$AMAYAGUI/bin/amaya_bin %u|Exec=amaya|g" script_install_gnomekde make || exit 1 mkdir -p $PKG/usr/bin mkdir -p $PKG/usr/share/{pixmaps,applications} make install prefix=$PKG/usr/share rm -rf $PKG/usr/share/bin ./script_install_gnomekde $TMP/Amaya9.55/Amaya/linux/bin $PKG/usr/share $PKG/usr/share cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild mkdir -p $PKG/install # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=`expr length "$NAME"` SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done cat > $RELEASEDIR/slack-desc << EOF # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: $NAME (Web Browser/Editor from the World Wide Web Consortium) $NAME: $NAME: Amaya is a complete web browsing and authoring environment and comes $NAME: equipped with a WYSIWYG style of interface, similar to that of the $NAME: most popular commercial browsers. With such an interface, users do not $NAME: need to know the HTML or CSS languages. $NAME: $NAME: $NAME: License: Copyright 1995-2006 (MIT) (INRIA), (L)GPL compatible $NAME: Author: Irene.Vatton@inria.fr, Stephane.Gully@inria.fr and others $NAME: Website: http://www.w3.org/Amaya/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" $HOME/config.log` EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG echo " " echo "Stripping...." echo " " find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null echo "Finding dependancies..." requiredbuilder -c -v -y -s $RELEASEDIR $PKG echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD echo "Cleaning up temp files..." #rm -rf $TMP echo "Done"