Chris@700: #!/bin/bash Chris@700: # Chris@700: # Run this from the build root (with sudo, I think) Chris@700: Chris@700: usage() { Chris@700: echo Chris@700: echo "Usage:" Chris@700: echo Chris@700: echo "$0 " Chris@700: echo Chris@700: echo "For example: $0 1.4cc1-1 amd64" Chris@700: echo Chris@700: exit 2 Chris@700: } Chris@700: Chris@700: version="$1" Chris@700: arch="$2" Chris@700: Chris@700: if [ -z "$version" ] || [ -z "$arch" ]; then Chris@700: usage Chris@700: fi Chris@700: Chris@700: set -eu Chris@700: Chris@700: program=EasyMercurial Chris@700: depdir=deploy/linux Chris@700: Chris@700: targetdir="${program}_${version}_${arch}" Chris@700: Chris@700: echo "Target dir is $targetdir" Chris@700: Chris@700: if [ -d "$targetdir" ]; then Chris@700: echo "Target directory exists, not overwriting" Chris@700: exit Chris@700: fi Chris@700: Chris@700: mkdir "$targetdir" Chris@700: Chris@700: mkdir "$targetdir/DEBIAN" Chris@700: Chris@700: cp "$depdir"/control "$targetdir"/DEBIAN/ Chris@700: Chris@700: mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps "$targetdir"/usr/share/applications "$targetdir"/usr/share/doc/"$program" Chris@700: Chris@700: cp "$program" "$targetdir"/usr/bin/ Chris@700: Chris@700: cp images/icon/scalable/easyhg-icon.svg "$targetdir"/usr/share/pixmaps/ Chris@700: cp images/icon/128/easyhg-icon.png "$targetdir"/usr/share/pixmaps/ Chris@700: cp deploy/linux/"$program".desktop "$targetdir"/usr/share/applications/ Chris@700: cp README.txt "$targetdir"/usr/share/doc/"$program"/ Chris@700: Chris@700: perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control Chris@700: Chris@700: deps=`bash "$depdir"/debian-dependencies.sh "$program"` Chris@700: Chris@700: perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control Chris@700: Chris@700: control_ver=${version%-?} Chris@700: Chris@700: perl -i -p -e "s/Version: .*/Version: $control_ver/" "$targetdir"/DEBIAN/control Chris@700: Chris@700: bash "$depdir"/fix-lintian-bits.sh "$targetdir" Chris@700: Chris@700: dpkg-deb --build "$targetdir" && lintian "$targetdir".deb Chris@700: