summaryrefslogtreecommitdiff
path: root/backport_others.sh
blob: 5c18ad89e21c8a4869ba6cf33558fa4cc0926ffb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Author: Johannes Ranke <jranke@uni-bremen.de>

# On Debian I used to run this script as root. On Ubuntu I now run it with 
# sudo -E sh backport_others.sh

# Preconditions: - shell variables DIST and ARCH
#                - current R backport in /etc/apt/sources/list
#                - sid sources in /etc/apt/sources/list
#                - ssed and cdbs installed (and maybe more)
#                - Edit R version and the sed scripts below (don't forget
#                  distribution name) to the appropriate version of R
#                - Set the R version

# R version against which the software is compiled
Rversion=2.12.0

echo Distribution is $DIST
echo Architecture is $ARCH

text="Recompiled on $DIST for CRAN"

apt-get update
pbuilder update

#for i in r-cran-class; do
for i in boot cluster codetools foreign kernsmooth lattice mgcv nlme r-cran-class r-cran-spatial r-cran-nnet r-cran-mass rmatrix rodbc rpart survival littler rpy; do
    apt-get source $i
    cd $i-*
    version=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "`~$DIST"cran".$Rversion
    dch -b -v $version --force-distribution -D $DIST-cran $text

    ssed -i -R '/^Build-Depends/s/r-base-dev \(>= 2\..*?\)/r-base-dev (>= 2.11.1-1~lennycran.0)/' debian/control
    ssed -i -R '/^Build-Depends-Indep/s/r-base-dev \(>= 2\..*?\)/r-base-dev (>= 2.11.1-1~lennycran.0)/' debian/control

    dch -a "debian/control: adapt build dependencies on r-base-dev to current backport"

    # Backport r-cran-class
    if [ ${i} = "r-cran-class" ]
    then
      	sed -i '/^Build-Depends/s/.*/&, r-cran-mass/' debian/control
        dch -a "debian/control: add Build-Depends: to 'r-cran-mass'"
    fi

    # Backport rpy
    if [ ${i} = "rpy" ]
    then
      	sed -i '/^Build-Depends/s/debhelper (>= 7.2.17)/debhelper/' debian/control
        dch -a "debian/control: revert Build-Depends: to 'debhelper' since lenny has a version of debhelper < 7.2.17"
        sed -i '/^Build-Depends/s/python-numpy (>= 1:1.3.0)/python-numpy/' debian/control
        dch -a "debian/control: revert Build-Depends: to 'python-numpy' since lenny has a version of python-numpy < 1.3.0"
        sed -i '/^Depends/s/python-numpy (>= 1:1.3.0)/python-numpy/' debian/control
        dch -a "debian/control: revert Depends: to 'python-numpy' since lenny has a version of python-numpy < 1.3.0"
    fi

    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
    cd ..
done

Contact - Imprint