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

Annotation of /backport_r-base.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (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 58 #apt-get update
26 : ranke 54 apt-get source -t unstable 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 60 # Reverts for lenny and etch:
49 : ranke 54
50 : ranke 61 # 1. Starting with Debian packages for R 2.9.2 there is a build dependency
51 :     # on debhelper >= 7.2.3, which is not in lenny nor etch This also means we
52 :     # have to reinclude debian/r-doc-{info,html}.{postinst,prerm}, thanks Dirk
53 :     # for pointing this out.
54 : ranke 60
55 :     sed -i '/^Build-Depends/s/debhelper (>= 7.2.3)/debhelper/' debian/control
56 :     dch -a "debian/control: revert Build-Depends: to 'debhelper' since $DIST has a version < 7.2.3"
57 :     sed -i 's/dh_prep/dh_clean/g' debian/rules
58 : ranke 61 dch -a "debian/rules: revert dh_prep calls to dh_clean calls since the latter is not present in this release's version of 'debhelper'"
59 :     cp ../r-doc-scripts/r-doc-{info,html}.{postinst,prerm} debian
60 : ranke 60
61 : ranke 61 # 2. Starting with Debian packages for R 2.9.2-2 there is an install
62 :     # dependency on 'dpkg (>= 1.15.4) | install-info'. Neither package is in
63 :     # Debian releases etch nor lenny. This also requires to reinclude
64 :     # debian/r-doc-{info,html}.{postinst,prerm}, just like for the fix above.
65 :    
66 :     sed -i '/^Depends/s/dpkg (>= 1.15.4) | install-info/dpkg | install-info/' debian/control
67 :     dch -a "debian/control: revert Depends: to 'dpkg | install-info' for r-doc-info since ${DISTRIB_DESCRIPTION} has a version of dpkg < 1.15.4 and no separate package install-info"
68 :    
69 : ranke 60 # Reverts for etch only:
70 : ranke 58 if [ $DIST = "etch" ]
71 :     then
72 :     # 1. Starting with Debian packages for R 2.6.1-2, the build dependency
73 :     # to 'refblas3-dev|atlas3-base-dev' is changed to 'libblas-dev' to
74 :     # use the new gfortran-built BLAS libraries. From R 2.7.0, the
75 :     # dependency is on 'libblas-dev | libatlas-base-dev' for
76 :     # r-base-dev.
77 :    
78 :     sed -i '/^Build-Depends/s/libblas-dev/refblas3-dev|atlas3-base-dev/' debian/control
79 :     sed -i '/^Depends/s/libblas-dev | libatlas-base-dev/refblas3-dev|atlas3-base-dev/' debian/control
80 :     dch -a "debian/control: revert Build-Depends: to 'refblas3-dev|atlas3-base-dev' and Depends: to 'refblas3-dev|atlas3-base-dev' since etch does not have the new gfortran-built BLAS libraries"
81 :    
82 :     # 2. Starting with Debian packages for R 2.6.2, new build dependency
83 :     # on liblapack-dev to switch back to using Debian's Lapack rather
84 :     # than the version supplied by R. From R 2.7.0, the dependency is
85 :     # on 'liblapack-dev (>= 3.1.1)' for r-base and 'liblapack-dev |
86 :     # libatlas-base-dev' for r-base-dev.
87 :    
88 :     sed -i '/^Build-Depends/s/liblapack-dev (>= 3.1.1), //' debian/control
89 :     sed -i '/^Depends/s/liblapack-dev | libatlas-base-dev, //' debian/control
90 :     dch -a "debian/control: revert Build-Depends: and Depends: fields since we use the Lapack supplied with R"
91 :     sed -i '/^lapack/{
92 :     s/lapack/\#lapack/
93 :     a\
94 :     # jr 24 Apr 2008 Set to =no for Debian etch
95 :     a\lapack = --with-lapack=no
96 :     }' debian/rules
97 :     dch -a "debian/rules: Accordingly, do not configure --with-lapack"
98 :    
99 :     # 3. Requirement for tk8.4 >= 8.4.16-2 introduced in r-base 2.6.0-4 to
100 :     # circumvent a breakage with 8.4.16-1. The version in etch is 8.4.12-1etch2.
101 :    
102 :     rm debian/shlibs.local
103 :     dch -a "delete debian/shlibs.local since the dependency on tk8.4 is not an issue for Debian etch"
104 :    
105 :     # 4. The TeX distribution in etch is tetex
106 :    
107 :     sed -i '/^Build-Depends/s/texlive-base, texlive-latex-base, texlive-generic-recommended, texlive-fonts-recommended, texlive-extra-utils, texlive-latex-recommended, texlive-latex-extra, texinfo, texi2html/tetex-bin, tetex-extra/' debian/control
108 :     dch -a "debian/control: revert Build-Depends: to 'tetex-bin, tetex-extra' since etch does not have texlive"
109 :    
110 :     # 5. xauth is part of xbase-clients in etch
111 :    
112 :     sed -i '/^Build-Depends/s/xauth/xbase-clients/' debian/control
113 :     dch -a "debian/control: replace xauth by xbase-clients in Build-Depends:"
114 :    
115 :     # 6. Tcl and TK are 8.4 on Debian etch
116 :    
117 :     sed -i '/^Build-Depends/s/ tcl8.5-dev/tcl8.4-dev/' debian/control
118 :     sed -i '/^Build-Depends/s/ tk8.5-dev/tk8.4-dev/' debian/control
119 :     dch -a "debian/control: revert build dependence for tcl/tk to 8.4"
120 :    
121 :     # 7. Openjdk is not in etch
122 :    
123 :     sed -i '/^Build-Depends/s/, openjdk-6-jdk \[!arm !hppa !kfreebsd-i386 !kfreebsd-amd64 !hurd-i386\]//' debian/control
124 :     dch -a "debian/control: Remove build dependence on openjdk"
125 :    
126 : ranke 60 # 8. Debhelper in etch is 5.0.42
127 : ranke 58
128 :     echo 5 > debian/compat
129 :     dch -a "debian/compat: revert 'debhelper' compatibility level to 5"
130 :    
131 :     # 9. R 2.9.0 wants ucf >= 3.0 which is not available in etch (2.0020)
132 :    
133 :     sed -i 's/ucf (>= 3.0)/ucf/' debian/control
134 :     dch -a "debian/control: revert Depends: of r-base-core to 'ucf' since the version in etch is < 3.0"
135 :     fi
136 :    
137 : ranke 60 pbuilder update
138 : 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
139 : ranke 54 if [ $? -ne 0 ]; then
140 : ranke 56 exit
141 : ranke 54 fi
142 :    
143 :     cd ..

Johannes Ranke
ViewVC Help
Powered by ViewVC 1.0.1