comparison deploy/linux/deploy-deb.sh @ 252:120723f7698b

Bring in proto Linux deploy stuff from SV repo
author Chris Cannam
date Tue, 22 Mar 2016 12:07:54 +0000
parents
children 7dd6795af5e6
comparison
equal deleted inserted replaced
251:b49f12c9e869 252:120723f7698b
1 #!/bin/bash
2 #
3 # Run this from the build root
4
5 usage() {
6 echo
7 echo "Usage:"
8 echo
9 echo "$0 <version> <architecture>"
10 echo
11 echo "For example: $0 2.4cc1-1 amd64"
12 echo
13 exit 2
14 }
15
16 version="$1"
17 arch="$2"
18
19 if [ -z "$version" ] || [ -z "$arch" ]; then
20 usage
21 fi
22
23 program=sonic-annotator
24 depdir=deploy/linux
25
26 targetdir="${program}_${version}_${arch}"
27
28 echo "Target dir is $targetdir"
29
30 if [ -d "$targetdir" ]; then
31 echo "Target directory exists, not overwriting"
32 exit
33 fi
34
35 mkdir "$targetdir"
36
37 cp -r "$depdir"/deb-skeleton/* "$targetdir"/
38
39 mkdir -p "$targetdir"/usr/bin
40
41 cp "$program" "$targetdir"/usr/bin/
42
43 cp README "$targetdir"/usr/share/doc/"$program"/
44
45 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
46
47 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
48
49 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
50
51 control_ver=${version%-?}
52
53 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
54
55 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
56
57 sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
58