annotate deploy/linux/deploy-deb.sh @ 1949:037493178de5

Copy icon file to sonic-visualiser.svg
author Chris Cannam
date Thu, 09 Aug 2018 10:49:14 +0100
parents 9b59deb4a854
children c377ab5c1447
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@862 48 cp "$program".desktop "$targetdir"/usr/share/applications/
Chris@862 49 cp README "$targetdir"/usr/share/doc/"$program"/
Chris@862 50
Chris@862 51 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
Chris@862 52
Chris@864 53 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
Chris@864 54
Chris@864 55 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
Chris@864 56
Chris@1080 57 control_ver=${version%-?}
Chris@1080 58
Chris@1080 59 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
Chris@1080 60
Chris@862 61 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
Chris@862 62
Chris@1532 63 dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
Chris@862 64