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