comparison deploy/linux/deploy-deb.sh @ 463:93efb2d59021 v1.0-linuxbuild

Linux deployment bits
author Chris Cannam
date Mon, 13 Apr 2015 13:42:40 +0100
parents
children 56cf3c9982a1
comparison
equal deleted inserted replaced
462:1a8ad855b7cb 463:93efb2d59021
1 #!/bin/bash
2 #
3 # Run this from the build root
4
5 set -e
6
7 usage() {
8 echo
9 echo "Usage:"
10 echo
11 echo "$0 <version> <architecture>"
12 echo
13 echo "For example: $0 1.0cc1-1 amd64"
14 echo
15 exit 2
16 }
17
18 set -u
19
20 version="$1"
21 arch="$2"
22
23 if [ -z "$version" ] || [ -z "$arch" ]; then
24 usage
25 fi
26
27 program=tony
28 plugins="chp pyin"
29
30 depdir=deploy/linux
31
32 targetdir="${program}_${version}_${arch}"
33
34 echo "Target dir is $targetdir"
35
36 if [ -d "$targetdir" ]; then
37 echo "Target directory exists, not overwriting"
38 exit
39 fi
40
41 mkdir "$targetdir"
42
43 cp -r "$depdir"/deb-skeleton/* "$targetdir"/
44
45 mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps
46
47 cp "$program" "$targetdir"/usr/bin/
48
49 for plug in $plugins; do
50 cp "$plug/$plug.so" "$targetdir"/usr/lib/"$program"/
51 done
52
53 cp icons/"$program"-128x128.png "$targetdir"/usr/share/pixmaps/
54 cp "$program".desktop "$targetdir"/usr/share/applications/
55 cp README "$targetdir"/usr/share/doc/"$program"/
56
57 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
58
59 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
60
61 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
62
63 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
64
65 sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
66