From e422b71a48c9f7637595c510d8766f0f38b1114e Mon Sep 17 00:00:00 2001 From: Andrew Fyfe Date: Thu, 31 May 2007 17:21:37 +0100 Subject: Add autotool substitution for SRCEXT. Signed-off-by: Andrew Fyfe Signed-off-by: Dan McGee --- configure.ac | 9 +++++++++ etc/Makefile.am | 1 + etc/makepkg.conf.in | 1 + scripts/makepkg.in | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a03a242a..7ab8e3a0 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,11 @@ AC_ARG_WITH(pkg-ext, AC_HELP_STRING([--with-pkg-ext=ext], [Set the file extension used by packages]), [PKGEXT=$withval], [PKGEXT=.pkg.tar.gz]) +# Help line for source package directory +AC_ARG_WITH(src-ext, + AC_HELP_STRING([--with-src-ext=ext], [Set the file extension used by source packages]), + [SRCEXT=$withval], [SRCEXT=.src.tar.gz]) + # Help line for database extension AC_ARG_WITH(db-ext, AC_HELP_STRING([--with-db-ext=ext], [Set the file extension used by the database]), @@ -195,6 +200,9 @@ rectory]) # Set package file extension AC_SUBST(PKGEXT) AC_DEFINE_UNQUOTED([PKGEXT], "$PKGEXT", [The file extension used by pacman packages]) +# Set source package file extension +AC_SUBST(SRCEXT) +AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman source packages]) # Set database file extension AC_SUBST(DBEXT) AC_DEFINE_UNQUOTED([DBEXT], "$DBEXT", [The file extension used by pacman databases]) @@ -243,6 +251,7 @@ $PACKAGE_STRING: Directory and file information: root working directory : ${ROOTDIR} package extension : ${PKGEXT} + source pkg extension : ${SRCEXT} database extension : ${DBEXT} Compilation options: diff --git a/etc/Makefile.am b/etc/Makefile.am index 135eae6f..b26a3e6c 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -13,6 +13,7 @@ edit = sed \ -e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \ -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \ -e 's|@PKGEXT[@]|$(PKGEXT)|g' \ + -e 's|@SRCEXT[@]|$(SRCEXT)|g' \ -e 's|@CARCH[@]|$(CARCH)|g' \ -e 's|@CHOST[@]|$(CHOST)|g' \ -e 's|@ARCHSWITCH[@]|$(ARCHSWITCH)|g' \ diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index c3ac0f67..049fd178 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -94,6 +94,7 @@ DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/gnome/{,share/}{info,doc,gtk-doc}) # BUILDSCRIPT='PKGBUILD' PKGEXT='@PKGEXT@' +SRCEXT='@SRCEXT@' DB_COMPRESSION='gz' DB_CHECKSUMS=(md5) diff --git a/scripts/makepkg.in b/scripts/makepkg.in index 1bc6f3cc..553221be 100644 --- a/scripts/makepkg.in +++ b/scripts/makepkg.in @@ -666,7 +666,7 @@ create_srcpackage() { done # TODO make package extension configurable like $PKGEXT - local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}.src.tar.gz" + local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}" # tar it up msg2 "$(gettext "Compressing source package...")" @@ -990,7 +990,7 @@ msg "$(gettext "Making package: %s")" "$pkgname $pkgver-$pkgrel ($date)" # if we are creating a source-only package, go no further if [ "$SOURCEONLY" = "1" ]; then - if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}.src.tar.gz" \ + if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}" \ -a "$FORCE" = "0" ]; then error "$(gettext "a package has already been built. (use -f to overwrite)")" exit 1 -- cgit v1.2.3-70-g09d2