annotate deploy/linux/deploy-deb.sh @ 2377:995a4014a5c8

Further Mac deployment updates
author Chris Cannam
date Wed, 16 Oct 2019 15:29:37 +0100
parents e0093740b194
children
rev   line source
Chris@862 1 #!/bin/bash
Chris@862 2 #
Chris@1532 3 # Run this from the build root (with sudo, I think)
Chris@862 4
Chris@862 5 usage() {
Chris@862 6 echo
Chris@862 7 echo "Usage:"
Chris@862 8 echo
Chris@862 9 echo "$0 <version> <architecture>"
Chris@862 10 echo
Chris@862 11 echo "For example: $0 2.4cc1-1 amd64"
Chris@862 12 echo
Chris@862 13 exit 2
Chris@862 14 }
Chris@862 15
Chris@862 16 version="$1"
Chris@862 17 arch="$2"
Chris@862 18
Chris@862 19 if [ -z "$version" ] || [ -z "$arch" ]; then
Chris@862 20 usage
Chris@862 21 fi
Chris@862 22
Chris@1532 23 set -eu
Chris@1532 24
Chris@862 25 program=sonic-visualiser
Chris@1532 26 checker=vamp-plugin-load-checker
Chris@1532 27 piper=piper-vamp-simple-server
Chris@862 28 depdir=deploy/linux
Chris@862 29
Chris@862 30 targetdir="${program}_${version}_${arch}"
Chris@862 31
Chris@862 32 echo "Target dir is $targetdir"
Chris@862 33
Chris@862 34 if [ -d "$targetdir" ]; then
Chris@862 35 echo "Target directory exists, not overwriting"
Chris@862 36 exit
Chris@862 37 fi
Chris@862 38
Chris@862 39 mkdir "$targetdir"
Chris@862 40
Chris@862 41 cp -r "$depdir"/deb-skeleton/* "$targetdir"/
Chris@862 42
Chris@862 43 mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps
Chris@862 44
Chris@1532 45 cp "$program" "$checker" "$piper" "$targetdir"/usr/bin/
Chris@862 46
Chris@862 47 cp icons/sv-icon*.svg "$targetdir"/usr/share/pixmaps/
Chris@2148 48 cp icons/sv-128x128.png "$targetdir"/usr/share/pixmaps/sv-icon.png
Chris@862 49 cp "$program".desktop "$targetdir"/usr/share/applications/
Chris@2118 50 cp README.md "$targetdir"/usr/share/doc/"$program"/
Chris@862 51
Chris@862 52 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
Chris@862 53
Chris@864 54 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
Chris@864 55
Chris@864 56 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
Chris@864 57
Chris@1080 58 control_ver=${version%-?}
Chris@1080 59
Chris@1080 60 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
Chris@1080 61
Chris@862 62 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
Chris@862 63
Chris@1532 64 dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
Chris@862 65