annotate deploy/linux/deploy-deb.sh @ 252:120723f7698b

Bring in proto Linux deploy stuff from SV repo
author Chris Cannam
date Tue, 22 Mar 2016 12:07:54 +0000
parents
children 7dd6795af5e6
rev   line source
Chris@252 1 #!/bin/bash
Chris@252 2 #
Chris@252 3 # Run this from the build root
Chris@252 4
Chris@252 5 usage() {
Chris@252 6 echo
Chris@252 7 echo "Usage:"
Chris@252 8 echo
Chris@252 9 echo "$0 <version> <architecture>"
Chris@252 10 echo
Chris@252 11 echo "For example: $0 2.4cc1-1 amd64"
Chris@252 12 echo
Chris@252 13 exit 2
Chris@252 14 }
Chris@252 15
Chris@252 16 version="$1"
Chris@252 17 arch="$2"
Chris@252 18
Chris@252 19 if [ -z "$version" ] || [ -z "$arch" ]; then
Chris@252 20 usage
Chris@252 21 fi
Chris@252 22
Chris@252 23 program=sonic-annotator
Chris@252 24 depdir=deploy/linux
Chris@252 25
Chris@252 26 targetdir="${program}_${version}_${arch}"
Chris@252 27
Chris@252 28 echo "Target dir is $targetdir"
Chris@252 29
Chris@252 30 if [ -d "$targetdir" ]; then
Chris@252 31 echo "Target directory exists, not overwriting"
Chris@252 32 exit
Chris@252 33 fi
Chris@252 34
Chris@252 35 mkdir "$targetdir"
Chris@252 36
Chris@252 37 cp -r "$depdir"/deb-skeleton/* "$targetdir"/
Chris@252 38
Chris@252 39 mkdir -p "$targetdir"/usr/bin
Chris@252 40
Chris@252 41 cp "$program" "$targetdir"/usr/bin/
Chris@252 42
Chris@252 43 cp README "$targetdir"/usr/share/doc/"$program"/
Chris@252 44
Chris@252 45 perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
Chris@252 46
Chris@252 47 deps=`bash "$depdir"/debian-dependencies.sh "$program"`
Chris@252 48
Chris@252 49 perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
Chris@252 50
Chris@252 51 control_ver=${version%-?}
Chris@252 52
Chris@252 53 perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control
Chris@252 54
Chris@252 55 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
Chris@252 56
Chris@252 57 sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
Chris@252 58