updated on Wed Jan 11 00:07:16 UTC 2012
[aur-mirror.git] / plan9us-hg / PKGBUILD
blob579a84beae283c126e8559aa250c59d7407c3c36
1 # $Id:$
2 # Contributor: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
4 pkgname=plan9us-hg
5 pkgver=3169
6 pkgrel=2
7 pkgdesc="Plan 9 from User Space, aka plan9port, apps and services from Plan 9 on Unix-like systems"
8 arch=('i686' 'x86_64')
9 url='http://swtch.com/plan9port/'
10 license=('custom')
11 depends=('x-server')
12 conflicts=('plan9port-hg' 'plan9port-cvs' 'plan9port')
13 replaces=('plan9port-hg' 'plan9port-cvs' 'plan9port')
14 provides=('plan9us' 'plan9port')
15 makedepends=('mercurial' 'rsync')
16 options=('emptydirs' '!strip')
18 _hgroot=http://bitbucket.org/rsc
19 _hgrepo=plan9port
21 source=('LICENSE.patch' 'bclock.c' 'clock.c' 'etc_profile.d_plan9.csh' 'etc_profile.d_plan9.sh')
23 build() {
24     cd "$srcdir"
25     msg "Connecting to HG server..."
26     if [ -d ${_hgrepo}/.hg ] ; then
27         cd ${_hgrepo} && hg pull -u
28         msg2 "The local files are updated"
29     else
30         hg clone ${_hgroot}/${_hgrepo}/ ${_hgrepo}
31     fi
32     msg "HG checkout done or server timeout"
34     msg "Preparing builddir..."
35     rsync -a --delete --exclude '.cvs*' --exclude '.hg*' $srcdir/${_hgrepo}/ $srcdir/${_hgrepo}-build
36     cp $startdir/bclock.c $srcdir/${_hgrepo}-build/src/cmd
37     cp $startdir/clock.c $srcdir/${_hgrepo}-build/src/cmd
38     cd $srcdir/${_hgrepo}-build
39     msg "Starting ./INSTALL..."
40     ./INSTALL -b
42     msg "Making it nice..."
43     install -Dm755 $srcdir/etc_profile.d_plan9.csh $pkgdir/etc/profile.d/plan9.csh
44     install -Dm755 $srcdir/etc_profile.d_plan9.sh $pkgdir/etc/profile.d/plan9.sh
45     mkdir -p $pkgdir/usr/local
46     cp -r $srcdir/${_hgrepo}-build $pkgdir/usr/local/plan9
47     mkdir -p $pkgdir/usr/local/plan9/bin/aux
48     ln -fs ../getflags $pkgdir/usr/local/plan9/bin/aux/getflags
49     ln -fs ../usage $pkgdir/usr/local/plan9/bin/aux/usage
50     rm -rf $pkgdir/usr/local/plan9/dist
51     rm -rf $pkgdir/usr/local/plan9/lib/CVS*
52     chmod 644 $pkgdir/usr/local/plan9/lib/*
53     chmod 644 $pkgdir/usr/local/plan9/man/man{1,3,4,5,6,7,8,9}/*
54     rm -f $pkgdir/usr/local/plan9/man/{mkfile,mkindex,secindex}
55     rm -f $pkgdir/usr/local/plan9/unix/man/{ex.man,fixurls,mkfile}
56     chmod 1777 $pkgdir/usr/local/plan9/mail/queue
57     rm -rf $pkgdir/usr/local/plan9/unix/make
58     rm -f $pkgdir/usr/local/plan9/unix/*.h $pkgdir/usr/local/plan9/unix/mkfile*
59     rm -f $pkgdir/usr/local/plan9/{INSTALL,Makefile,README}
60     rm -f $pkgdir/usr/local/plan9/config* $pkgdir/usr/local/plan9/install.*
61     find $pkgdir/usr/local/plan9 -name '.placeholder' -exec rm {} ';'
62     mkdir -p $pkgdir/usr/share/doc/${pkgname}
63     mv $pkgdir/usr/local/plan9/{CHANGES,CONTRIBUTORS,TODO} $pkgdir/usr/share/doc/${pkgname}
64     mkdir -p $pkgdir/usr/share/licenses/${pkgname}
65     patch -d $pkgdir/usr/local/plan9 -p3 < $startdir/LICENSE.patch
66     ln -fs /usr/local/plan9/LICENSE $pkgdir/usr/share/licenses/${pkgname}/LICENSE.txt
69 # vim:set ts=4 sw=4 et:
70 md5sums=('5814c6953499b39262c8218bd42c5710'
71          '39a19803b65b9fcae4ed1ef5e65837f4'
72          '0822020fead0bc7134db59433e9ab7ca'
73          '232722253aefe1ce40ba7bae77a16847'
74          '2e0d299d3fedf41adf06ff225d18f3e9')