updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / nodejs-git / PKGBUILD
blob0c7ddd4e6a576f71eedf826970cbdb3c67548154
1 # Maintainer: Alper Kanat <alperkanat@raptiye.org>
2 # Contributor: Dongsheng Cai <dongsheng@moodle.com>
3 # Contributor: Anish Tondwalkar <2012atondwal@tjhsst.edu>
5 pkgname=nodejs-git
6 pkgver=20110613
7 pkgrel=1
8 pkgdesc="Evented I/O for V8 javascript"
9 arch=("any")
10 url="http://nodejs.org/"
11 license=("custom:nodejs")
12 depends=("python2")
13 makedepends=("gcc" "coreutils")
14 optdepends=("openssl: TLS support")
15 provides=("nodejs")
17 _gitorigin="git://github.com/joyent/node.git"
18 _gitname="nodejs"
20 build() {
21     cd ${srcdir}
23     msg "Connecting to gitosis git server..."
25     if [ -d ${srcdir}/${_gitname} ]; then
26         cd ${_gitname} && git pull origin
27         msg "The local files are updated."
28     else
29         git clone ${_gitorigin} ${_gitname}
30     fi
32     msg "GIT checkout done or server timeout!"
34     cd ${srcdir}/${_gitname}
36     msg "applying python2 fixes.."
38     # python2 fix
39     for file in $(find . -name '*.py' -print) wscript tools/waf-light tools/node-waf; do
40         sed -i 's_^#!.*/usr/bin/python2*_#!/usr/bin/python2_' "$file"
41         sed -i 's_^#!.*/usr/bin/env.*python2*_#!/usr/bin/env python2_' "$file"
42     done
44     sed -i "s|cmd_R = 'python |cmd_R = 'python2 |" wscript
45     sed -i "s|python |python2 |" Makefile
47     msg "Starting make..."
49     ./configure --prefix=/usr
50     make
52     msg "building documentation.."
53     make doc
56 package() {
57     cd ${srcdir}/${_gitname}
59     msg "copying files to destination.."
61     # copying files to destination
62     make DESTDIR="$pkgdir/" install
64     msg "copying license information.."
66     # copying license information
67     install -D -m644 LICENSE $pkgdir/usr/share/licenses/${pkgname}/LICENSE
69     msg "copying docs.."
71     # copying doc related stuff
72     install -D -m644 AUTHORS $pkgdir/usr/share/doc/$pkgname/AUTHORS
73     install -D -m644 README.md $pkgdir/usr/share/doc/$pkgname/README.md
75     msg "copying docs.."
77     # copying all docs
78     cp -r $srcdir/${_gitname}/doc/ $pkgdir/usr/share/doc/$pkgname/
81 # vim:set ts=2 sw=2 et: