#!/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="gkrellm" VERSION=2.3.0 ARCH=i586 BUILD=1vl59 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 if [ ! -x /usr/bin/convert ]; then echo "We need ImageMagick installed to convert a ico to a png" 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 $NAME-$VERSION tar xjvf $CWD/$NAME-$VERSION.tar.bz2 || exit 1 #tar zxvf $CWD/$NAME-$VERSION.tar.gz || exit 1 cd $TMP/$NAME-$VERSION 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 {} \; echo "Here we go!" make \ INSTALLROOT=/usr \ INSTALLDIR=/usr/bin \ INCLUDEDIR=/usr/include \ MANDIR=/usr/man/man1 \ LOCALEDIR=/usr/share/locale \ PKGCONFIGDIR=/usr/lib/pkgconfig || exit 1 make install \ INSTALLROOT=$PKG/usr \ INSTALLDIR=$PKG/usr/bin \ INCLUDEDIR=$PKG/usr/include \ MANDIR=$PKG/usr/man/man1 \ LOCALEDIR=$PKG/usr/share/locale \ PKGCONFIGDIR=$PKG/usr/lib/pkgconfig || exit 1 mkdir -p $PKG/usr/share/{pixmaps,applications} convert gkrellm.ico gkrellm.png cp gkrellm-8.png $PKG/usr/share/pixmaps/gkrellm.png || exit 1 cat > $PKG/usr/share/applications/.gkrellm.desktop << EOF [Desktop Entry] Encoding=UTF-8 Name=gKrellm Exec=gkrellm Icon=gkrellm.png Terminal=false Type=Application Categories=Application;System;Monitor; EOF gzip -9 $PKG/usr/man/man1/* mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a Changelog Changelog-* COPYRIGHT CREDITS INSTALL README $PKG/usr/doc/$NAME-$VERSION 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 (Multiple stacked system monitors: 1 process.) $NAME: $NAME: GKrellM charts SMP CPU, load, Disk, and all active net interfaces $NAME: automatically. An on/off button and online timer for the PPP interface $NAME: is provided. Monitors for memory and swap usage, file system, internet $NAME: connections, APM laptop battery, mbox style mailboxes, and cpu temps. $NAME: Also includes an uptime monitor, a hostname label, and a clock/calendar. $NAME: $NAME: License: GPL 3.0 $NAME: Author: Bill Wilson $NAME: Website: http://gkrellm.net/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: N/A 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 -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"