#!/bin/bash set -x -e CWD=$(pwd) PRGNAM=$(basename $CWD) ARCH=$(uname -m) BUILD=1 VERSION=${VERSION:-1.3.1a} TAG=gwh OUTPUT=/tmp TMP=/tmp/$TAG PKG=$TMP/pkg-$PRGNAM PREFIX=/usr REPOSITORY=${REPOSITORY:-/var/cache/SlackBuilds.gwh/$PRGNAM} mkdir -p $REPOSITORY # cleaning rm -fr $PKG $TMP # download [ ! -e $REPOSITORY/${PRGNAM}-${VERSION}.tar.gz ] && wget -c https://master.dl.sourceforge.net/project/hptalx/hptalx/${VERSION}/hptalx-${VERSION}.tar.bz2?viasf=1 -O $REPOSITORY/${PRGNAM}-${VERSION}.tar.gz # installation mkdir -p $PKG $TMP cd $TMP tar xvf $REPOSITORY/${PRGNAM}-${VERSION}.tar.gz cd ${PRGNAM}-${VERSION} ./configure \ --prefix=$PREFIX \ --mandir=$PREFIX/man \ --docdir=$PREFIX/doc/$PRGNAM \ --libdir=$PREFIX/lib$(uname -m | grep -o 64) make make install DESTDIR=$PKG mkdir -p $PKG$PREFIX/doc/$PRGNAM cp -R doc/ AUTHORS BUGS COPYING ChangeLog INSTALL NEWS NOTE README README.hp49gplus ToDo $PKG$PREFIX/doc/$PRGNAM chmod 644 $PKG$PREFIX/doc/$PRGNAM/* # packaging cd $PKG mkdir install cat < install/slack-desc $PRGNAM: $PRGNAM (HP Calculator<->PC communications program) $PRGNAM: $PRGNAM: This is HPTalx, a HP Calculator<->PC communications program for Linux, $PRGNAM: initially written by Bruno Barberi Gnecco, extended by Rafael Ostertag $PRGNAM: and released under the GNU Public License. $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: $PRGNAM: http://hptalx.sourceforge.net/index.shtml $PRGNAM: EOF rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la /sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-${VERSION}-$ARCH-$BUILD$TAG.txz