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@725: kdiff=easyhg-kdiff3 Chris@725: merge=easyhg-merge.sh Chris@725: extdiff=easyhg-extdiff.sh Chris@725: Chris@725: programs="$program $kdiff $merge $extdiff" Chris@725: Chris@711: package=easymercurial Chris@700: depdir=deploy/linux Chris@700: Chris@711: targetdir="${package}_${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@725: for p in $programs; do Chris@725: if [ ! -x "$p" ]; then Chris@725: echo "Failed to find executable ./$p, please build and check" Chris@725: exit 2 Chris@725: fi Chris@725: done Chris@725: Chris@700: mkdir "$targetdir" Chris@700: Chris@700: mkdir "$targetdir/DEBIAN" Chris@700: Chris@700: cp "$depdir"/control "$targetdir"/DEBIAN/ Chris@700: Chris@711: mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps "$targetdir"/usr/share/applications "$targetdir"/usr/share/doc/"$package" Chris@700: Chris@725: cp $programs "$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@711: cp deploy/linux/"$program".desktop "$targetdir"/usr/share/applications/"$package".desktop Chris@711: cp README.txt "$targetdir"/usr/share/doc/"$package"/ Chris@711: cat > "$targetdir"/usr/share/doc/"$package"/copyright <&2 Chris@713: cat "$targetdir"/DEBIAN/control 1>&2 Chris@713: echo 1>&2 Chris@713: Chris@700: dpkg-deb --build "$targetdir" && lintian "$targetdir".deb Chris@700: