summaryrefslogtreecommitdiff
path: root/community/plan9port/PKGBUILD
blob: 41ff541a61a6aab0fb212e69a337dfebca41d5ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# $Id: PKGBUILD 73814 2012-07-15 22:19:23Z cbrannon $
# Contributor: phrakture <aaronmgriffin--gmail--com>
# Contributor: Fazlul Shahriar
# Contributor: Chris Brannon <cmbrannon79@gmail.com>
pkgname=plan9port
pkgver=20120715
pkgrel=1
pkgdesc="A port of many programs from Plan 9 to Unix-like operating systems"
arch=('i686' 'x86_64')
url="http://swtch.com/plan9port/"
license=('custom')
depends=(xorg-server libxt libxext sh fuse)
optdepends=('python2: for the codereview script')
provides=('plan9')
install=plan9.install
source=(http://swtch.com/$pkgname/$pkgname-$pkgver.tgz plan9.sh)

build()
{
  install -Dm755 "$srcdir/plan9.sh" "$pkgdir/etc/profile.d/plan9.sh" || return 1

  install -dm755 "$pkgdir/opt" "$pkgdir/usr/share/doc/$pkgname" || return 1
  mv "$srcdir/plan9" "$pkgdir/opt"

  cd "$pkgdir/opt/plan9"
  ./INSTALL || return 1
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1

  # Don't need these under /opt/plan9.
  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

  borkedfiles=`grep -r "$pkgdir"/opt/plan9 * | grep -v Binary | cut -d\: -f1`
  for f in $borkedfiles; do
    echo "fixing hardcoded paths in $f"
    sed -i "s@$pkgdir/opt/plan9@/opt/plan9@" $f || return 1
  done

  find "$pkgdir" -name '*.py' -print0 |xargs -0 \
    sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
    -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'

  for i in CHANGES CONTRIBUTORS README TODO
    do
    install -m644 $i "$pkgdir/usr/share/doc/$pkgname" || return 1
    rm -f $i
  done
}
md5sums=('1e0698aa5f652a1a47227be2b25fa8fd'
         '9695eb15a247e23140e8a35ff52a5c20')