To me, the only way to do it is through buildscripts.... here's an example of one I use:
file: gawk.build
Code:
#/bin/bash
################################################################################
# gawk #
#------------------------------------------------------------------------------#
# GNU awk: programs for manipulating text files #
################################################################################
# pkg info
P=gawk
V=3.1.5
PV=$P-$V
A=$PV.tar.bz2
# misc dirs
SD=/usr/src # dir holding src tarballs and patches
TMP=/tmp # tmp dir, where we build the packages
ST=$TMP/$PV # src tree of untarred pkg
LDR=/var/log/build/$PV # dir holding logfiles for the given package
# logfiles
TL=$TMP/tmplog # tmp file used for logging
PALOG=$LDR/patch.log # logfile of output from patching
CFLOG=$LDR/configure.log # logfile of output from running configure
BLOG=$LDR/build.log # logfile of output from building
CHLOG=$LDR/check.log # logfile of output from running testsuites
ILOG=$LDR/install.log # logfile of output from package install
PILOG=$LDR/postinstall.log # logfile of output from postinstall commands
# patches
PAT1=$SD/$PV-segfault_fix-1.patch
# compilation flags
# march: athlon-xp
# optimize level: 2 (default)
MARCH="athlon-xp"
OPTIMIZ="O2"
export CFLAGS="-march=$MARCH -$OPTIMIZ"
export CXXFLAGS="$CFLAGS"
set -e # ensure script stops on errors
# B1. unpack the tarballs ******************************************************
cd $TMP
tar xf $SD/$A
# B2. create dir to write build logs to ****************************************
mkdir -p $LDR
# B3. patch src ****************************************************************
cd $ST
# Under some circumstances, gawk-3.1.5 attempts to free a chunk of memory
# that was not allocated.
# This bug is fixed by the following patch:
( patch -Np1 -i $PAT1 2>&1 | tee $PALOG && exit $PIPESTATUS )
# B4. configure package ********************************************************
cd $ST
( ./configure --prefix=/usr --libexecdir=/usr/lib 2>&1 \
| tee $CFLOG && exit $PIPESTATUS )
# Due to a bug in the configure script, gawk fails to detect certain aspects
# of locale support in glibc.
# This bug leads to, e.g., Gettext testsuite failures.
# Work around this by appending the missing macro definitions to config.h:
cat >>config.h <<"EOF"
#define HAVE_LANGINFO_CODESET 1
#define HAVE_LC_MESSAGES 1
EOF
# B5. build package ************************************************************
cd $ST
( make 2>&1 | tee $BLOG && exit $PIPESTATUS )
# B6. check build **************************************************************
cd $ST
( make check 2>&1 | tee $CHLOG && exit $PIPESTATUS )
# B7. install package **********************************************************
cd $ST
( make install 2>&1 | tee $ILOG && exit $PIPESTATUS )
# B8. postinstall configuration ************************************************
# empty ---------------------
# B9. Compress build logs ******************************************************
for logfile in $LDR/*
do
bzip2 -9 ${logfile}
done
# B10. cleanup *****************************************************************
cd $TMP
rm -rf $ST # remove unneeded src tree
# B11. print success message ***************************************************
echo "Package $PV successfully built and installed!"
Constructions such as ( make 2>&1 | tee $BLOG && exit $PIPESTATUS ) are explained in the BLFS book.
Constructions such as cat <$TL $>>ILOG are used to append the results of a single operation to the step's build/install/postinstall/etc. logfile.
It's much more time-consuming to do it this way, but then you have a good base that can easily be updated later as the system grows.