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

Annotation of /trunk/packaging/debuntu/builddeb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2923 - (hide annotations)
Thu Feb 4 04:05:36 2010 UTC (9 years, 6 months ago) by jfenwick
Original Path: trunk/packaging/lenny/builddeb
File size: 4700 byte(s)
Bringing non-release specific things from stage3.1 r2922 back to trunk

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 2291 OUTPUTROOT=$SRCDIR/build/package/lenny/escript
12     LIBOUT=$OUTPUTROOT/usr/lib/escript
13     BINOUT=$OUTPUTROOT/usr/bin
14     PKGFILES=$SRCDIR/packaging/lenny
15    
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     case "$distro" in
40 jfenwick 2923 "lenny" ) ;;
41     "jaunty" ) needpy26=yes;;
42     "karmic" ) needalt=yes;;
43 jfenwick 2602 *) echo "Unknown distro $distro"; exit 4;;
44     esac
45    
46 jfenwick 2291 if [ -d $OUTPUTROOT ]
47     then
48     rm -rf $OUTPUTROOT || (echo "Error could not clean build area";exit 2)
49     fi
50    
51 jfenwick 2546 ARCHV=`uname -m`
52    
53    
54     case "$ARCHV" in
55 jfenwick 2602 "i686" ) ARCH="i386";;
56 jfenwick 2546 "x86_64" ) ARCH="amd64";;
57     *) echo "Unknown architecture $ARCHV. Unable to build package";exit 3;;
58     esac
59    
60 jfenwick 2602 #Check to ensure people are only building from clean checkouts
61     #(Or at least a single consistent version).
62     SVNREV=`svnversion` || (echo "Error - can't determine svn version"; exit 5)
63     SVNERR=`echo $SVNREV | grep '[^[:digit:]]'`
64    
65     if [ -n "$SVNERR" ]
66     then
67     echo "Please build packages using a clean checkout."
68     echo "Your version string shows $SVNREV"
69     exit 6
70     fi
71    
72     echo "Reading package version from $PKGFILES/escript/DEBIAN/control"
73     #Now get the package version
74     VERSION=`grep "Version:" $PKGFILES/escript/DEBIAN/control | cut -f2 -d\ `
75    
76     read -p "Build package with version $VERSION?(Y/N)" DOBUILD
77    
78     if [ "$DOBUILD" != 'Y' ]
79     then
80     echo "Aborting"
81     exit 7
82     fi
83    
84 jfenwick 2291 mkdir -p $OUTPUTROOT
85    
86     #First copy debian skeleton
87     cp -r $PKGFILES/escript/* $OUTPUTROOT
88 jfenwick 2923 find $OUTPUTROOT -name ".svn" | xargs rm -rf
89 jfenwick 2291
90 jfenwick 2923 pkgname=escript
91 jfenwick 2291
92 jfenwick 2923 #If we are building transitional package we may need replacement files
93     if [ -n "$needalt" ]
94     then
95     echo "Switching to alternative package"
96     cp -r $PKGFILES/escript-noalias/* $OUTPUTROOT
97     pkgname=escript-noalias
98     find $OUTPUTROOT -name ".svn" | xargs rm -rf
99     fi
100    
101 jfenwick 2291 mkdir -p $OUTPUTROOT/usr/share/man/man1
102    
103     #copy the man page
104 jfenwick 2359 cp $SRCDIR/doc/manpage/man1/$WRAPPERNAME.1 $OUTPUTROOT/usr/share/man/man1
105 jfenwick 2923
106 jfenwick 2294 gzip $OUTPUTROOT/usr/share/man/man1/$WRAPPERNAME.1
107 jfenwick 2923 if [ -z "$needalt" ] #We are not building the alt package
108     then
109     pushd $OUTPUTROOT/usr/share/man/man1 > /dev/null || (echo "A directory has disappeared" ; exit 8)
110     ln -s $WRAPPERNAME.1.gz escript.1.gz
111     popd > /dev/null
112     fi
113 jfenwick 2291
114 jfenwick 2923
115    
116 jfenwick 2302 #copy the documentation
117     cp $SRCDIR/release/doc/escript_examples.tar.gz $OUTPUTROOT/usr/share/doc/escript/
118     cp $SRCDIR/release/doc/install/install.pdf $OUTPUTROOT/usr/share/doc/escript
119     cp $SRCDIR/release/doc/user/guide.pdf $OUTPUTROOT/usr/share/doc/escript
120 jfenwick 2923 cp $SRCDIR/release/doc/cookbook/cookbook.pdf $OUTPUTROOT/usr/share/doc/escript
121 jfenwick 2302 cp -r $SRCDIR/release/doc/epydoc $OUTPUTROOT/usr/share/doc/escript/python_html
122    
123 jfenwick 2291 mkdir -p $LIBOUT/lib
124     mkdir -p $BINOUT
125     #Should be using install here?
126 jfenwick 2359 cp $SRCDIR/lib/* $LIBOUT/lib
127 jfenwick 2291 cp -r $SRCDIR/esys $LIBOUT
128    
129     # We should be using the standard python
130     export ESCRIPT_ROOT=/usr/lib/escript
131    
132 jfenwick 2923 sed -e "s%STDLOCATION=0%STDLOCATION=1%" < $SRCDIR/bin/$WRAPPERNAME > $BINOUT/$WRAPPERNAME
133 jfenwick 2291
134 jfenwick 2923 if [ -z "$needalt" ]
135     then
136     pushd $BINOUT > /dev/null || (echo "A directory has disappeared" ; exit 8)
137     ln -s $WRAPPERNAME escript
138     popd > /dev/null
139     fi
140    
141 jfenwick 2291 #end content from finley_wrapper_writer.sh
142    
143 jfenwick 2294 cd $BINOUT
144     cd $SRCDIR
145    
146 jfenwick 2291 #Nuke any svn stuff that made it in
147     find $OUTPUTROOT -name ".svn" | xargs rm -rf
148    
149    
150 jfenwick 2546 #Say what version of the debian packaging format we are using:
151     #This is NOT the package version
152 jfenwick 2291 echo 2.0 > $OUTPUTROOT/../debian-binary
153    
154     #Check some permissions
155     chmod og=rx $BINOUT/$WRAPPERNAME
156     if [ -f $LIBOUT/pythonMPI ]
157     then
158     chmod og=rx $LIBOUT/pythonMPI
159     fi
160    
161     cd $OUTPUTROOT
162    
163     cd usr/share/doc/escript/
164     gzip changelog.Debian
165    
166     cd $OUTPUTROOT
167     #Fix directory perms
168     chmod -R og-w .
169    
170     cd DEBIAN
171 jfenwick 2546
172     #Now we need to update the architecture
173 jfenwick 2923 sed -i -e "s%Architecture: i386%Architecture: $ARCH%" control
174     if [ -n "$needpy26" ]
175 jfenwick 2602 then
176     echo "Replacing python2.5 dependency with python2.6 for jaunty"
177 jfenwick 2923 sed -i -e "s%Depends: python2.5%Depends: python2.6%" control
178 jfenwick 2602 fi
179 jfenwick 2546
180     tar czf ../../control.tar.gz .
181 jfenwick 2291 cd ..
182 jfenwick 2546 tar czf ../data.tar.gz usr
183 jfenwick 2291 cd ..
184    
185    
186    
187 jfenwick 2923 ar rcu $pkgname-$VERSION-$distro\_$ARCH.deb debian-binary control.tar.gz data.tar.gz
188 jfenwick 2291
189 jfenwick 2923 mkdir -p $SRCDIR/release/pkg
190     cp $pkgname-$VERSION-$distro\_$ARCH.deb $SRCDIR/release/pkg
191 jfenwick 2291
192 jfenwick 2923

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26