]> git.donarmstrong.com Git - cran2deb.git/commitdiff
cran2deb: remove non-pbuilder mode. add pbuilder, dput, mini-dinstaller configs.
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:13:51 +0000 (13:13 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:13:51 +0000 (13:13 +0000)
git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@25 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/trunk/cran2deb
pkg/trunk/etc/dput.cf.in [new file with mode: 0644]
pkg/trunk/etc/hook/B90lintian [new file with mode: 0755]
pkg/trunk/etc/hook/B91dpkg-i [new file with mode: 0755]
pkg/trunk/etc/hook/B92test-pkg [new file with mode: 0755]
pkg/trunk/etc/mini-dinstall.conf.in [new file with mode: 0644]
pkg/trunk/etc/pbuilderrc.in [new file with mode: 0644]
pkg/trunk/pbuilder_setup [deleted file]
pkg/trunk/setup [new file with mode: 0755]

index 9b897126f7449bd7f95738467825dba1c3be516d..2e3db5599d423ecc9f27d281a6c1f0ef9c8749f7 100755 (executable)
@@ -1,6 +1,5 @@
 #!/usr/bin/env r
 
-use_pbuilder <- 1
 pbuilder_results <- '/var/cache/pbuilder/result'
 pbuilder_config <- '/home/cb/work/gsoc/cran2deb/pbuilderrc'
 
@@ -411,14 +410,7 @@ build.debian <- function(pkg) {
                  ,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.')
@@ -436,11 +428,7 @@ go <- function(name) {
                 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) {
diff --git a/pkg/trunk/etc/dput.cf.in b/pkg/trunk/etc/dput.cf.in
new file mode 100644 (file)
index 0000000..9779aaf
--- /dev/null
@@ -0,0 +1,7 @@
+[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
diff --git a/pkg/trunk/etc/hook/B90lintian b/pkg/trunk/etc/hook/B90lintian
new file mode 100755 (executable)
index 0000000..57fcfc4
--- /dev/null
@@ -0,0 +1,6 @@
+#!/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
diff --git a/pkg/trunk/etc/hook/B91dpkg-i b/pkg/trunk/etc/hook/B91dpkg-i
new file mode 100755 (executable)
index 0000000..ee031bb
--- /dev/null
@@ -0,0 +1,28 @@
+#!/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
diff --git a/pkg/trunk/etc/hook/B92test-pkg b/pkg/trunk/etc/hook/B92test-pkg
new file mode 100755 (executable)
index 0000000..7372ca0
--- /dev/null
@@ -0,0 +1,52 @@
+#!/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."
+
diff --git a/pkg/trunk/etc/mini-dinstall.conf.in b/pkg/trunk/etc/mini-dinstall.conf.in
new file mode 100644 (file)
index 0000000..72b7448
--- /dev/null
@@ -0,0 +1,3 @@
+archive_dir = @ROOT@/var/archive
+logfile = @ROOT@/var/mini-dinstall.log
+
diff --git a/pkg/trunk/etc/pbuilderrc.in b/pkg/trunk/etc/pbuilderrc.in
new file mode 100644 (file)
index 0000000..f0424d8
--- /dev/null
@@ -0,0 +1,4 @@
+HOOKDIR=@ROOT@/etc/hook
+BUILDRESULT=@ROOT@/var/incoming
+EXTRAPACKAGES='debhelper r-base-dev cdbs r-base-core lintian'
+DISTRIBUTION=lenny
diff --git a/pkg/trunk/pbuilder_setup b/pkg/trunk/pbuilder_setup
deleted file mode 100755 (executable)
index c0ea459..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/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'
-
diff --git a/pkg/trunk/setup b/pkg/trunk/setup
new file mode 100755 (executable)
index 0000000..0bc447f
--- /dev/null
@@ -0,0 +1,11 @@
+#!/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