Chris@700
|
1 #!/bin/bash
|
Chris@700
|
2 #
|
Chris@700
|
3 # Run this from the build root (with sudo, I think)
|
Chris@700
|
4
|
Chris@700
|
5 usage() {
|
Chris@700
|
6 echo
|
Chris@700
|
7 echo "Usage:"
|
Chris@700
|
8 echo
|
Chris@700
|
9 echo "$0 <version> <architecture>"
|
Chris@700
|
10 echo
|
Chris@700
|
11 echo "For example: $0 1.4cc1-1 amd64"
|
Chris@700
|
12 echo
|
Chris@700
|
13 exit 2
|
Chris@700
|
14 }
|
Chris@700
|
15
|
Chris@700
|
16 version="$1"
|
Chris@700
|
17 arch="$2"
|
Chris@700
|
18
|
Chris@700
|
19 if [ -z "$version" ] || [ -z "$arch" ]; then
|
Chris@700
|
20 usage
|
Chris@700
|
21 fi
|
Chris@700
|
22
|
Chris@700
|
23 set -eu
|
Chris@700
|
24
|
Chris@700
|
25 program=EasyMercurial
|
Chris@700
|
26 depdir=deploy/linux
|
Chris@700
|
27
|
Chris@700
|
28 targetdir="${program}_${version}_${arch}"
|
Chris@700
|
29
|
Chris@700
|
30 echo "Target dir is $targetdir"
|
Chris@700
|
31
|
Chris@700
|
32 if [ -d "$targetdir" ]; then
|
Chris@700
|
33 echo "Target directory exists, not overwriting"
|
Chris@700
|
34 exit
|
Chris@700
|
35 fi
|
Chris@700
|
36
|
Chris@700
|
37 mkdir "$targetdir"
|
Chris@700
|
38
|
Chris@700
|
39 mkdir "$targetdir/DEBIAN"
|
Chris@700
|
40
|
Chris@700
|
41 cp "$depdir"/control "$targetdir"/DEBIAN/
|
Chris@700
|
42
|
Chris@700
|
43 mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps "$targetdir"/usr/share/applications "$targetdir"/usr/share/doc/"$program"
|
Chris@700
|
44
|
Chris@700
|
45 cp "$program" "$targetdir"/usr/bin/
|
Chris@700
|
46
|
Chris@700
|
47 cp images/icon/scalable/easyhg-icon.svg "$targetdir"/usr/share/pixmaps/
|
Chris@700
|
48 cp images/icon/128/easyhg-icon.png "$targetdir"/usr/share/pixmaps/
|
Chris@700
|
49 cp deploy/linux/"$program".desktop "$targetdir"/usr/share/applications/
|
Chris@700
|
50 cp README.txt "$targetdir"/usr/share/doc/"$program"/
|
Chris@709
|
51 cp COPYING "$targetdir"/usr/share/doc/"$program"/copyright
|
Chris@709
|
52 touch "$targetdir"/usr/share/doc/"$program"/changelog.Debian
|
Chris@709
|
53 gzip "$targetdir"/usr/share/doc/"$program"/changelog.Debian
|
Chris@700
|
54
|
Chris@700
|
55 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
|
Chris@700
|
56
|
Chris@700
|
57 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
|
Chris@700
|
58
|
Chris@700
|
59 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
|
Chris@700
|
60
|
Chris@700
|
61 control_ver=${version%-?}
|
Chris@700
|
62
|
Chris@700
|
63 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
|
Chris@700
|
64
|
Chris@700
|
65 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
|
Chris@700
|
66
|
Chris@700
|
67 dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
|
Chris@700
|
68
|