# Maintainer: Jim Fowler pkgname=pdiff-git _pkgname=pdiff pkgver=1 pkgrel=1 pkgdesc="Find differences between PDF documents" arch=('x86_64' 'i686') url="https://github.com/kisonecat/pdiff/" license=('MIT') makedepends=('go' 'git') options=('!strip' '!emptydirs') _gourl=github.com/kisonecat/pdiff source=("git+https://github.com/kisonecat/pdiff.git") md5sums=('SKIP') pkgver() { cd "$_pkgname" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { export GOROOT=/usr/lib/go rm -rf build mkdir -p build/go cd build/go for f in "$GOROOT/"*; do ln -s "$f" done rm pkg mkdir pkg cd pkg for f in "$GOROOT/pkg/"*; do ln -s "$f" done platform=`for f in "$GOROOT/pkg/"*; do echo \`basename $f\`; done|grep linux` rm -f "$platform" mkdir "$platform" cd "$platform" for f in "$GOROOT/pkg/$platform/"*.h; do ln -s "$f" done export GOROOT="$srcdir/build/go" export GOPATH="$srcdir/build" go get -fix "$_gourl" # Prepare executable if [ -d "$srcdir/build/src" ]; then cd "$srcdir/build/src/$_gourl" go build -o "$srcdir/build/$pkgname" else echo 'Old sources for a previous version of this package are already present!' echo 'Build in a chroot or uninstall the previous version.' return 1 fi } package() { export GOROOT="$GOPATH" # Package license (if available) for f in LICENSE COPYING; do if [ -e "$srcdir/build/src/$_gourl/$f" ]; then install -Dm644 "$srcdir/build/src/$_gourl/$f" \ "$pkgdir/usr/share/licenses/$pkgname/$f" fi done # Package executables if [ -e "$srcdir/build/$pkgname" ]; then install -Dm755 "$srcdir/build/$pkgname" \ "$pkgdir/usr/bin/$_pkgname" fi }