#!/bin/sh -e # part of the gn*nix conspiracy http://gnnix.org # Copyright (C) Linus Sphinx 2004 # gnx functions make the distro system #------------------------------------------- gnxfilelist() { if [ "$1" = "start" ]; then echo CATALOGUE counting down to $2 rm -f /tmp/${2}.start touch /tmp/${2}.start sleep 60 elif [ "$1" = "finish" ]; then echo compressing man/info pages /gnxbuild/compressdoc -b -9 /usr/share/man /usr/share/info /usr/X11R6/man set +e echo CATALOGUE finishing up $2 pfile=/var/gnx/${2}.files # not necessary or we wouldnt be running #rm -f $pfile for d in /bin /home /sbin /usr /boot /etc /lib /root /var /opt do find ${d} -newer /tmp/${2}.start -print | while read i do if [ ! -d ${i} ]; then echo $i | grep -q -E "^/parts/|^/usr/src/" if [ "$?" = "1" ]; then echo "${i}" >> $pfile fi fi done done cd /gnxbuild set -e fi } gnxcheck() { if [ -f /var/gnx/${1}.files ]; then false else true fi } gnxunwrap() { cd /usr/src if [ -d ${1} ]; then rm -rf ${1} fi echo unwrapping ${1}.tar.bz2 tar xfj /parts/src/${1}.tar.bz2 if [ "$?" != "0" ]; then echo unwrap $1 echo returned non zero exit 1 fi if [ -d /usr/src/${1} ]; then cd /usr/src/${1} fi } gnxconfigure() { ./configure $@ if [ "$?" != "0" ]; then echo configure $@ echo returned non zero exit 1 fi } gnxpatch() { for i in $@ do echo "applying: ${i}.patch" patch -Np1 -i ${PATCH}/${i}.patch echo "${i}.patch applied." done } gnxmake() { make $@ if [ "$?" != "0" ]; then echo make $@ echo returned non zero echo path:$PATH exit 1 fi } gnxperlmod() { gnxunwrap ${1} gnxfilelist start ${1} perl Makefile.PL ${2} gnxmake gnxmake install gnxfilelist finish ${1} } gnxsimple() { gnxunwrap ${1} gnxfilelist start ${1} gnxconfigure --prefix=${PREFIX} $2 gnxmake if [ "${2}" == "check" ]; then gnxmake check fi gnxmake install gnxfilelist finish ${1} } # mininum three args perms source... dest gnxinstall() { chmod $1 $2 cp -a $2 $3 } #eof