# $Id: PKGBUILD 110730 2014-05-05 22:09:47Z arodseth $ # Maintainer: Alexander Rødseth # Contributor: phrakture # Contributor: Fazlul Shahriar # Contributor: Chris Brannon pkgname=plan9port pkgver=20140306 pkgrel=1 pkgdesc='Port of many programs from Plan 9 to Unix-like operating systems' arch=('x86_64' 'i686') url='http://swtch.com/plan9port/' license=('custom') depends=('xorg-server' 'libxt' 'libxext' 'fuse') optdepends=('python2: for the codereview script') provides=('plan9') install='plan9.install' options=('!zipman' 'staticlibs') source=("http://$pkgname.googlecode.com/files/$pkgname-$pkgver.tgz" 'plan9.sh') sha256sums=('cbb826cde693abdaa2051c49e7ebf75119bf2a4791fe3b3229f1ac36a408eaeb' '8768c080a8ceb0a52a3f866bd8ffc4b26f9deb97c6877ceea78ec0b316325a6b') package() { cd "$pkgname" # Try the gentoo way for fixing hardcoded paths PLAN9=/usr/lib/plan9 grep --null -l -r '/usr/local/plan9' | xargs --null sed -i "s!/usr/local/plan9!${PLAN9}!g" d=usr/lib ./INSTALL -b install -Dm755 ../plan9.sh "$pkgdir/etc/profile.d/plan9.sh" install -d "$pkgdir/$d" install -d "$pkgdir/usr/share/doc/$pkgname" cp -r "$srcdir/$pkgname" "$pkgdir/$d/plan9" cd "$pkgdir/$d/plan9" ./INSTALL -c -r "$pkgdir/$d/plan9" install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" # Clean up rm -rf .hg/ rm -f .hgignore .hgtags find . -name '.cvsignore' -print0 |xargs -0 rm -f rm -f config install.log install.sum install.txt configure Makefile INSTALL \ LICENSE # Fix python scripts find "$pkgdir" -name '*.py' -print0 |xargs -0 \ sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/python2,' \ -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,' # Package text files for i in CHANGES CONTRIBUTORS README TODO; do install -m644 $i "$pkgdir/usr/share/doc/$pkgname" rm -f $i done # Decompress the plan9 man pages for i in `find $pkgdir/$d/plan9/man -type f`; do if [ ${i##*.} = "gz" ]; then gunzip "$i" fi done # Once more grep --null -l -r "$pkgdir$PLAN9" | xargs --null sed -i "s!$pkgdir$PLAN9!${PLAN9}!g" || true grep --null -l -r "/build/plan9port/pkg/plan9port/$PLAN9" | xargs --null sed -i "s!/build/plan9port/pkg/plan9port/$PLAN9!${PLAN9}!g" || true } # vim:set ts=2 sw=2 et: