annotate deploy/linux/deploy-deb.sh @ 1279:c6513cae4747 project-file-rework

Cut down vastly on the number of config.pri files and places where their contents has to be effectively duplicated without them
author Chris Cannam
date Mon, 24 Oct 2016 17:53:33 +0100
parents 8b63b44c3a91
children 9b59deb4a854
rev   line source
Chris@862 1 #!/bin/bash
Chris@862 2 #
Chris@862 3 # Run this from the build root
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@862 23 program=sonic-visualiser
Chris@862 24 depdir=deploy/linux
Chris@862 25
Chris@862 26 targetdir="${program}_${version}_${arch}"
Chris@862 27
Chris@862 28 echo "Target dir is $targetdir"
Chris@862 29
Chris@862 30 if [ -d "$targetdir" ]; then
Chris@862 31 echo "Target directory exists, not overwriting"
Chris@862 32 exit
Chris@862 33 fi
Chris@862 34
Chris@862 35 mkdir "$targetdir"
Chris@862 36
Chris@862 37 cp -r "$depdir"/deb-skeleton/* "$targetdir"/
Chris@862 38
Chris@862 39 mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps
Chris@862 40
Chris@862 41 cp "$program" "$targetdir"/usr/bin/
Chris@862 42
Chris@862 43 cp icons/sv-icon*.svg "$targetdir"/usr/share/pixmaps/
Chris@862 44 cp "$program".desktop "$targetdir"/usr/share/applications/
Chris@862 45 cp README "$targetdir"/usr/share/doc/"$program"/
Chris@862 46
Chris@862 47 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
Chris@862 48
Chris@864 49 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
Chris@864 50
Chris@864 51 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
Chris@864 52
Chris@1080 53 control_ver=${version%-?}
Chris@1080 54
Chris@1080 55 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
Chris@1080 56
Chris@862 57 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
Chris@862 58
Chris@862 59 sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
Chris@862 60