updated on Mon Jan 16 16:00:41 UTC 2012
[aur-mirror.git] / 9base-hg / PKGBUILD
blob207d4a0dcb31c524c185b0080a385033f97e5220
1 # Contributor: joyfulgirl <joyfulgirl (at) archlinux (dot) us>
3 pkgname=9base-hg
4 pkgver=76
5 pkgrel=1
6 pkgdesc="Port of various original Plan9 tools to unix"
7 url="http://suckless.org"
8 conflicts=('plan9port' '9rc-devel' '9base')
9 provides=('plan9')
10 arch=('i686' 'x86_64')
11 license=('custom')
12 changelog=ChangeLog
13 source=('9' 'plan9.sh')
14 md5sums=('ae7108b9f26bed388e9055f35eef2986'
15          '62a9e52043d9c32967fcae9018fffb56')
17 _hgroot="http://hg.suckless.org/"
18 _hgrepo="9base"
20 build()
22     msg "Connecting to $_hgroot"
23     if [ -d $_hgrepo ]; then
24         cd $_hgrepo
25         hg pull -u || return 1
26         msg2 "Finished updating the local repository!"
27     else
28         hg clone ${_hgroot}/${_hgrepo} "${srcdir}/${_hgrepo}" || return 1
29         msg2 "Initial pull complete!"
30     fi
32     if [ -d "${srcdir}/${_hgrepo}-build" ]; then
33         cd "${srcdir}/${_hgrepo}-build"
34         make clean || return 1
35         hg pull -u "${srcdir}/${_hgrepo}" || return 1
36     else
37         hg clone "${srcdir}/${_hgrepo}" "${srcdir}/${_hgrepo}-build" || return 1
38         cd "${srcdir}/${_hgrepo}-build"
39     fi
41     case $CARCH in
42         i686) sed -i 's#^OBJTYPE\s.*$#OBJTYPE = 386#' config.mk ;;
43         x86_64) sed -i 's#^OBJTYPE\s.*$#OBJTYPE = x86_64#' config.mk ;;
44         esac
46     sed -i 's#^PREFIX\s.*$#PREFIX = /opt/plan9#' config.mk
48     make || return 1
51 package() {
52     cd "${srcdir}/${_hgrepo}-build"
53     make DESTDIR="$pkgdir" install || return 1
54     install -m755 "${srcdir}/9" "${pkgdir}/opt/plan9/bin/" || return 1
55     install -d -m755 "$pkgdir/etc/profile.d/" || return 1
56     install -m755 "${srcdir}/plan9.sh" "$pkgdir/etc/profile.d/" || return 1
57     install -D -m644 LICENSE "$pkgdir/usr/share/licenses/9base/LICENSE" || return 1
60 # End of file