summaryrefslogtreecommitdiff
path: root/pkgtools/pbulk
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2015-09-13 11:45:36 +0000
committerjoerg <joerg@pkgsrc.org>2015-09-13 11:45:36 +0000
commit322003d5ac2b094f7d0d7c3f2eeaa187eef02b3e (patch)
tree305eb17b688c5c03c00452b6157aa4c13b3ae6b4 /pkgtools/pbulk
parent42caa64422c7605782925a8243003163244a2a6d (diff)
downloadpkgsrc-322003d5ac2b094f7d0d7c3f2eeaa187eef02b3e.tar.gz
pbulk-0.57: Reorder build phases slightly to make better use of destdir
builds. Introduce hooks for sending bulklog and package explicitly the master. The default bulklog action is a nop and the package action mirrors the normal package step, i.e. copying to ${packages}/All and adding the category symlinks.
Diffstat (limited to 'pkgtools/pbulk')
-rw-r--r--pkgtools/pbulk/Makefile6
-rw-r--r--pkgtools/pbulk/files/pbulk/pbulk.conf11
-rwxr-xr-xpkgtools/pbulk/files/pbulk/scripts/pkg-build36
3 files changed, 38 insertions, 15 deletions
diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile
index 3e7b5ec4a6c..f2fcd60b5c8 100644
--- a/pkgtools/pbulk/Makefile
+++ b/pkgtools/pbulk/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.72 2015/09/12 23:04:30 joerg Exp $
+# $NetBSD: Makefile,v 1.73 2015/09/13 11:45:36 joerg Exp $
-PKGNAME= pbulk-0.56
+PKGNAME= pbulk-0.57
COMMENT= Modular bulk build framework
.include "../../pkgtools/pbulk/Makefile.common"
@@ -39,7 +39,7 @@ SUBST_VARS.tools= AWK BZIP2 CHOWN DIGEST GZIP_CMD ID MAIL_CMD NEATO \
CONF_FILES+= share/examples/pbulk/pbulk.conf ${PKG_SYSCONFDIR}/pbulk.conf
PBULK_CONFIG= ${PKG_SYSCONFDIR}/pbulk.conf
-PBULK_CONFIG_VERSION= 0.52
+PBULK_CONFIG_VERSION= 0.53
INSTALLATION_DIRS= bin libexec/pbulk share/examples/pbulk
USE_BSD_MAKEFILE= yes
diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf
index 8a5371c096f..8217549f740 100644
--- a/pkgtools/pbulk/files/pbulk/pbulk.conf
+++ b/pkgtools/pbulk/files/pbulk/pbulk.conf
@@ -1,4 +1,4 @@
-# $NetBSD: pbulk.conf,v 1.20 2015/09/08 17:35:07 joerg Exp $
+# $NetBSD: pbulk.conf,v 1.21 2015/09/13 11:45:37 joerg Exp $
# Version of the configuration file. This is bumped whenever the default
# config changes to notify the administrator about updates.
@@ -131,3 +131,12 @@ script_phase_build=@PREFIX@/libexec/pbulk/build
script_phase_report=@PREFIX@/libexec/pbulk/report
script_phase_scan=@PREFIX@/libexec/pbulk/scan
script_phase_upload=@PREFIX@/libexec/pbulk/upload
+
+# Arguments are buildlog and pkgname
+sync_buildlog=:
+# Arguments are path to the temporary package file, the package name
+# and categories. The default handler just copies the file to ${packages}
+# and creates the symlinks.
+sync_package=default_sync_package
+# PKG_SUFX as set in mk.conf
+pkg_sufx=.tgz
diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build
index 4ea344eae1b..91e97c59922 100755
--- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build
+++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build
@@ -1,5 +1,5 @@
#!@SH@
-# $NetBSD: pkg-build,v 1.26 2015/09/08 17:35:07 joerg Exp $
+# $NetBSD: pkg-build,v 1.27 2015/09/13 11:45:37 joerg Exp $
#
# Copyright (c) 2007, 2008 Joerg Sonnenberger <joerg@NetBSD.org>.
# All rights reserved.
@@ -38,6 +38,14 @@ if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then
exit 1
fi
+default_sync_package() {
+ cp "$1" "${packages}/All/${pkgname}${pkg_sufx}"
+ for cat in $3; do
+ mkdir -p ${packages}/$cat
+ ln -fs ../All/${pkgname}${pkg_sufx} ${packages}/$cat/${pkgname}${pkg_sufx}
+ done
+}
+
cleanup() {
if [ "$keep_wrkdir" = yes ]; then
${make} pbulk-save-wrkdir INTO=${bulklog}/${pkgname}/wrkdir.tar.gz TAR="${tar}"
@@ -51,6 +59,7 @@ cleanup() {
${tar} -czf ${bulklog}/${pkgname}/prefix.tar.gz ${cur_destdir}${prefix}
fi
${make} clean > /dev/null 2>&1 || true
+ ${sync_buildlog} ${bulklog} ${pkgname}
exit 1
}
@@ -61,12 +70,11 @@ run_make() {
local run_cmd
run_cmd=$1
shift
- ${run_cmd} ${make} $1 \
+ ${run_cmd} ${make} "$@" \
BATCH=1 \
DEPENDS_TARGET=/nonexistent \
${MAKE_FLAGS} \
WRKLOG=${bulklog}/${pkgname}/work.log
-
}
run_usergroup() {
@@ -95,6 +103,9 @@ while read build_info_line; do
DEPENDS=*)
dependencies=${build_info_line#DEPENDS=}
;;
+ CATEGORIES=*)
+ categories=${build_info_line#CATEGORIES=}
+ ;;
MULTI_VERSION=*)
MAKE_FLAGS=${build_info_line#MULTI_VERSION=}
;;
@@ -191,34 +202,37 @@ run_usergroup build> ${bulklog}/${pkgname}/build.log 2>&1 || cleanup
run_make ${run_build} all >> ${bulklog}/${pkgname}/build.log 2>&1 || cleanup
run_usergroup install > ${bulklog}/${pkgname}/install.log 2>&1 || cleanup
run_make ${run_install} stage-install >> ${bulklog}/${pkgname}/install.log 2>&1 || cleanup
-run_make run_direct package > ${bulklog}/${pkgname}/package.log 2>&1 || cleanup
+run_make run_direct stage-package-create > ${bulklog}/${pkgname}/package.log 2>&1 || cleanup
+
+pkgfile=$(run_make run_direct show-var VARNAME=STAGE_PKGFILE)
# When using DESTDIR build, add the package once to test install rules.
# This is not done for potential bootstrap packages as they might already
# be installed.
if [ "${use_destdir}" != "no" ] && \
[ -z "${is_bootstrap}" ]; then
- if ! ${pkg_add_cmd} ${pkgname} \
+ if ! ${pkg_add_cmd} ${pkgfile} \
>> ${bulklog}/${pkgname}/package.log 2>&1; then
- run_make run_direct package-clean
cleanup
fi
fi
-# Clean build area
-${make} clean > ${bulklog}/${pkgname}/clean.log 2>&1
-
# Test uninstall rules. This is not for cross-compiling as the install script
# is not run in that case anyway. This is also not done for packages marked as
# part of the bootstrap, those have the preserve flag set.
if [ "$cross_compile" = "no" ] && \
[ -z "${is_bootstrap}" ]; then
- ${pkg_delete} -K ${cur_pkgdb} ${pkgname} > ${bulklog}/${pkgname}/deinstall.log 2>&1
+ ${pkg_delete} -K ${cur_pkgdb} ${pkgname} > ${bulklog}/${pkgname}/deinstall.log 2>&1 || cleanup
fi
# Comment the following out if you want to test all deinstall scripts.
# This is quite expensive and mostly redundant, so it is disabled by default.
-#${pkg_delete} -r \* > /dev/null 2>&1 || true
+#${pkg_delete} -r \* > /dev/null 2>&1 || cleanup
+
+${sync_package} ${pkgfile} ${pkgname} "${categories}"
+
+# Clean build area
+${make} clean > ${bulklog}/${pkgname}/clean.log 2>&1 || true
# Cleanup build logs on success
rm -R ${bulklog}/${pkgname}