#!/bin/bash # # newt.SlackBuild # code: Vicious ( michal@scxd.info ); improvements: Zielony ( e-pl@o2.pl ) set -e # PACKAGE GENERAL INFO [ EDIT] PKGNAME=newt VERSION=0.52.2 BUILD=2X ARCH=i686 URL=ftp://ftp.debian.org/debian/pool/main/n/newt/newt_$VERSION.orig.tar.gz CWD=`pwd` TMP=/tmp/$PKGNAME if [ -e $TMP/$PKGNAME-$VERSION/'Makefile' ]; then cd $TMP/$PKGNAME-$VERSION make else if [ ! -d $TMP/$PKGNAME-$VERSION ]; then rm -rf $TMP/package mkdir -p $TMP $TMP/package $TMP/package/install # PACKAGE DESCRIPTION [ EDIT] cat << SLACKDESC > $TMP/package/install/slack-desc |-----handy-ruler------------------------------------------------------| $PKGNAME: Newt ( Perl library ) $PKGNAME: $PKGNAME: Newt is a Perl library built on top of Erik Troan's newt C library $PKGNAME: for text screen widgets. It allows a Perl programmer to build simple $PKGNAME: but effective text-mode user interfaces with little effort. It is $PKGNAME: very usable because it has complete support for all widgets found in $PKGNAME: newt 0.50, and provides a nice abstraction over the C interface. $PKGNAME: Install the libnewt-dev package also if you want to read the tutorial $PKGNAME: "Writing Programs Using newt" by Erik Troan. $PKGNAME: $PKGNAME: Package prepared by Zielony ( e-pl@o2.pl ) SLACKDESC # step 1 : DOWNLOAD SOURCE ( wget -c $URL -P $TMP ) mv $TMP/newt_$VERSION.orig.tar.gz $TMP/newt-$VERSION.tar.gz # step 2 : UNPACK SOURCE AND COMPILE PKGFNAME=`ls $TMP | grep $PKGNAME-$VERSION.tar` EXTENSION=`echo ${PKGFNAME//*.}` if [ $EXTENSION = "bz2" ]; then tar jxvf $TMP/$PKGNAME-$VERSION.tar.bz2 -C $TMP tar jxvf $TMP/$PKGNAME-$VERSION/$PKGNAME-$VERSION.tar.bz.2 -C $TMP else tar xfz $TMP/$PKGNAME-$VERSION.tar.gz -C $TMP tar xfz $TMP/$PKGNAME-$VERSION/$PKGNAME-$VERSION.tar.gz -C $TMP fi chown root:root $TMP -R fi cd $TMP/$PKGNAME-$VERSION CFLAGS=${CFLAGS:--O2 -march=i686 -mcpu=i686} ./configure \ --prefix=/usr \ --disable-debug \ --enable-nls \ --with-gpm-support \ --mandir=/usr/man \ --sysconfdir=/etc make fi sed -i '30s@prefix = /usr@prefix = /tmp/newt/package/usr@g' Makefile make install # step 3 : STRIP BINARIES && GZIP MANUALS ( cd $TMP/package 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 ) ( gzip $TMP/package/usr/man/man?/* ) # step 4 : CREATE PACKAGE && CLEAN TMP cd $TMP/package makepkg -l y -c n $CWD/$PKGNAME-$VERSION-$ARCH-$BUILD.tgz rm -rf $TMP