[pacman-dev] [PATCH] makepkg: move BUILDSCRIPT from makepkg.conf

Allan McRae allan at archlinux.org
Sat Dec 27 01:39:47 EST 2008


Commit 4b183bf9 moved makepkg.conf sourcing to after the parsing
of options, broking the -p option and --help output.  The solution
is to move BUILDSCRIPT out of makepkg.conf.  This patch moves the
definition BUILDSCRIPT back to makepkg itself and adds configure
option to allow easy changing of this value during build time.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 configure.ac          |    9 +++++++++
 etc/makepkg.conf.in   |    3 +--
 scripts/Makefile.am   |    2 ++
 scripts/makepkg.sh.in |    1 +
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index c7841b8..5f1a153 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,6 +88,11 @@ AC_ARG_WITH(db-ext,
 	AS_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
 	[DBEXT=$withval], [DBEXT=.db.tar.gz])
 
+# Help line for buildscript filename
+AC_ARG_WITH(buildscript,
+	AS_HELP_STRING([--with-buildscript=name], [set the build script name used by makepkg]),
+	[BUILDSCRIPT=$withval], [BUILDSCRIPT=PKGBUILD])
+
 # Help line for libdownload/libfetch
 AC_ARG_ENABLE(internal-download,
 	AS_HELP_STRING([--disable-internal-download], [do not build with libdownload/libfetch support]),
@@ -314,6 +319,9 @@ AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman sourc
 # Set database file extension
 AC_SUBST(DBEXT)
 AC_DEFINE_UNQUOTED([DBEXT], "$DBEXT", [The file extension used by pacman databases])
+# Set makepkg build script name
+AC_SUBST(BUILDSCRIPT)
+AC_DEFINE_UNQUOTED([BUILDSCRIPT], "$BUILDSCRIPT", [The build script name used by makepkg])
 
 # Configuration files
 AC_CONFIG_FILES([
@@ -362,6 +370,7 @@ ${PACKAGE_NAME}:
     package extension      : ${PKGEXT}
     source pkg extension   : ${SRCEXT}
     database extension     : ${DBEXT}
+    build script name      : ${BUILDSCRIPT}
 
   Compilation options:
     Run make in doc/ dir   : ${wantdoc}
diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index 87b115c..9872d5d 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -95,13 +95,12 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
 #PACKAGER="John Doe <john at doe.com>"
 
 #########################################################################
-# BUILDSCRIPT/EXTENSION DEFAULTS
+# EXTENSION DEFAULTS
 #########################################################################
 #
 # WARNING: Do NOT modify these variables unless you know what you are
 #          doing.
 #
-BUILDSCRIPT='PKGBUILD'
 PKGEXT='@PKGEXT@'
 SRCEXT='@SRCEXT@'
 
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 014ae87..334b79a 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -37,9 +37,11 @@ edit = sed \
 	-e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
 	-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
 	-e 's|@DBEXT[@]|$(DBEXT)|g' \
+	-e 's|@BUILDSCRIPT[@]|$(BUILDSCRIPT)|g' \
 	-e 's|@SIZECMD[@]|$(SIZECMD)|g' \
 	-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
 
+
 ## All the scripts depend on Makefile so that they are rebuilt when the
 ## prefix etc. changes. Use chmod -w to prevent people from editing the
 ## wrong file by accident.
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index a999e0b..eae2c31 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -38,6 +38,7 @@ export COMMAND_MODE='legacy'
 
 myver='@PACKAGE_VERSION@'
 confdir='@sysconfdir@'
+BUILDSCRIPT='@BUILDSCRIPT@'
 startdir="$PWD"
 srcdir="$startdir/src"
 pkgdir="$startdir/pkg"
-- 
1.6.0.6



More information about the pacman-dev mailing list