Minor makepkg changes - mainly from Daniel McGee

This commit is contained in:
Aaron Griffin 2006-11-16 22:43:58 +00:00
parent 3d6242ed74
commit b8b9596b13
2 changed files with 37 additions and 16 deletions

View file

@ -18,7 +18,7 @@ FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-ch
CARCH="@CARCH@" CARCH="@CARCH@"
CHOST="@CHOST@" CHOST="@CHOST@"
#-- Exclusive: will only run on i686 or higher (P6, Athlon) #-- Exclusive: will only run on @CARCHFLAGS@
CFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe" CFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe"
CXXFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe" CXXFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe"
#-- Optimized: will run on any x86, but optimized for i686 #-- Optimized: will run on any x86, but optimized for i686
@ -34,22 +34,28 @@ CXXFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe"
#-- Fakeroot: for building packages as a non-root user #-- Fakeroot: for building packages as a non-root user
USE_FAKEROOT="y" USE_FAKEROOT="y"
#-- DistCC: a distributed C/C++/ObjC compiler (modify MAKEFLAGS too) #-- DistCC: a distributed C/C++/ObjC compiler (modify MAKEFLAGS too)
DISTCC="n" USE_DISTCC="n"
#-- A space-delimited list of hosts running in the DistCC cluster #-- A space-delimited list of hosts running in the DistCC cluster
DISTCC_HOSTS="" DISTCC_HOSTS=""
#-- Colorized output messages #-- Colorized output messages
USE_COLOR="y" USE_COLOR="y"
#-- Use ccache when building
USE_CCACHE=0
######################################################################### #########################################################################
# GLOBAL PACKAGE OPTIONS # GLOBAL PACKAGE OPTIONS
# These are default values for the options=() settings
######################################################################### #########################################################################
# #
#-- Don't strip symbols from binaries/libraries #-- Don't strip symbols from binaries/libraries
NOSTRIP=0 NOSTRIP=0
#-- Keep doc and info directories #-- Keep doc and info directories
KEEPDOCS=0 KEEPDOCS=0
#-- Use ccache when building #-- Don't remove libtool files?
USE_CCACHE=0 NOLIBTOOL=0
#-- Don't remove empty directories from package?
NOEMPTYDIRS=0
######################################################################### #########################################################################
# PACKAGE OUTPUT # PACKAGE OUTPUT
@ -62,7 +68,7 @@ USE_CCACHE=0
######################################################################### #########################################################################
# Functionality Configuration # Functionality Configuration
# Most of this will probably not need to be changed by and end user # Most of this will probably not need to be changed by an end user
######################################################################### #########################################################################
# #
#-- Name of the script which makepkg reads #-- Name of the script which makepkg reads

View file

@ -28,7 +28,6 @@
myver='2.9.8' myver='2.9.8'
startdir=`pwd` startdir=`pwd`
PKGDEST=$startdir PKGDEST=$startdir
USE_COLOR="n"
# Options # Options
CLEANUP=0 CLEANUP=0
@ -40,12 +39,9 @@ FORCE=0
GENINTEG=0 GENINTEG=0
INSTALL=0 INSTALL=0
DOWNLOAD="" DOWNLOAD=""
KEEPDOCS=0
NOBUILD=0 NOBUILD=0
USE_CCACHE=0
NODEPS=0 NODEPS=0
NOEXTRACT=0 NOEXTRACT=0
NOSTRIP=0
RMDEPS=0 RMDEPS=0
LOGGING=0 LOGGING=0
@ -267,6 +263,7 @@ usage() {
echo " -h, --help This help" echo " -h, --help This help"
echo " -i, --install Install package after successful build" echo " -i, --install Install package after successful build"
echo " -j <jobs> Set MAKEFLAGS to \"-j<jobs>\" before building" echo " -j <jobs> Set MAKEFLAGS to \"-j<jobs>\" before building"
echo " -k, --keepdocs Keep doc and info directories"
echo " -L, --log Log package build process" echo " -L, --log Log package build process"
echo " -m, --nocolor Disable colorized output messages" echo " -m, --nocolor Disable colorized output messages"
echo " -n, --nostrip Do not strip binaries/libraries" echo " -n, --nostrip Do not strip binaries/libraries"
@ -314,6 +311,7 @@ while [ "$#" -ne "0" ]; do
--noextract) NOEXTRACT=1 ;; --noextract) NOEXTRACT=1 ;;
--install) INSTALL=1 ;; --install) INSTALL=1 ;;
--force) FORCE=1 ;; --force) FORCE=1 ;;
--keepdocs) KEEPDOCS=1 ;;
--nostrip) NOSTRIP=1 ;; --nostrip) NOSTRIP=1 ;;
--nobuild) NOBUILD=1 ;; --nobuild) NOBUILD=1 ;;
--nocolor) USE_COLOR="n" ;; --nocolor) USE_COLOR="n" ;;
@ -345,6 +343,7 @@ while [ "$#" -ne "0" ]; do
;; ;;
i) INSTALL=1 ;; i) INSTALL=1 ;;
j) export MAKEFLAGS="-j$OPTARG" ;; j) export MAKEFLAGS="-j$OPTARG" ;;
k) KEEPDOCS=1 ;;
L) LOGGING=1 ;; L) LOGGING=1 ;;
m) USE_COLOR="n" ;; m) USE_COLOR="n" ;;
n) NOSTRIP=1 ;; n) NOSTRIP=1 ;;
@ -688,24 +687,29 @@ if [ -d $startdir/pkg ]; then
fi fi
mkdir -p $startdir/pkg mkdir -p $startdir/pkg
if [ "$NOBUILD" = "1" ]; then if [ "x$NOBUILD" = "1" ]; then
msg "Sources are ready." msg "Sources are ready."
exit 0 exit 0
fi fi
# use distcc if requested # use distcc if requested
if [ "$DISTCC" = "y" ]; then if [ "x$USE_DISTCC" = "y" ]; then
[ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH
fi fi
# use ccache if it's available # use ccache if it's available
if [ "$USE_CCACHE" = "1" ]; then if [ "x$USE_CCACHE" = "1" ]; then
[ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH [ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH
fi fi
# build # build
msg "Starting build()..." msg "Starting build()..."
if [ "$LOGGING" = "1" ]; then
#check for "exit on syntax error" shell option
echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
set_e=$?
if [ "x$LOGGING" = "1" ]; then
BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.log" BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.log"
if [ -f "$BUILDLOG" ]; then if [ -f "$BUILDLOG" ]; then
i=1 i=1
@ -718,13 +722,24 @@ if [ "$LOGGING" = "1" ]; then
done done
mv "$BUILDLOG" "$BUILDLOG.$i" mv "$BUILDLOG" "$BUILDLOG.$i"
fi fi
echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
set_e=$?
#use 'errexit' to bail on syntax error
[ $set_e -eq 1 ] && set -e
build 2>&1 | tee "$BUILDLOG" build 2>&1 | tee "$BUILDLOG"
[ $set_e -eq 1 ] && set +e
if [ ${PIPESTATUS[0]} -gt 0 ]; then if [ ${PIPESTATUS[0]} -gt 0 ]; then
error "Build Failed. Aborting..." error "Build Failed. Aborting..."
exit 2 exit 2
fi fi
else else
#use 'errexit' to bail on syntax error
[ $set_e -eq 1 ] && set -e
build 2>&1 build 2>&1
[ $set_e -eq 1 ] && set +e
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
error "Build Failed. Aborting..." error "Build Failed. Aborting..."
exit 2 exit 2
@ -785,15 +800,15 @@ if [ ! "`check_option NOSTRIP`" -a "$NOSTRIP" = "0" ]; then
fi fi
# remove libtool (.la) files # remove libtool (.la) files
if [ "`check_option NOLIBTOOL`" ]; then if [ "`check_option NOLIBTOOL`" -a "x$NOLIBTOOL" = "1" ]; then
msg "Removing libtool .la files..." msg "Removing libtool .la files..."
find pkg -type f -name "*.la" -exec rm -f -- '{}' \; find pkg -type f -name "*.la" -exec rm -f -- '{}' \;
fi fi
# remove empty directories # remove empty directories
if [ "`check_option NOEMPTYDIRS`" ]; then if [ "`check_option NOEMPTYDIRS`" -a "x$NOEMPTYDIRS" = 1 ]; then
msg "Removing empty directories..." msg "Removing empty directories..."
find pkg -mindepth 1 -type d -empty -exec rmdir {} \; find pkg -depth -type d -empty -delete;
fi fi
# get some package meta info # get some package meta info