diff deploy/linux/deploy-deb.sh @ 622:cccac82528b9

First cut of Debian package build
author Chris Cannam
date Thu, 10 Oct 2019 13:36:13 +0100
parents 56cf3c9982a1
children
line wrap: on
line diff
--- a/deploy/linux/deploy-deb.sh	Thu Oct 10 13:28:12 2019 +0100
+++ b/deploy/linux/deploy-deb.sh	Thu Oct 10 13:36:13 2019 +0100
@@ -1,8 +1,6 @@
 #!/bin/bash
 # 
-# Run this from the build root
-
-set -e
+# Run this from the build root (with sudo, I think)
 
 usage() {
     echo
@@ -10,7 +8,7 @@
     echo
     echo "$0 <version> <architecture>"
     echo
-    echo "For example: $0 1.0cc1-1 amd64"
+    echo "For example: $0 2.4cc1-1 amd64"
     echo
     exit 2
 }
@@ -22,7 +20,7 @@
     usage
 fi
 
-set -u
+set -eu
 
 program=tony
 plugins="chp pyin"
@@ -42,17 +40,20 @@
 
 cp -r "$depdir"/deb-skeleton/* "$targetdir"/
 
-mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps
+mkdir -p "$targetdir"/usr/bin
+mkdir -p "$targetdir"/usr/lib/"$program"
+mkdir -p "$targetdir"/usr/share/pixmaps
 
 cp "$program" "$targetdir"/usr/bin/
 
-for plug in $plugins; do
-    cp "$plug/$plug.so" "$targetdir"/usr/lib/"$program"/
+for p in $plugins ; do
+    cp "$p.so" "$targetdir"/usr/lib/"$program"/
 done
 
-cp icons/"$program"-128x128.png "$targetdir"/usr/share/pixmaps/
+cp icons/"$program"-icon.svg "$targetdir"/usr/share/pixmaps/
+cp icons/"$program"-128x128.png "$targetdir"/usr/share/pixmaps/"$program"-icon.png
 cp "$program".desktop "$targetdir"/usr/share/applications/
-cp README "$targetdir"/usr/share/doc/"$program"/
+cp README.md "$targetdir"/usr/share/doc/"$program"/
 
 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
 
@@ -60,7 +61,11 @@
 
 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
 
+control_ver=${version%-?}
+
+perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
+
 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
 
-sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
+dpkg-deb --build "$targetdir" && lintian "$targetdir".deb