diff options
author | joerg <joerg> | 2008-01-26 23:44:08 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-01-26 23:44:08 +0000 |
commit | 0220007e5c943085d3a4c28390f3ca690f67cb36 (patch) | |
tree | 7f2a212d370b3fa6b622527ca4eb92778014bbe7 /pkgtools/pbulk/files | |
parent | 2c4a037358afe941211277c104b18df331fb1ad7 (diff) | |
download | pkgsrc-0220007e5c943085d3a4c28390f3ca690f67cb36.tar.gz |
pbulk-0.26:
Add first pile of patches for cross-compiling support.
This still depends on the packages being pre-installed to
the normal prefix, but otherwise works. Cross-compiling
needs pkg_install-20080126. While here, simplify configuration
and allow using one pkg_install installation for everything.
As a side effect remove the pkgdb limitation for NetBSD builds.
Add a message that tells users to check the configuration file
on updates.
Diffstat (limited to 'pkgtools/pbulk/files')
-rw-r--r-- | pkgtools/pbulk/files/pbulk/pbulk.conf | 23 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/build | 4 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/client-clean | 17 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/pkg-build | 45 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date | 6 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/pre-build | 17 |
6 files changed, 84 insertions, 28 deletions
diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf index 9bd33df828c..183fafb9579 100644 --- a/pkgtools/pbulk/files/pbulk/pbulk.conf +++ b/pkgtools/pbulk/files/pbulk/pbulk.conf @@ -1,4 +1,4 @@ -# $NetBSD: pbulk.conf,v 1.12 2008/01/26 03:14:18 joerg Exp $ +# $NetBSD: pbulk.conf,v 1.13 2008/01/26 23:44:08 joerg Exp $ # The URL where the build report will be made available. This is only # used in the .txt version of the report. @@ -43,6 +43,12 @@ report_graph_script_limit=512 # unprivileged_user=pbulk +# Variables used for the optional cross-compiling of packages. +# +cross_compile=no +target_arch=vax +target_destdir=/usr/src/destdir.${target_arch} + # The directories where the various files are created. # bulklog=/bulklog @@ -52,16 +58,10 @@ pkgsrc=/usr/pkgsrc pkgdb=/var/db/pkg varbase=/var -pkg_install_prefix=/usr/pkg -# For pkg_install from base (NetBSD only): -# pkg_install_prefix=/usr -# external_pkg_info=/usr/sbin/pkg_info -# For pkg_install from pkgsrc: -# pkg_install_prefix=$prefix -# Note that ${external_pkg_info} must be outside ${prefix}! -external_pkg_info="@PKG_INFO@" -pkg_add=${pkg_install_prefix}/sbin/pkg_add -pkg_delete=${pkg_install_prefix}/sbin/pkg_delete +# The following programs must NOT be inside ${prefix} +pkg_info=@PKG_INFO_CMD@ +pkg_add=@PKG_ADD_CMD@ +pkg_delete=@PKG_DELETE_CMD@ # The tools that are used for building the packages. If you do not want # to publish anything at all, set rsync=: and mail=:. @@ -76,6 +76,7 @@ make=@TARGET_MAKE@ mail=@MAIL_CMD@ neato=@NEATO@ rsync=@PREFIX@/bin/rsync +sed=@SED@ tar=@TAR@ loc=${bulklog}/meta diff --git a/pkgtools/pbulk/files/pbulk/scripts/build b/pkgtools/pbulk/files/pbulk/scripts/build index 6b6cb222107..afc094caa8e 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build +++ b/pkgtools/pbulk/files/pbulk/scripts/build @@ -1,5 +1,5 @@ #!@SH@ -# $NetBSD: build,v 1.3 2008/01/15 21:43:32 joerg Exp $ +# $NetBSD: build,v 1.4 2008/01/26 23:44:08 joerg Exp $ # # Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. # All rights reserved. @@ -52,7 +52,7 @@ date '+BUILD_END_ISO=%Y-%m-%d %H:%M' >> ${loc}/status echo "Building pkg_summary..." cd ${packages}/All -sed 's/$/.tgz/' < ${loc}/success | sort | xargs ${external_pkg_info} -X | ${gzip} -c > pkg_summary.gz +sed 's/$/.tgz/' < ${loc}/success | sort | xargs ${pkg_info} -X | ${gzip} -c > pkg_summary.gz ${gzip} -dc < pkg_summary.gz | ${bzip2} -c > pkg_summary.bz2 if [ "${checksum_packages}" != "no" ] && \ diff --git a/pkgtools/pbulk/files/pbulk/scripts/client-clean b/pkgtools/pbulk/files/pbulk/scripts/client-clean index c6ec1302246..f1c85a15d87 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/client-clean +++ b/pkgtools/pbulk/files/pbulk/scripts/client-clean @@ -1,21 +1,28 @@ #!@SH@ -# $NetBSD: client-clean,v 1.7 2007/11/14 12:38:18 rillig Exp $ +# $NetBSD: client-clean,v 1.8 2008/01/26 23:44:08 joerg Exp $ . @PBULK_CONFIG@ set -e +if [ "$cross_compile" != "no" ]; then + cur_destdir=${target_destdir} +else + cur_destdir= +fi + # Clean build system first -rm -rf ${prefix} ${pkgdb} ${varbase}/qmail 2> /dev/null || true +rm -rf ${cur_destdir}${prefix} ${cur_destdir}${pkgdb} 2> /dev/null || true +rm -rf ${cur_destdir}${varbase}/qmail 2> /dev/null || true # Note: It is not an error if ${prefix} still exists at this point, # because it might be a mount point. # Install fresh bootstrap state if [ -f "${bootstrapkit}" ]; then - ${tar} -xzf ${bootstrapkit} -C / + ${tar} -xzf ${bootstrapkit} -C ${cur_destdir}/ elif [ -d "${bootstrapkit}" ]; then - [ -d ${prefix} ] || mkdir ${prefix} - cp -R ${bootstrapkit}/* ${prefix} + [ -d ${prefix} ] || mkdir ${cur_destdir}${prefix} + cp -R ${bootstrapkit}/* ${cur_destdir}${prefix} else : "Do nothing" fi diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build index 295901cb7a1..e507861fe69 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.11 2008/01/21 12:37:46 tnn Exp $ +# $NetBSD: pkg-build,v 1.12 2008/01/26 23:44:08 joerg Exp $ # # Copyright (c) 2007, 2008 Joerg Sonnenberger <joerg@NetBSD.org>. # All rights reserved. @@ -37,7 +37,12 @@ cleanup() { ${make} pbulk-save-wrkdir INTO=${bulklog}/${pkgname}/wrkdir.tar.gz fi if [ "$keep_prefix" = yes ] && [ -f ${bulklog}/${pkgname}/install.log ]; then - tar cfz ${bulklog}/${pkgname}/prefix.tar.gz ${prefix} + if [ "$cross_compile" != "no" ]; then + cur_destdir=${target_destdir} + else + cur_destdir= + fi + ${tar} cfz $${bulklog}/${pkgname}/prefix.tar.gz ${cur_destdir}${prefix} fi ${make} clean > /dev/null 2>&1 || true exit 1 @@ -107,13 +112,38 @@ if [ "$use_destdir" = "user-destdir" ]; then chown ${unprivileged_user} ${bulklog}/${pkgname}/work.log fi +pkg_add_normal() { + PKG_PATH=${packages}/All ${pkg_add} -K ${cur_pkgdb} "$@" +} + +pkg_add_cross() { + PKG_PATH=${packages}/All ${pkg_add} -K ${cur_pkgdb} \ + -m ${target_arch} -I -p ${target_destdir}${prefix} "$@" + echo "Fixing recorded cwd..." + ${pkg_info} -K ${target_destdir}${pkgdb} | while read pkg junk; do + ${sed} -e 's|@cwd '"${target_destdir}"'|@cwd |' \ + ${cur_pkgdb}/"${pkg}"/+CONTENTS > \ + ${cur_pkgdb}/"${pkg}"/+CONTENTS.tmp + mv ${cur_pkgdb}/"${pkg}"/+CONTENTS.tmp \ + ${cur_pkgdb}/"${pkg}"/+CONTENTS + done +} + +if [ "$cross_compile" != "no" ]; then + pkg_add_cmd=pkg_add_cross + cur_pkgdb="${target_destdir}${pkgdb}" +else + pkg_add_cmd=pkg_add_normal + cur_pkgdb="${pkgdb}" +fi + # Go to target directory cd ${pkgsrc}/${pkgdir} # Clean build area, just in case ${make} clean > ${bulklog}/${pkgname}/pre-clean.log 2>&1 # Install all dependencies the package said it would need if [ ! -z "$dependencies" ]; then - PKG_PATH=${packages}/All ${pkg_add} $dependencies > ${bulklog}/${pkgname}/depends.log 2>&1 + ${pkg_add_cmd} $dependencies > ${bulklog}/${pkgname}/depends.log 2>&1 fi # Build package, create a separate log file for each major phase run_make run_direct checksum > ${bulklog}/${pkgname}/checksum.log 2>&1 || cleanup @@ -124,15 +154,18 @@ run_make run_direct package > ${bulklog}/${pkgname}/package.log 2>&1 || cleanup # When using DESTDIR build, add the package once to test install rules. if [ "$use_destdir" != "no" ]; then - PKG_PATH=${packages}/All ${pkg_add} ${pkgname} \ + ${pkg_add_cmd} ${pkgname} \ > ${bulklog}/${pkgname}/package.log 2>&1 || cleanup fi # Clean build area ${make} clean > ${bulklog}/${pkgname}/clean.log 2>&1 -# Test uninstall rules -${pkg_delete} ${pkgname} > ${bulklog}/${pkgname}/deinstall.log 2>&1 +# Test uninstall rules. This is not for cross-compiling as the install script +# is not run in that case anyway. +if [ "$cross_compile" = "no" ]; then + ${pkg_delete} -K ${cur_pkgdb} ${pkgname} > ${bulklog}/${pkgname}/deinstall.log 2>&1 +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. diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date b/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date index b0e14f6869c..372227b9011 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date +++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date @@ -1,5 +1,5 @@ #!@SH@ -# $NetBSD: pkg-up-to-date,v 1.1.1.1 2007/06/19 19:49:59 joerg Exp $ +# $NetBSD: pkg-up-to-date,v 1.2 2008/01/26 23:44:09 joerg Exp $ # # Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. # All rights reserved. @@ -37,7 +37,7 @@ set -e pkg="${packages}/All/$1.tgz" [ -f ${pkg} ] -${external_pkg_info} -qb ${pkg} | sed 's/:/ /' | while read file file_id; do +${pkg_info} -qb ${pkg} | sed 's/:/ /' | while read file file_id; do [ -z "$file" ] && continue id=`${ident} ${pkgsrc}/${file} 2> /dev/null | head -n 2 | sed -e 1d -e 's/^ //'` @@ -49,7 +49,7 @@ done # Remove current package, so that only dependencies are in $* now. shift -${external_pkg_info} -qN ${pkg} | while read dep; do +${pkg_info} -qN ${pkg} | while read dep; do # pkg_info prints a trailing newline, ignore that [ -z "${dep}" ] && continue found=0 diff --git a/pkgtools/pbulk/files/pbulk/scripts/pre-build b/pkgtools/pbulk/files/pbulk/scripts/pre-build index 5d06f895807..041db534d9a 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/pre-build +++ b/pkgtools/pbulk/files/pbulk/scripts/pre-build @@ -1,5 +1,5 @@ #!@SH@ -# $NetBSD: pre-build,v 1.6 2008/01/17 17:47:09 joerg Exp $ +# $NetBSD: pre-build,v 1.7 2008/01/26 23:44:09 joerg Exp $ # # Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. # All rights reserved. @@ -34,6 +34,21 @@ set -e +if [ "$cross_compile" != "no" ]; then + if [ -z "${target_destdir}" ]; then + echo "target_destdir must be set for cross-compiling." + exit 1 + fi + if [ ! -d "${target_destdir}" ]; then + echo "target_destdir must exist for cross-compiling." + exit 1 + fi + if [ `cd "${target_destdir}" && pwd` = "/" ]; then + echo "target_destdir must not be / for cross-compiling." + exit 1 + fi +fi + if [ -d "${bulklog}/meta" ]; then echo "Warning: All log files of the previous pbulk run will be" echo "removed in 5 seconds. If you want to abort, press Ctrl-C." |