Mercurial > hg > tony
comparison deploy/linux/deploy-deb.sh @ 625:72f85d34a922
Merge
author | Chris Cannam |
---|---|
date | Thu, 10 Oct 2019 13:39:08 +0100 |
parents | cccac82528b9 |
children |
comparison
equal
deleted
inserted
replaced
624:bd18e52aa382 | 625:72f85d34a922 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Run this from the build root | 3 # Run this from the build root (with sudo, I think) |
4 | |
5 set -e | |
6 | 4 |
7 usage() { | 5 usage() { |
8 echo | 6 echo |
9 echo "Usage:" | 7 echo "Usage:" |
10 echo | 8 echo |
11 echo "$0 <version> <architecture>" | 9 echo "$0 <version> <architecture>" |
12 echo | 10 echo |
13 echo "For example: $0 1.0cc1-1 amd64" | 11 echo "For example: $0 2.4cc1-1 amd64" |
14 echo | 12 echo |
15 exit 2 | 13 exit 2 |
16 } | 14 } |
17 | 15 |
18 version="$1" | 16 version="$1" |
20 | 18 |
21 if [ -z "$version" ] || [ -z "$arch" ]; then | 19 if [ -z "$version" ] || [ -z "$arch" ]; then |
22 usage | 20 usage |
23 fi | 21 fi |
24 | 22 |
25 set -u | 23 set -eu |
26 | 24 |
27 program=tony | 25 program=tony |
28 plugins="chp pyin" | 26 plugins="chp pyin" |
29 | 27 |
30 depdir=deploy/linux | 28 depdir=deploy/linux |
40 | 38 |
41 mkdir "$targetdir" | 39 mkdir "$targetdir" |
42 | 40 |
43 cp -r "$depdir"/deb-skeleton/* "$targetdir"/ | 41 cp -r "$depdir"/deb-skeleton/* "$targetdir"/ |
44 | 42 |
45 mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps | 43 mkdir -p "$targetdir"/usr/bin |
44 mkdir -p "$targetdir"/usr/lib/"$program" | |
45 mkdir -p "$targetdir"/usr/share/pixmaps | |
46 | 46 |
47 cp "$program" "$targetdir"/usr/bin/ | 47 cp "$program" "$targetdir"/usr/bin/ |
48 | 48 |
49 for plug in $plugins; do | 49 for p in $plugins ; do |
50 cp "$plug/$plug.so" "$targetdir"/usr/lib/"$program"/ | 50 cp "$p.so" "$targetdir"/usr/lib/"$program"/ |
51 done | 51 done |
52 | 52 |
53 cp icons/"$program"-128x128.png "$targetdir"/usr/share/pixmaps/ | 53 cp icons/"$program"-icon.svg "$targetdir"/usr/share/pixmaps/ |
54 cp icons/"$program"-128x128.png "$targetdir"/usr/share/pixmaps/"$program"-icon.png | |
54 cp "$program".desktop "$targetdir"/usr/share/applications/ | 55 cp "$program".desktop "$targetdir"/usr/share/applications/ |
55 cp README "$targetdir"/usr/share/doc/"$program"/ | 56 cp README.md "$targetdir"/usr/share/doc/"$program"/ |
56 | 57 |
57 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control | 58 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control |
58 | 59 |
59 deps=`bash "$depdir"/debian-dependencies.sh "$program"` | 60 deps=`bash "$depdir"/debian-dependencies.sh "$program"` |
60 | 61 |
61 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control | 62 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control |
62 | 63 |
64 control_ver=${version%-?} | |
65 | |
66 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control | |
67 | |
63 bash "$depdir"/fix-lintian-bits.sh "$targetdir" | 68 bash "$depdir"/fix-lintian-bits.sh "$targetdir" |
64 | 69 |
65 sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb | 70 dpkg-deb --build "$targetdir" && lintian "$targetdir".deb |
66 | 71 |