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

Annotation of /r-base/backport_r-base.sh

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : ranke 29 #!/bin/bash
2 :    
3 :     # Script to automate building of r-base and r-recommended packages for
4 :     # the Ubuntu release specified in file /etc/lsb-release. This script
5 :     # should be run as root, in one way or another.
6 :    
7 :     # Author: Vincent Goulet <vincent.goulet@act.ulaval.ca>
8 :     # Modified for backporting to Debian etch by
9 :     # Johannes Ranke <jranke@uni-bremen.de>
10 :    
11 :     export DEBEMAIL="Johannes Ranke <jranke@uni-bremen.de>"
12 :    
13 : ranke 48 #rm -rf r-base* r-base-core* r-mathlib*
14 : ranke 29
15 : ranke 51 #apt-get update
16 : ranke 29 apt-get source -t unstable r-base
17 :     cd r-base-*
18 :    
19 :     # Old version
20 :     oldversion=`dpkg-parsechangelog | grep ^Version | cut -f2 -d " "`
21 : ranke 46 cranversion=$oldversion"~etchcran.1"
22 : ranke 29
23 :     # Add new version to changelog
24 :     dch -v "${cranversion}" -D etch-cran -b "Backport form Debian unstable to Debian etch"
25 :    
26 :     # Reverts for etch:
27 :     #
28 :     # 1. Starting with Debian packages for R 2.6.1-2, the build dependency
29 :     # to 'refblas3-dev|atlas3-base-dev' is changed to 'libblas-dev' to
30 :     # use the new gfortran-built BLAS libraries. From R 2.7.0, the
31 :     # dependency is on 'libblas-dev | libatlas-base-dev' for
32 :     # r-base-dev.
33 :    
34 :     sed -i '/^Build-Depends/s/libblas-dev/refblas3-dev|atlas3-base-dev/' debian/control
35 :     sed -i '/^Depends/s/libblas-dev | libatlas-base-dev/refblas3-dev|atlas3-base-dev/' debian/control
36 :     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"
37 :    
38 :     # 2. Starting with Debian packages for R 2.6.2, new build dependency
39 :     # on liblapack-dev to switch back to using Debian's Lapack rather
40 :     # than the version supplied by R. From R 2.7.0, the dependency is
41 :     # on 'liblapack-dev (>= 3.1.1)' for r-base and 'liblapack-dev |
42 :     # libatlas-base-dev' for r-base-dev.
43 :    
44 :     sed -i '/^Build-Depends/s/liblapack-dev (>= 3.1.1), //' debian/control
45 :     sed -i '/^Depends/s/liblapack-dev | libatlas-base-dev, //' debian/control
46 :     dch -a "debian/control: revert Build-Depends: and Depends: fields since we use the Lapack supplied with R"
47 :     sed -i '/^lapack/{
48 :     s/lapack/\#lapack/
49 :     a\
50 :     # jr 24 Apr 2008 Set to =no for Debian etch
51 :     a\lapack = --with-lapack=no
52 :     }' debian/rules
53 :     dch -a "debian/rules: Accordingly, do not configure --with-lapack"
54 :    
55 :     # 3. Requirement for tk8.4 >= 8.4.16-2 introduced in r-base 2.6.0-4 to
56 :     # circumvent a breakage with 8.4.16-1. The version in etch is 8.4.12-1etch2.
57 :    
58 :     rm debian/shlibs.local
59 :     dch -a "delete debian/shlibs.local since the dependency on tk8.4 is not an issue for Debian etch"
60 :    
61 :     # 4. The TeX distribution in etch is tetex
62 :    
63 :     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
64 :     dch -a "debian/control: revert Build-Depends: to 'tetex-bin, tetex-extra' since etch does not have texlive"
65 :    
66 : ranke 36 # 5. xauth is part of xbase-clients in etch
67 :    
68 :     sed -i '/^Build-Depends/s/xauth/xbase-clients/' debian/control
69 :     dch -a "debian/control: replace xauth by xbase-clients in Build-Depends:"
70 :    
71 : ranke 40 # 6. Tcl and TK are 8.4 on Debian etch
72 :    
73 :     sed -i '/^Build-Depends/s/ tcl8.5-dev/tcl8.4-dev/' debian/control
74 :     sed -i '/^Build-Depends/s/ tk8.5-dev/tk8.4-dev/' debian/control
75 :     dch -a "debian/control: revert build dependence for tcl/tk to 8.4"
76 :    
77 : ranke 44 # 7. Openjdk is not in etch
78 :    
79 : ranke 51 sed -i '/^Build-Depends/s/, openjdk-6-jdk \[!arm !hppa !kfreebsd-i386 !kfreebsd-amd64 !hurd-i386\]//' debian/control
80 : ranke 44 dch -a "debian/control: Remove build dependence on openjdk"
81 :    
82 : ranke 51 # 8. R 2.9.0 wants debhelper >= 7.0.0, which is not in etch
83 :    
84 :     sed -i '/^Build-Depends/s/debhelper (>= 7.0.0)/debhelper/' debian/control
85 :     dch -a "debian/control: revert Build-Depends: to 'debhelper' since etch has a version < 7.0.0"
86 :     sed -i 's/dh_prep/dh_clean/g' debian/rules
87 :     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'"
88 :     echo 5 > debian/compat
89 :     dch -a "debian/compat: revert 'debhelper' compatibility level to 5"
90 :    
91 :     # 9. R 2.9.0 wants ucf >= 3.0 which is not available in etch (2.0020)
92 :    
93 :     sed -i 's/ucf (>= 3.0)/ucf/' debian/control
94 :     dch -a "debian/control: revert Depends: of r-base-core to 'ucf' since the version in etch is < 3.0"
95 :    
96 : ranke 29 # Build package showing all messages and separating output to build and error logs
97 :     (dpkg-buildpackage -tc | tee ../build_log_r-base_i386) 3>&1 1>&2 2>&3 | tee ../build_errors_r-base_i386
98 :     if [ $? -ne 0 ]; then
99 :     exit 1
100 :     fi
101 :    
102 :     cd ..
103 :    
104 :     # Create diff to Debian unstable
105 :     interdiff -z *.diff.gz > interdiff_to_debian_sid
106 :    
107 :     # Sign logs and interdiff
108 :     for i in interdiff_to_debian_sid build_log_r-base_i386 build_errors_r-base_i386
109 :     do
110 :     gpg --clearsign $i
111 :     mv $i.asc $i
112 :     done

Johannes Ranke
ViewVC Help
Powered by ViewVC 1.0.1