[r-backports] / backport_r-base.sh Repository:
ViewVC logotype

Annotation of /backport_r-base.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 75 - (view) (download) (as text)

1 : ranke 54 #!/bin/bash
2 :    
3 : ranke 56 # Script to automate backporting r-base for CRAN
4 : ranke 54
5 : ranke 56 # Author: Johannes Ranke <jranke@uni-bremen.de>
6 : ranke 61
7 : ranke 56 # Developed in parallel with Vincent Goulet <vincent.goulet@act.ulaval.ca>
8 : ranke 61 # On Debian I used to run this script as root. On Ubuntu I now run it with
9 :     # sudo -E sh backport_r-base.sh
10 : ranke 54
11 : ranke 56 # Preconditions: - shell variables DIST and ARCH
12 :     # - sid sources in /etc/apt/sources/list
13 : ranke 61 # - cdbs installed (and maybe more)
14 : ranke 54
15 : ranke 56 export DEBEMAIL="jranke@uni-bremen.de"
16 :     export DEBFULLNAME="Johannes Ranke"
17 :     echo Distribution is $DIST
18 :     echo Architecture is $ARCH
19 : ranke 54
20 : ranke 56 if [ -d r-base-* ]
21 :     then
22 :     rm -rf `ls -d r-base-*`
23 :     fi
24 :    
25 : ranke 62 apt-get update
26 : ranke 64 apt-get source r-base
27 : ranke 56
28 :     # Change any ~ in the name of the build directory for a - to avoid a
29 :     # bug in texi2dvi. Thanks Vincent
30 :     if [ -d r-base-*~* ]
31 :     then
32 :     dir=`ls -d r-base-*~*`
33 :     mv $dir `echo $dir | sed y/~/-/`
34 :     fi
35 :    
36 : ranke 54 cd r-base-*
37 :    
38 :     # Old version
39 :     oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "`
40 : ranke 56 cranversion=$oldversion"~"$DIST"cran.0"
41 : ranke 54
42 : ranke 61 echo Old version is $oldversion
43 :     echo CRAN version is $cranversion
44 :    
45 : ranke 54 # Add new version to changelog
46 : ranke 60 dch -v "${cranversion}" --force-distribution -D $DIST-cran -b "Backport from Debian unstable to Debian $DIST"
47 : ranke 54
48 : ranke 69 # Reverts for squeeze and lenny:
49 :     # None at present
50 : ranke 54
51 : ranke 69 # Reverts for lenny only:
52 :     if [ $DIST = "lenny" ]
53 :     then
54 :    
55 : ranke 61 # 1. Starting with Debian packages for R 2.9.2 there is a build dependency
56 :     # on debhelper >= 7.2.3, which is not in lenny nor etch This also means we
57 :     # have to reinclude debian/r-doc-{info,html}.{postinst,prerm}, thanks Dirk
58 :     # for pointing this out.
59 : ranke 60
60 :     sed -i '/^Build-Depends/s/debhelper (>= 7.2.3)/debhelper/' debian/control
61 :     dch -a "debian/control: revert Build-Depends: to 'debhelper' since $DIST has a version < 7.2.3"
62 :     sed -i 's/dh_prep/dh_clean/g' debian/rules
63 : ranke 75 dch -a "debian/rules: revert dh_prep calls to dh_clean calls since the latter is not present lennys version of 'debhelper'"
64 : ranke 60
65 : ranke 61 # 2. Starting with Debian packages for R 2.9.2-2 there is an install
66 :     # dependency on 'dpkg (>= 1.15.4) | install-info'. Neither package is in
67 :     # Debian releases etch nor lenny. This also requires to reinclude
68 :     # debian/r-doc-{info,html}.{postinst,prerm}, just like for the fix above.
69 :    
70 :     sed -i '/^Depends/s/dpkg (>= 1.15.4) | install-info/dpkg | install-info/' debian/control
71 : ranke 75 dch -a "debian/control: revert Depends: to 'dpkg | install-info' for r-doc-info since lenny has a version of dpkg < 1.15.4 and no separate package install-info"
72 : ranke 61
73 : ranke 67 # 3. liblzma is not available in Debian distributions before squeeze
74 :    
75 :     sed -i '/^Build-Depends/s/, liblzma-dev//' debian/control
76 : ranke 75 dch -a "debian/control: Remove dependency to liblzma-dev as it is not available in lenny. As a consequence, the version provided in the R sources is used"
77 : ranke 58 fi
78 :    
79 : ranke 69 pbuilder update
80 : ranke 61 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 /var/cache/pbuilder/$DIST-$ARCH/aptcache --buildplace /var/cache/pbuilder/$DIST-$ARCH/build
81 : ranke 54 if [ $? -ne 0 ]; then
82 : ranke 56 exit
83 : ranke 54 fi
84 :    
85 :     cd ..

Johannes Ranke
ViewVC Help
Powered by ViewVC 1.0.1