lib: added BuildHeader / BuildFields member functions
[barry.git] / maintainer / make-deb-local.sh
blobae2011ff452ba1b753ffe2b8dee9e44d568afb8d
1 #!/bin/sh
3 if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$5" ] ; then
4 echo
5 echo "Usage: ./make-deb-local-root.sh tarball LOGICAL MAJOR MINOR target_name"
6 echo
7 echo "Extracts tarball in temporary directory and builds Debian"
8 echo "packages based on the internal debian scripts. Assumes"
9 echo "that it is running on a development Debian system."
10 echo
11 echo "target_name is the directory under build/ that the .deb"
12 echo "files will be placed into."
13 echo
14 exit 1
17 TARPATH="$1"
18 TARNAME=`basename "$TARPATH"`
19 LOGICAL="$2"
20 MAJOR="$3"
21 MINOR="$4"
22 TARGET="$5"
24 set -e
26 # Build package in /usr/src so that the dbg packages refer to the source
27 # code in a user-friendly place.
29 # start clean
30 rm -rf "/usr/src/barry-$LOGICAL.$MAJOR.$MINOR"
31 rm -f /usr/src/*barry*deb
33 # extract from tarball
34 tar -C /usr/src -xjvf "$TARPATH"
36 # build plugin based on available opensync
37 # first check for 0.22 -dev, which has 0 in the name
38 if dpkg -l libopensync0-dev ; then
39 PLUGIN_TARGET=os22-binary
40 elif dpkg -l libopensync1-dev ; then
41 PLUGIN_TARGET=os4x-binary
44 # build base debs
45 (cd "/usr/src/barry-$LOGICAL.$MAJOR.$MINOR" && fakeroot -- debian/rules binary $PLUGIN_TARGET)
46 mkdir -p "build/$TARGET"
47 mv /usr/src/*barry*deb "build/$TARGET"
48 if [ -n "$PLUGIN_TARGET" ] ; then
49 mv /usr/src/barry-$LOGICAL.$MAJOR.$MINOR/*.deb "build/$TARGET"
52 # end clean
53 rm -rf "/usr/src/barry-$LOGICAL.$MAJOR.$MINOR"
54 rm -f /usr/src/*barry*deb