| 1 |
#!/bin/bash |
#!/bin/bash |
| 2 |
|
|
| 3 |
# Script to automate building of r-base and for Debian stable |
# Script to automate backporting r-base for CRAN |
|
# This script should be run as root, in one way or another. |
|
| 4 |
|
|
| 5 |
# Author: Vincent Goulet <vincent.goulet@act.ulaval.ca> |
# Author: Johannes Ranke <jranke@uni-bremen.de> |
| 6 |
# Modified for backporting to Debian stable by |
# Developed in parallel with Vincent Goulet <vincent.goulet@act.ulaval.ca> |
|
# Johannes Ranke <jranke@uni-bremen.de> |
|
| 7 |
|
|
| 8 |
export DEBEMAIL="Johannes Ranke <jranke@uni-bremen.de>" |
# Preconditions: - shell variables DIST and ARCH |
| 9 |
|
# - sid sources in /etc/apt/sources/list |
| 10 |
|
|
| 11 |
rm -rf r-base* r-base-core* r-mathlib* |
export DEBEMAIL="jranke@uni-bremen.de" |
| 12 |
|
export DEBFULLNAME="Johannes Ranke" |
| 13 |
|
echo Distribution is $DIST |
| 14 |
|
echo Architecture is $ARCH |
| 15 |
|
|
| 16 |
|
if [ -d r-base-* ] |
| 17 |
|
then |
| 18 |
|
rm -rf `ls -d r-base-*` |
| 19 |
|
fi |
| 20 |
|
|
| 21 |
#apt-get update # needs real root privileges |
apt-get update |
| 22 |
apt-get source -t unstable r-base |
apt-get source -t unstable r-base |
| 23 |
|
|
| 24 |
|
# Change any ~ in the name of the build directory for a - to avoid a |
| 25 |
|
# bug in texi2dvi. Thanks Vincent |
| 26 |
|
if [ -d r-base-*~* ] |
| 27 |
|
then |
| 28 |
|
dir=`ls -d r-base-*~*` |
| 29 |
|
mv $dir `echo $dir | sed y/~/-/` |
| 30 |
|
fi |
| 31 |
|
|
| 32 |
cd r-base-* |
cd r-base-* |
| 33 |
|
|
| 34 |
# Old version |
# Old version |
| 35 |
oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "` |
oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "` |
| 36 |
cranversion=$oldversion"~lennycran.0" |
cranversion=$oldversion"~"$DIST"cran.0" |
| 37 |
|
|
| 38 |
# Add new version to changelog |
# Add new version to changelog |
| 39 |
dch -v "${cranversion}" -D lenny-cran -b "Backport from Debian unstable to Debian lenny" |
dch -v "${cranversion}" -D $DIST-cran -b "Backport from Debian unstable to Debian $DIST" |
| 40 |
|
|
| 41 |
# Reverts for lenny: |
# Reverts for lenny: |
| 42 |
# |
# None at this time |
| 43 |
|
|
| 44 |
# Build package showing all messages and separating output to build and error logs |
pbuilder update |
| 45 |
(dpkg-buildpackage -tc | tee ../build_log_r-base_i386) 3>&1 1>&2 2>&3 | tee ../build_errors_r-base_i386 |
pdebuild --debbuildopts '-sa' --buildresult /home/ranke/svn/website/www/ranke/r-cran/$DIST-cran/ -- --distribution $DIST --basetgz /var/cache/pbuilder/$DIST-$ARCH-base.tgz --aptcache /exthd/pbuilder/$DIST-$ARCH/aptcache --buildplace /exthd/pbuilder/$DIST-$ARCH/build |
| 46 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
| 47 |
exit 1 |
exit |
| 48 |
fi |
fi |
| 49 |
|
|
| 50 |
cd .. |
cd .. |
| 51 |
|
|
| 52 |
# Create diff to Debian unstable |
# Create diff to Debian unstable |
| 53 |
interdiff -z *.diff.gz > interdiff_to_debian_sid |
interdiff -z r-base_*.diff.gz /home/ranke/svn/website/www/ranke/r-cran/$DIST-cran/r-base_*cran*.diff.gz > /home/ranke/svn/website/www/ranke/r-cran/$DIST-cran/interdiff_to_debian_sid |
|
|
|
|
# Sign logs and interdiff |
|
|
for i in interdiff_to_debian_sid build_log_r-base_i386 build_errors_r-base_i386 |
|
|
do |
|
|
gpg --clearsign $i |
|
|
mv $i.asc $i |
|
|
done |
|