From de44a0f474f4e78359b890644645bd7e153983d2 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 26 Apr 2009 19:52:29 +1000 Subject: makepkg: do not update pkgver when building source package When making a source package for a SCM PKGBUILD, makepkg should not update the pkgver/pkgrel. Noted in FS#14456. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index d978107f..ebc19bcb 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1100,14 +1100,13 @@ install_package() { devel_check() { newpkgver="" - # Only update pkgver if --holdver is not set - if [ "$HOLDVER" -eq 1 ]; then - return - fi - # Cannot update pkgver/pkgrel if reading PKGBUILD from pipe - if [ ! -f "./$BUILDSCRIPT" ]; then + + # Do not update pkgver if --holdver is set, when building a source package, + # or when reading PKGBUILD from pipe + if [ "$HOLDVER" -eq 1 -o "$SOURCEONLY" -ne 0 -o ! -f "./$BUILDSCRIPT" ]; then return fi + if [ -z "$FORCE_VER" ]; then # Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so. # This will only be used on the first call to makepkg; subsequent -- cgit v1.2.3-70-g09d2 From 5e32928a42366fd3df27ffe108b44fcfe35617dd Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 11 May 2009 01:16:51 +1000 Subject: makepkg: Document package splitting Signed-off-by: Allan McRae --- doc/PKGBUILD.5.txt | 27 +++++++++++++++++++++------ doc/makepkg.8.txt | 6 +++--- scripts/makepkg.sh.in | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index e1ea632b..41c468ee 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -238,19 +238,14 @@ use during the build and install process. These three variables are as follows: *startdir*:: This contains the absolute path to the directory where the PKGBUILD was located, which is usually the output of `$(pwd)` when makepkg is started. - `$startdir` was most often used in combination with `/src` or `/pkg` - postfixes, but use of the `$srcdir` and `$pkgdir` variables is preferred. *srcdir*:: This points to the directory where makepkg extracts or copies all source - files. Although it currently is an alias for `$startdir/src`, this - assumption should not be assumed true for all future revisions of makepkg. + files. *pkgdir*:: This points to the directory where makepkg bundles the installed package (this directory will become the root directory of your built package). - Although it currently is an alias for `$startdir/pkg`, this assumption - should not be assumed true for all future revisions of makepkg. If you create any variables of your own in the build function, it is recommended to use the bash `local` keyword to scope the variable to inside @@ -264,6 +259,26 @@ combination with the fakeroot BUILDENV option in linkman:makepkg.conf[5], fakero usage will be limited to running the packaging stage. The build() function will be run as the user calling makepkg. +Package Splitting +----------------- +makepkg supports building multiple packages from a single PKGBUILD. This is achieved +by assigning an array of package names to the `pkgname` directive. Each split package +uses a corresponding packaging function with name `package_foo()`, where `foo` is the +name of the split package. + +All options and directives for the split packages default to the global values given +within the PKGBUILD. However, some of these can be overridden within each split +package's packaging function. The following variables can be overridden: `pkgdesc`, +`license`, `groups`, `depends`, `optdepends`, `provides`, `conflicts`, `replaces`, +`backup`, `options` and `install`. + +An optional global directive is available when building a split package: + +*pkgbase*:: + The name used to refer to the group of packages in the output of makepkg + and in the naming of source-only tarballs. If not specified, the first + element in the `pkgname` array is used. + Install/Upgrade/Remove Scripting -------------------------------- Pacman has the ability to store and execute a package-specific script when it diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index fb2e8054..e480d8e3 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -122,9 +122,9 @@ Options during dependency auto-resolution and installation when using `-s`. *-R, \--repackage*:: - Repackage contents of pkg/ without rebuilding the package. This is - useful if you forgot a depend or install file in your PKGBUILD and the - build itself will not change. + Repackage contents of the package without rebuilding the package. This + is useful if you forgot a depend or install file in your PKGBUILD and + the build itself will not change. *-s, \--syncdeps*:: Install missing dependencies using pacman. When build-time or run-time diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index ebc19bcb..fefcc73a 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1308,7 +1308,7 @@ usage() { printf "$(gettext " -p Use an alternate build script (instead of '%s')")\n" "$BUILDSCRIPT" echo "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")" # fix flyspray feature request #2978 - echo "$(gettext " -R, --repackage Repackage contents of pkg/ without building")" + echo "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")" echo "$(gettext " -s, --syncdeps Install missing dependencies with pacman")" echo "$(gettext " --allsource Generate a source-only tarball including downloaded sources")" echo "$(gettext " --asroot Allow makepkg to run as root user")" -- cgit v1.2.3-70-g09d2 From 250e66e57b6a187b5643ea6db088552e4efef488 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 16 May 2009 13:48:10 +1000 Subject: makepkg: fix sourcing BUILDSCRIPT and PATH issues The bash source command looks in the users PATH for the file to source before the local directory. This causes issues when someone has a PKGBUILD somewhere in their path (for unknown some reason...). Fixes FS#14727. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index fefcc73a..f94f925e 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1527,6 +1527,7 @@ if [ ! -f "$BUILDSCRIPT" ]; then else # PKGBUILD passed through a pipe BUILDSCRIPT=/dev/stdin + source "$BUILDSCRIPT" fi else crlftest=$(file $BUILDSCRIPT | grep -F 'CRLF' || true) @@ -1534,9 +1535,9 @@ else error "$(gettext "%s contains CRLF characters and cannot be sourced.")" "$BUILDSCRIPT" exit 1 fi -fi -source "$BUILDSCRIPT" + source ./"$BUILDSCRIPT" +fi if [ "$GENINTEG" -eq 1 ]; then mkdir -p "$srcdir" -- cgit v1.2.3-70-g09d2 From 80caeabce0f28125f3b68388996ce39e58f2e5e8 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 16 May 2009 14:39:18 +1000 Subject: NEWS file updates for makepkg and contrib Signed-off-by: Allan McRae --- NEWS | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/NEWS b/NEWS index f0a88fd8..c2eb8afc 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,25 @@ VERSION DESCRIPTION ----------------------------------------------------------------------------- +3.3.0 - makepkg: + - package splitting support! - see PKGBUILD-split.proto + - limit fakeroot usage with addition of package() function + - info pages are handled like man pages and not other documentation + - configuration option for man/info page directories + - added ability to automatically remove files from package + - configuration option for default LDFLAGS + - specify alternative configuration file with --config flag + - check all integrity checksums provided in PKGBUILD + - fix pkgver/pkgrel updating in SCM packages + - BUILDSCRIPT option removed from makepkg.conf. Now specified + during configure + - enforce no ">" or "<" in provides array + - package compression autodetection + - check PKGBUILD for CRLF line endings + - fix reading PKGBUILD from pipe + - various fixes to increase compatibility with BSDs & Mac OSX + - contrib + - pacscripts - print install scripts for a package + 3.2.2 - log pacsave warnings to pacman.log (FS#12531) - separate local DB creation and writing (FS#12263) - pacman-optimize: rewrite and refresh (FS#11767) -- cgit v1.2.3-70-g09d2