#!/usr/bin/env r
-use_pbuilder <- 1
pbuilder_results <- '/var/cache/pbuilder/result'
pbuilder_config <- '/home/cb/work/gsoc/cran2deb/pbuilderrc'
,pkg$debname
,paste('(',pkg$debversion,')',sep='')
,'...'))
- if (use_pbuilder) {
- # resulting files are in
- # /var/cache/pbuilder/result/
- ret = system(paste('pdebuild --configfile',pbuilder_config))
- } else {
- # results not kept
- ret = system('debuild -us -uc -b')
- }
+ ret = system(paste('pdebuild --configfile',pbuilder_config))
setwd(wd)
if (ret != 0) {
stop('Failed to build package.')
paste(pkg$srcname,'_',pkg$debversion,'.dsc',sep='')
,paste(pkg$srcname,'_',pkg$debversion,'_',host.arch(),'.changes',sep='')
,paste(pkg$debname,'_',pkg$debversion,'_',pkg$arch,'.deb',sep=''))
- if (use_pbuilder) {
- rp = pbuilder_results
- } else {
- rp = paste(pkg$path,'/..',sep='')
- }
+ rp = pbuilder_results
for (file in upfiles) {
ret = system(paste('lintian -v ',rp,'/',file,sep=''))
if (ret != 0) {
--- /dev/null
+[local]
+method = local
+incoming = @ROOT@/var/incoming
+allow_non-us_software = 1
+run_dinstall = 0
+post_upload_command = /usr/bin/mini-dinstall --batch -c @ROOT@/etc/mini-dinstall.conf
+allow_unsigned_uploads = 1
--- /dev/null
+#!/bin/bash
+# example file to be used with --hookdir
+#
+# run lintian on generated deb files
+apt-get install -y --force-yes lintian
+lintian /tmp/buildd/*.deb
--- /dev/null
+#!/bin/bash
+# example file to be used with --hookdir
+#
+# try to install the resulting debs.
+
+echo "Trying to install resulting packages and test upgrades"
+set -ex
+
+
+PKGNAMES=$(cd /tmp/buildd && ls -1 *.deb | sed 's/_.*$//' )
+
+# install-remove check
+dpkg -i /tmp/buildd/*.deb
+dpkg --remove $PKGNAMES
+
+# install-purge check
+dpkg -i /tmp/buildd/*.deb
+dpkg --purge $PKGNAMES
+
+# upgrade-remove check
+apt-get install -y --force-yes $PKGNAMES || true
+dpkg -i /tmp/buildd/*.deb
+dpkg --remove $PKGNAMES
+
+# upgrade-purge check
+apt-get install -y --force-yes $PKGNAMES || true
+dpkg -i /tmp/buildd/*.deb
+dpkg --purge $PKGNAMES
--- /dev/null
+#!/bin/bash
+# example file to be used with --hookdir
+#
+# run tests. Current directory is top of source-code.
+#
+# 2005, 2007 Junichi Uekawa
+#
+set -e
+
+echo "Installing the prerequisites"
+for PKG in $(ls /tmp/buildd/*.deb | sed -e's,.*/,,;s,_.*,,' ); do
+ apt-get install -y --force-yes "$PKG" || true
+ apt-get remove -y "$PKG" || true
+done
+# ignore the failures since they are not the prime interest
+
+dpkg -i /tmp/buildd/*.deb
+
+if chmod a+x /tmp/buildd/*/debian/pbuilder-test/*; then
+ :
+else
+ echo "W: no pbuilder-test script found, skipping"
+ exit 0
+fi
+
+SUCCESS=0
+COUNT=0
+unset FAIL || true
+NOFAIL=1
+
+# The current directory is the top of the source-tree.
+cd /tmp/buildd/*/debian/..
+
+for SCRIPT in $(run-parts --test /tmp/buildd/*/debian/pbuilder-test) ; do
+ echo "--- BEGIN test: ${SCRIPT##*/}"
+ if "${SCRIPT}"; then
+ echo SUCCESS
+ ((SUCCESS=SUCCESS+1))
+ else
+ echo FAIL
+ FAIL[${#FAIL[@]}]="${SCRIPT##*/}"
+ NOFAIL=0
+ fi
+ echo "--- END test: ${SCRIPT##*/}"
+ ((COUNT=COUNT+1))
+done
+
+echo "Summary:"
+echo "=== $SUCCESS out of $COUNT tests passed"
+echo "${FAIL[@]/#/ failed }"
+echo "-- end of testsuite."
+
--- /dev/null
+archive_dir = @ROOT@/var/archive
+logfile = @ROOT@/var/mini-dinstall.log
+
--- /dev/null
+HOOKDIR=@ROOT@/etc/hook
+BUILDRESULT=@ROOT@/var/incoming
+EXTRAPACKAGES='debhelper r-base-dev cdbs r-base-core lintian'
+DISTRIBUTION=lenny
+++ /dev/null
-#!/usr/bin/rc
-
-mode=create
-if ([ -e /var/cache/pbuilder/base.tgz ]) {
- mode=update
-}
-#sudo cowbuilder --$mode --hookdir /usr/share/doc/pbuilder/examples/workaround/ --distribution lenny --debootstrap cdebootstrap --basepath /var/cache/pbuilder/base.cow --extrapackages 'debhelper r-base-dev cdbs r-base-core lintian'
-sudo pbuilder $mode --distribution lenny --extrapackages 'debhelper r-base-dev cdbs r-base-core lintian'
-
--- /dev/null
+#!/usr/bin/rc
+for (x in `{find etc -type f -name '*.in'}) {
+ y=`{echo $x | sed -e 's,.in$,,'}
+ sed -e 's:@ROOT@:'^`pwd^':g' <$x >$y
+}
+mkdir -p var/incoming var/archive
+mode=create
+if ([ -e /var/cache/pbuilder/base.tgz ]) {
+ mode=update
+}
+sudo pbuilder $mode --configfile `pwd^/etc/pbuilderrc