This is an old revision of the document!
Raw draft of install scripts, that can be used by a package management.
Everything is placed under /usr/src/packagename/packageversion
VER="$( pwd | cut -d '/' -f 5 )" PKG="$( pwd | cut -d '/' -f 4-5 )" SRC="$( pwd | cut -d '/' -f 4 )-${VER}" JOBS=-j8 NEEDS="" ### DEPCHECK ### for i in ${NEEDS}; do if [ ! -d /usr/pkg/${i} ]; then echo "need: ${i}" exit 6 fi done ### UNPACK ### tar xf ${SRC}.tar.* cd ${SRC} if [ "$?" != "0" ]; then echo "Error in unpack" exit 1 fi ### CONFIGURE ### ./configure --prefix=/usr if [ "$?" != "0" ]; then echo "Error in configure" exit 2 fi ### MAKE ### make ${JOBS} if [ "$?" != "0" ]; then echo "Error in make" exit 3 fi ### POSTMAKE ### make DESTDIR=/usr/pkg/${PKG} install if [ "$?" != "0" ]; then echo "Error in postmake" exit 4 fi ### INSTALL ### cd /usr/pkg/${PKG} for i in f d l; do find ./ -type ${i} | sed 's/^.//g' > .${i} done tar cf - . | (cd / ; tar xf - ) if [ "$?" != "0" ]; then echo "Error in install" exit 5 fi ### CLEANUP ### cd /usr/src/${PKG} rm -rf ${SRC}
VER="$( pwd | cut -d '/' -f 5 )" PKG="$( pwd | cut -d '/' -f 4-5 )" PKGBASE="$( pwd | cut -d '/' -f 4 )" cd /usr/pkg/${PKG} if [ "$?" != "0" ]; then echo "cd failed" exit 1 fi ### REMOVE LINKS ### cat .l | while read line; do unlink "${line}" done ### REMOVE FILES ### cat .f | while read line; do rm "${line}" done ### REMOVE DIRECTORIES ### tac .d | grep -v ^/$ | while read line; do rmdir "${line}" --ignore-fail-on-non-empty done cd / rm -rf /usr/pkg/${PKG} rmdir -p /usr/pkg/${PKGBASE} --ignore-fail-on-non-empty