[pacman-dev] makepkg Patch for consistancy
This patch implements two consistency issues I think are present in makepkg. Once again, use what you want, not trying to force a patch down your throat. 1. DISTCC was a variable without 'USE_' or 'NO' attached, so I changed it to USE_DISTCC. 2. Undocumented options are present in the makepkg script so I made these options available in makepkg.conf with explanations. The script also needed slightly changing to accommodate these. Dan ________ diff -Naur pacman-lib.orig/etc/makepkg.conf.in pacman-lib/etc/makepkg.conf.in --- pacman-lib.orig/etc/makepkg.conf.in 2006-11-15 15:22:46.000000000 -0500 +++ pacman-lib/etc/makepkg.conf.in 2006-11-15 16:36:58.000000000 -0500 @@ -6,7 +6,7 @@ # SOURCE ACQUISITION ######################################################################### # -#-- The FTP/HTTP download utility that makepkg should use to acquire sources +#-- The FTP/HTTP download utility makepkg should use to acquire sources FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 --waitretry=3 --no-check-certificate" #FTPAGENT="/usr/bin/snarf" #FTPAGENT="/usr/bin/lftpget -c" @@ -18,7 +18,7 @@ CARCH="@CARCH@" CHOST="@CHOST@" -#-- Exclusive: will only run on i686 or higher (P6, Athlon) +#-- Exclusive: will only run on @CARCHFLAGS@ CFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe" CXXFLAGS="-@MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe" #-- Optimized: will run on any x86, but optimized for i686 @@ -34,7 +34,7 @@ #-- Fakeroot: for building packages as a non-root user USE_FAKEROOT="y" #-- 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 DISTCC_HOSTS="" #-- Colorized output messages @@ -44,10 +44,15 @@ # GLOBAL PACKAGE OPTIONS ######################################################################### # -#-- Don't strip symbols from binaries/libraries -NOSTRIP=0 -#-- Keep doc and info directories +#-- Keep doc and info directories? KEEPDOCS=0 +#-- Don't strip symbols from binaries/libraries? +NOSTRIP=0 +#-- Don't remove libtool files? +#NOLIBTOOL=0 +#-- Don't remove empty directories from package? +#NOEMPTYDIRS=0 ######################################################################### # PACKAGE OUTPUT @@ -59,13 +64,13 @@ #PACKAGER="John Doe <john@doe.com>" ######################################################################### -# Functionality Configuration -# Most of this will probably not need to be changed by and end user +# FUNCTIONALITY CONFIGURATION +# (not likely to need changes by the end user) ######################################################################### # BUILDSCRIPT="PKGBUILD" PKGEXT="pkg.tar.gz" -INTEGRITY_CHECK="sha1" +INTEGRITY_CHECK="md5" source "/etc/abs/abs.conf" SRCROOT=$ABSROOT diff -Naur pacman-lib.orig/scripts/makepkg pacman-lib/scripts/makepkg --- pacman-lib.orig/scripts/makepkg 2006-11-15 15:22:46.000000000 -0500 +++ pacman-lib/scripts/makepkg 2006-11-15 16:37:01.000000000 -0500 @@ -267,9 +267,10 @@ echo " -h, --help This help" echo " -i, --install Install package after successful build" 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 " -m, --nocolor Disable colorized output messages" - echo " -n, --nostrip Do not strip binaries/libraries" + echo " -n, --nostrip Do not strip symbols from binaries/libraries" echo " -o, --nobuild Download and extract files only" echo " -p <buildscript> Use an alternate build script (instead of '$BUILDSCRIPT')" echo " -r, --rmdeps Remove installed dependencies after a successful build" @@ -314,6 +315,7 @@ --noextract) NOEXTRACT=1 ;; --install) INSTALL=1 ;; --force) FORCE=1 ;; + --keepdocs) KEEPDOCS=1 ;; --nostrip) NOSTRIP=1 ;; --nobuild) NOBUILD=1 ;; --nocolor) USE_COLOR="n" ;; @@ -329,7 +331,7 @@ exit 1 ;; -*) - while getopts "bBcCdefghij:Lmnop:rsSw:-" opt; do + while getopts "bBcCdefghij:kLmnop:rsSw:-" opt; do case $opt in b) DEP_SRC=1 ;; B) USE_CCACHE=0 ;; @@ -345,6 +347,7 @@ ;; i) INSTALL=1 ;; j) export MAKEFLAGS="-j$OPTARG" ;; + k) KEEPDOCS=1 ;; L) LOGGING=1 ;; m) USE_COLOR="n" ;; n) NOSTRIP=1 ;; @@ -694,7 +697,7 @@ fi # use distcc if requested -if [ "$DISTCC" = "y" ]; then +if [ "$USE_DISTCC" = "y" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH fi @@ -785,13 +788,13 @@ fi # remove libtool (.la) files -if [ "`check_option NOLIBTOOL`" ]; then +if [ "`check_option NOLIBTOOL`" -a "$NOLIBTOOL" = "1" ]; then msg "Removing libtool .la files..." find pkg -type f -name "*.la" -exec rm -f -- '{}' \; fi # remove empty directories -if [ "`check_option NOEMPTYDIRS`" ]; then +if [ "`check_option NOEMPTYDIRS`" -a "$NOEMPTYDIRS" = "1" ]; then msg "Removing empty directories..." find pkg -mindepth 1 -type d -empty -exec rmdir {} \; fi
On Wed, 15 Nov 2006 21:38:05 -0500 Daniel McGee <toofishes@hotmail.com> wrote:
This patch implements two consistency issues I think are present in makepkg. Once again, use what you want, not trying to force a patch down your throat.
1. DISTCC was a variable without 'USE_' or 'NO' attached, so I changed it to USE_DISTCC. 2. Undocumented options are present in the makepkg script so I made these options available in makepkg.conf with explanations. The script also needed slightly changing to accommodate these.
Dan
[snip part of the patch]
-#-- Don't strip symbols from binaries/libraries -NOSTRIP=0 -#-- Keep doc and info directories +#-- Keep doc and info directories? KEEPDOCS=0 +#-- Don't strip symbols from binaries/libraries? +NOSTRIP=0 +#-- Don't remove libtool files? +#NOLIBTOOL=0 +#-- Don't remove empty directories from package? +#NOEMPTYDIRS=0 [snip rest of the patch]
I'm not sure of the usefulness of having NOSTRIP, NOLIBTOOL, and NOEMPTYDIRS as global makepkg.conf variables (I realize NOSTRIP was there already). The reason is that we use these on a per PKGBUILD basis. We want the default to be the arch default and then to modify in exceptional cases. Arguably, maybe we want to be able to choose the default and the "arch default" is shortsighted and naive. But in that case, you'd want to have the option to STRIP, LIBTOOL, EMPTYDIRS in the options=() in a PKGBUILD. Jason
On 11/15/06, Jason Chu <jason@archlinux.org> wrote:
On Wed, 15 Nov 2006 21:38:05 -0500 Daniel McGee <toofishes@hotmail.com> wrote:
This patch implements two consistency issues I think are present in makepkg. Once again, use what you want, not trying to force a patch down your throat.
Arguably, maybe we want to be able to choose the default and the "arch default" is shortsighted and naive. But in that case, you'd want to have the option to STRIP, LIBTOOL, EMPTYDIRS in the options=() in a PKGBUILD.
I've merged some/most of these. I think it is important to provide this configurability. Just because the packages on archlinux.org are built one way, it doesn't mean that the packages from "joe's repo for archlinux" need to be built the exact same way. Thanks for the patch. For the record, I'm in the process of 'twiddling' with makepkg/gensync so they're not complete atm - I check into cvs what I do at work so I can work more at home 8).
On Thu, Nov 16, 2006 at 04:13:32PM -0600, Aaron Griffin wrote:
On 11/15/06, Jason Chu <jason@archlinux.org> wrote:
On Wed, 15 Nov 2006 21:38:05 -0500 Daniel McGee <toofishes@hotmail.com> wrote:
This patch implements two consistency issues I think are present in makepkg. Once again, use what you want, not trying to force a patch down your throat.
Arguably, maybe we want to be able to choose the default and the "arch default" is shortsighted and naive. But in that case, you'd want to have the option to STRIP, LIBTOOL, EMPTYDIRS in the options=() in a PKGBUILD.
I've merged some/most of these. I think it is important to provide this configurability. Just because the packages on archlinux.org are built one way, it doesn't mean that the packages from "joe's repo for archlinux" need to be built the exact same way.
Thanks for the patch. For the record, I'm in the process of 'twiddling' with makepkg/gensync so they're not complete atm - I check into cvs what I do at work so I can work more at home 8).
You get paid for working on pacman? Great! Jürgen
participants (4)
-
Aaron Griffin
-
Daniel McGee
-
Jason Chu
-
Jürgen Hötzel