#!/bin/sh # # $Id: scim.SlackBuild 2006-10-14 11:38:00 PM EDT JohnB316 $ # CWD=`pwd` # set the current working directory to the one from which this script is called. NAME=scim # we get the name from the tarball, LOL! ;-) if [ "$TMP" = "" ]; then # is the temporary container directory variable defined? TMP=/tmp # no, so let's make it be /tmp fi PKG=$TMP/package-$NAME # this is the packaging destination # # These variables should be changed for the packager and the arguments # to be passed to the ./configure script. They will also be appended # to the end of the slack-desc file. # VL_PACKAGER=JohnB316 # change this to your VL forum name for building packages for the repository VERSION=1.4.5 # again, we get this from the tarball ARCH=i586 # all VL packages should be built with -march=i586 BUILD=6vl58 # this identifies the version of VL and which time this version was built if [ ! -d $TMP ]; then # do we have a /tmp directory on our box? mkdir -p $TMP # no, so let's make one fi rm -rf $PKG # get rid of the cruft from previous builds mkdir -p $PKG # let's make a clean packaging area cd $TMP # change to it tar xzvf $CWD/$NAME-$VERSION.tar.gz || exit 1 # extract the tarball, but exit the script just in case something goes wrong cd $NAME-$VERSION # go into the source tree... chown -R root.root . # give root ownership of everything if [ ! -r configure ]; then # is there not a configure file (the case with code pulled from cvs)? sh autogen.sh # then let's generate one fi export CFLAGS="-O2 -march=i586 -mtune=i686" # these are the CFLAGS that should be used in VL official packages export CXXFLAGS=$CFLAGS ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --program-prefix="" \ --program-suffix="" \ --without-doxygen \ --with-libiconv-prefix=/usr \ --with-included-gettext \ --enable-ldtl-install \ i486-slackware-linux || exit 1 # pass the arguments to the configure script here, or exit if something goes wrong - get what you need from ./configure --help make || exit 1 # compile the source but exit the script in case something goes wrong make install DESTDIR=$PKG || exit 1 # install the package into the packaging tank, but abort in case of error mkdir -p $PKG/usr/doc/$NAME-$VERSION # here's where the documents at the top of the source tree go cp -a \ ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO \ $PKG/usr/doc/$NAME-$VERSION # we actually looked into the tarball to find this out ;-) chmod 644 $PKG/usr/doc/$NAME-$VERSION/* # sometimes permissions are funky, so fix them if [ -d $PKG/usr/man ] ; then # just in case there is a man directory, gzip the manpages gzip -9 $PKG/usr/man/*/* fi if [ -d $PKG/usr/info/dir ] ; then # just in case there is an info/dir directory, gzip the info pages gzip -9 $PKG/usr/info/dir/* fi # # add the script to seed the scim environment variables to the package # thanks for catching this, stoichyu! ;-) # mkdir -p $PKG/etc/profile.d cp -a $CWD/etc/profile.d/scim.sh $PKG/etc/profile.d/scim.sh mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh # # append build information to the end of the slack-desc file # cat >> $PKG/install/slack-desc << EOF #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" $TMP/$NAME-$VERSION/config.log` EOF cd $PKG 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 "Generating slapt-get dependencies for $NAME-$VERSION..." requiredbuilder -v -y $PKG echo "Making package: $NAME-$VERSION..." makepkg -l y -c n $TMP/$NAME-$VERSION-$ARCH-$BUILD.tlz