Chris@252: #!/bin/bash Chris@252: # Chris@252: # Run this from the build root Chris@252: Chris@252: usage() { Chris@252: echo Chris@252: echo "Usage:" Chris@252: echo Chris@252: echo "$0 " Chris@252: echo Chris@252: echo "For example: $0 2.4cc1-1 amd64" Chris@252: echo Chris@252: exit 2 Chris@252: } Chris@252: Chris@252: version="$1" Chris@252: arch="$2" Chris@252: Chris@252: if [ -z "$version" ] || [ -z "$arch" ]; then Chris@252: usage Chris@252: fi Chris@252: Chris@252: program=sonic-annotator Chris@252: depdir=deploy/linux Chris@252: Chris@252: targetdir="${program}_${version}_${arch}" Chris@252: Chris@252: echo "Target dir is $targetdir" Chris@252: Chris@252: if [ -d "$targetdir" ]; then Chris@252: echo "Target directory exists, not overwriting" Chris@252: exit Chris@252: fi Chris@252: Chris@252: mkdir "$targetdir" Chris@252: Chris@252: cp -r "$depdir"/deb-skeleton/* "$targetdir"/ Chris@252: Chris@252: mkdir -p "$targetdir"/usr/bin Chris@252: Chris@252: cp "$program" "$targetdir"/usr/bin/ Chris@252: Chris@252: cp README "$targetdir"/usr/share/doc/"$program"/ Chris@252: Chris@252: perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control Chris@252: Chris@252: deps=`bash "$depdir"/debian-dependencies.sh "$program"` Chris@252: Chris@252: perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control Chris@252: Chris@252: control_ver=${version%-?} Chris@252: Chris@252: perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control Chris@252: Chris@252: bash "$depdir"/fix-lintian-bits.sh "$targetdir" Chris@252: Chris@252: sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb Chris@252: