/[escript]/trunk/packaging/debuntu/builddeb
ViewVC logotype

Annotation of /trunk/packaging/debuntu/builddeb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3339 - (hide annotations)
Fri Nov 5 05:30:31 2010 UTC (8 years, 9 months ago) by jfenwick
File size: 5210 byte(s)
Fixed more package clashing problems.
Package install.pdf not install.tex
Changed title on most documents to esys-Escript except for the cookbook coz I like ti that way.
1 jfenwick 2291 #!/bin/bash
2    
3     #This script produced with the aid of "The Debian System concepts and techniques" By Martin F. Krafft
4     # Its purpose is to produce a .deb for escript
5    
6 jfenwick 2546
7     #A ~ in front of the version number indicates a pre-release and will sort earlier than versions without ~
8 jfenwick 2291 SRCDIR=`pwd`
9 jfenwick 2923 WRAPPERNAME=run-escript
10 jfenwick 2409 #ALTWRAPPERNAME=finleypython
11 jfenwick 3322 OUTPUTROOT=$SRCDIR/build/package/debuntu/escript
12 jfenwick 2291 LIBOUT=$OUTPUTROOT/usr/lib/escript
13     BINOUT=$OUTPUTROOT/usr/bin
14 jfenwick 3322 PKGFILES=$SRCDIR/packaging/debuntu
15 jfenwick 2291
16     # check to be sure we are running from the project root and that we look like the root user
17    
18     if [ `whoami` != 'root' ]
19     then
20     echo "Please execute this script under fakeroot."
21     echo "fakeroot $0"
22     exit 1
23     fi
24    
25     if [ ! -d escript/src ]
26     then
27     echo "Please execute this script from the root of the project"
28     exit 3
29     fi
30    
31 jfenwick 2602 if [ $# -lt 1 ]
32     then
33     echo "Usage: builddeb distro"
34     exit 4
35     fi
36    
37     distro=$1
38    
39 jfenwick 3322 # case "$distro" in
40     # "lenny" ) ;;
41     # "jaunty" ) needpy26=yes;;
42     # "karmic" ) needalt=yes;;
43     # "lucid" ) needalt=yes;;
44     # "maverick" ) needalt=yes;;
45     # *) echo "Unknown distro $distro"; exit 4;;
46     # esac
47 jfenwick 2602
48 jfenwick 2291 if [ -d $OUTPUTROOT ]
49     then
50     rm -rf $OUTPUTROOT || (echo "Error could not clean build area";exit 2)
51     fi
52    
53 jfenwick 2546 ARCHV=`uname -m`
54    
55    
56     case "$ARCHV" in
57 jfenwick 2602 "i686" ) ARCH="i386";;
58 jfenwick 2546 "x86_64" ) ARCH="amd64";;
59     *) echo "Unknown architecture $ARCHV. Unable to build package";exit 3;;
60     esac
61    
62 jfenwick 2602 #Check to ensure people are only building from clean checkouts
63     #(Or at least a single consistent version).
64     SVNREV=`svnversion` || (echo "Error - can't determine svn version"; exit 5)
65     SVNERR=`echo $SVNREV | grep '[^[:digit:]]'`
66    
67     if [ -n "$SVNERR" ]
68     then
69     echo "Please build packages using a clean checkout."
70     echo "Your version string shows $SVNREV"
71     exit 6
72     fi
73    
74 jfenwick 3322 #Now try to identify versions we are using
75     PYPKG=`dpkg --get-selections 'python?*' | grep install | grep -v '-' | cut -f1`
76     if [ `echo $PYPKG | wc -w ` != "1" ]
77     then
78     echo "Can't determine the version of python"
79     exit 8
80     fi
81    
82     echo "Python package is $PYPKG."
83    
84     BOOSTPKG=`dpkg --get-selections 'libboost-python?????*' | grep -v 'de' | grep 'install' | cut -f1`
85     if [ `echo $BOOSTPKG | wc -w` != "1" ]
86     then
87     echo "Can't determine the version of boost"
88     exit 9
89     fi
90    
91     echo "Boost package is $BOOSTPKG"
92    
93 jfenwick 2602 echo "Reading package version from $PKGFILES/escript/DEBIAN/control"
94     #Now get the package version
95     VERSION=`grep "Version:" $PKGFILES/escript/DEBIAN/control | cut -f2 -d\ `
96    
97     read -p "Build package with version $VERSION?(Y/N)" DOBUILD
98    
99     if [ "$DOBUILD" != 'Y' ]
100     then
101     echo "Aborting"
102     exit 7
103     fi
104    
105 jfenwick 2291 mkdir -p $OUTPUTROOT
106    
107     #First copy debian skeleton
108     cp -r $PKGFILES/escript/* $OUTPUTROOT
109 jfenwick 2923 find $OUTPUTROOT -name ".svn" | xargs rm -rf
110 jfenwick 2291
111 jfenwick 2923 pkgname=escript
112 jfenwick 2291
113     mkdir -p $OUTPUTROOT/usr/share/man/man1
114    
115     #copy the man page
116 jfenwick 2359 cp $SRCDIR/doc/manpage/man1/$WRAPPERNAME.1 $OUTPUTROOT/usr/share/man/man1
117 jfenwick 2923
118 jfenwick 2294 gzip $OUTPUTROOT/usr/share/man/man1/$WRAPPERNAME.1
119 jfenwick 3339 #if [ -z "$needalt" ] #We are not building the alt package
120     #then
121     # pushd $OUTPUTROOT/usr/share/man/man1 > /dev/null || (echo "A directory has disappeared" ; exit 8)
122     # ln -s $WRAPPERNAME.1.gz escript.1.gz
123     # popd > /dev/null
124     #fi
125 jfenwick 2291
126 jfenwick 2923
127    
128 jfenwick 2302 #copy the documentation
129     cp $SRCDIR/release/doc/escript_examples.tar.gz $OUTPUTROOT/usr/share/doc/escript/
130     cp $SRCDIR/release/doc/install/install.pdf $OUTPUTROOT/usr/share/doc/escript
131     cp $SRCDIR/release/doc/user/guide.pdf $OUTPUTROOT/usr/share/doc/escript
132 jfenwick 2923 cp $SRCDIR/release/doc/cookbook/cookbook.pdf $OUTPUTROOT/usr/share/doc/escript
133 jfenwick 2302 cp -r $SRCDIR/release/doc/epydoc $OUTPUTROOT/usr/share/doc/escript/python_html
134    
135 jfenwick 2291 mkdir -p $LIBOUT/lib
136     mkdir -p $BINOUT
137     #Should be using install here?
138 jfenwick 2359 cp $SRCDIR/lib/* $LIBOUT/lib
139 jfenwick 2291 cp -r $SRCDIR/esys $LIBOUT
140    
141     # We should be using the standard python
142     export ESCRIPT_ROOT=/usr/lib/escript
143    
144 jfenwick 2923 sed -e "s%STDLOCATION=0%STDLOCATION=1%" < $SRCDIR/bin/$WRAPPERNAME > $BINOUT/$WRAPPERNAME
145 jfenwick 2291
146 jfenwick 3322 sed -ie "s%PYPKG%$PYPKG%" $OUTPUTROOT/DEBIAN/control
147     sed -ie "s%BOOSTPKG%$BOOSTPKG%" $OUTPUTROOT/DEBIAN/control
148 jfenwick 2923
149 jfenwick 3322
150     # if [ -z "$needalt" ]
151     # then
152     # pushd $BINOUT > /dev/null || (echo "A directory has disappeared" ; exit 8)
153     # ln -s $WRAPPERNAME escript
154     # popd > /dev/null
155     # fi
156    
157 jfenwick 2291 #end content from finley_wrapper_writer.sh
158    
159 jfenwick 2294 cd $BINOUT
160     cd $SRCDIR
161    
162 jfenwick 2291 #Nuke any svn stuff that made it in
163     find $OUTPUTROOT -name ".svn" | xargs rm -rf
164    
165    
166 jfenwick 2546 #Say what version of the debian packaging format we are using:
167     #This is NOT the package version
168 jfenwick 2291 echo 2.0 > $OUTPUTROOT/../debian-binary
169    
170     #Check some permissions
171     chmod og=rx $BINOUT/$WRAPPERNAME
172     if [ -f $LIBOUT/pythonMPI ]
173     then
174     chmod og=rx $LIBOUT/pythonMPI
175     fi
176    
177     cd $OUTPUTROOT
178    
179     cd usr/share/doc/escript/
180     gzip changelog.Debian
181    
182     cd $OUTPUTROOT
183     #Fix directory perms
184     chmod -R og-w .
185    
186     cd DEBIAN
187 jfenwick 2546
188     #Now we need to update the architecture
189 jfenwick 2923 sed -i -e "s%Architecture: i386%Architecture: $ARCH%" control
190 jfenwick 3322 # if [ -n "$needpy26" ]
191     # then
192     # echo "Replacing python2.5 dependency with python2.6 for jaunty"
193     # sed -i -e "s%Depends: python2.5%Depends: python2.6%" control
194     # fi
195 jfenwick 2546
196     tar czf ../../control.tar.gz .
197 jfenwick 2291 cd ..
198 jfenwick 2546 tar czf ../data.tar.gz usr
199 jfenwick 2291 cd ..
200    
201    
202    
203 jfenwick 2923 ar rcu $pkgname-$VERSION-$distro\_$ARCH.deb debian-binary control.tar.gz data.tar.gz
204 jfenwick 2291
205 jfenwick 2923 mkdir -p $SRCDIR/release/pkg
206     cp $pkgname-$VERSION-$distro\_$ARCH.deb $SRCDIR/release/pkg
207 jfenwick 2291
208 jfenwick 2923
209 jfenwick 3322 echo "Control file is:"
210     cat $OUTPUTROOT/DEBIAN/control

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26