summaryrefslogtreecommitdiff
path: root/community/plan9port/PKGBUILD
blob: df7d3f3f0e689a3e96bb8761f40ddffe7f10b9dd (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
54
55
56
57
58
59
60
61
62
63
# $Id: PKGBUILD 78790 2012-10-24 21:59:59Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: phrakture <aaronmgriffin--gmail--com>
# Contributor: Fazlul Shahriar
# Contributor: Chris Brannon <cmbrannon79@gmail.com>

pkgname=plan9port
pkgver=20121022
pkgrel=1
pkgdesc='Port of many programs from Plan 9'
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)
sha256sums=('1293b5d2e46d0d6f7be2adbdb285ce278a25c77e88b5cd7c230e16a47d0f8638'
            '0247c4446497359d305aaec069b07180fbf79ce4fa5191464cd9ebb8c7f0228d')

build() {
  cd "$srcdir/plan9"

  ./INSTALL -b
}

package() {
  cd "$srcdir/plan9"

  install -Dm755 ../plan9.sh $pkgdir/etc/profile.d/plan9.sh

  mkdir -p "$pkgdir/opt"
  cp -r $srcdir/plan9 $pkgdir/opt/

  mkdir -p $pkgdir/usr/share/doc/$pkgname
  cd "$pkgdir/opt/plan9"
  ./INSTALL -c -r "$pkgdir/opt/plan9"

  install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE

  # 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

  msg2 "Fixing hardcoded paths..."
  for f in `grep -H -r "$pkgdir/opt/plan9" | cut -d: -f1`; do
    echo -n "\t$f"
    [ -e "$f" ] && sed -i "s:$pkgdir/opt/plan9:/opt/plan9:" "$f" || true
  done

  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,'

  for i in CHANGES CONTRIBUTORS README TODO; do
    install -m644 $i "$pkgdir/usr/share/doc/$pkgname"
    rm -f $i
  done
}