]> err.no Git - mapper/blob - dpkg-build.sh
ef4f7b281fe485ed544716102ab86634724ffd2b
[mapper] / dpkg-build.sh
1 #!/bin/sh
2 #
3 # This little script builds an appropriately-versioned .deb file depending
4 # on IT OS give.
5 #
6 # OS2006
7 #  For 770 (-mcpu=arm926ej-s), the version is suffixed with "-1".
8 #
9 # OS2007
10 #  For N800 (-mcpu=arm1136jf-s), the version is suffixed with "-2".
11
12 # OS2008
13 #  For N800 and N810, the version is suffixed with "-3".
14
15 CHANGELOG=`dirname $0`/debian/changelog
16
17 case "$1" in
18         OS2008)
19     CFLAGS="-O2 -pipe -mcpu=arm1136jf-s"
20     VERSION_SUFFIX=-3
21     DBP_EXTRA=-B
22     ;;
23         OS2007)
24     CFLAGS="-O2 -pipe -mcpu=arm926ej-s"
25     VERSION_SUFFIX=-2
26     DBP_EXTRA=-B
27     ;;
28     OS2006)
29     CFLAGS="-O2 -pipe -mcpu=arm926ej-s"
30     VERSION_SUFFIX=-1
31     DBP_EXTRA=
32         *)
33         echo "Give one of OS2006, OS2007 or OS2008 as parameter"
34 esac
35
36 head -n 1 $CHANGELOG | sed "s/)/$VERSION_SUFFIX)/" > $CHANGELOG.new
37 awk 'NR>1 {print}' $CHANGELOG >> $CHANGELOG.new
38 mv $CHANGELOG $CHANGELOG.old
39 mv $CHANGELOG.new $CHANGELOG
40
41 dpkg-buildpackage -rfakeroot -I.git $DBP_EXTRA
42
43 mv $CHANGELOG.old $CHANGELOG