updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / moonscript / PKGBUILD
blob4bbee5398096eeed1800e3e3abb6918c5f3ec661
1 # Maintainer: Alexander Rødseth <rodseth@gmail.com>
2 pkgname=moonscript
3 pkgver=0.2.0
4 pkgrel=4
5 pkgdesc="Dynamic scripting language that compiles into Lua"
6 arch=('any')
7 url="http://moonscript.org/"
8 license=('MIT')
9 depends=('luarocks' 'lpeg' 'lua' 'luafilesystem')
10 makedepends=('git' 'curl')
11 source=("http://moonscript.org/rocks/moonscript-dev-1.rockspec")
12 md5sums=('491a59714d88a4c369535e4cbc9123b2')
14 build() {
15   cd "$srcdir"
17   msg2 "Fetching documentation..."
18   # These changes a lot, so md5-sum-ing them is like fighting windmills
19   curl --progress-bar -OL \
20     "https://raw.github.com/leafo/moonscript/master/README.md"
21   curl --progress-bar -OL \
22     "https://raw.github.com/leafo/moonscript/master/docs/reference_manual.html"
23   curl --progress-bar -OL \
24     "http://moonscript.org/reference/index.html"
27 package() {
28   cd "$srcdir"
30   msg2 "Packaging moonscript..."
31   mkdir "$pkgdir/usr"
32   luarocks install moonscript-dev-1.rockspec --to="$pkgdir/usr"
33   install -Dm644 reference_manual.html "$pkgdir/usr/share/doc/$pkgname/reference_manual.html"
34   install -Dm644 index.html "$pkgdir/usr/share/doc/$pkgname/index.html"
35   install -Dm644 README.md "$pkgdir/usr/share/licenses/$pkgname/README.md"
37   msg2 "Patching..."
38   sed -i "s:$pkgdir::" "$pkgdir/usr/bin/moon"
39   sed -i "s:$pkgdir::" "$pkgdir/usr/bin/moonc"
41   msg2 "Cleaning up..."
42   rm "$pkgdir/usr/lib/lua/5.1/lfs.so"
43   rm "$pkgdir/usr/lib/lua/5.1/lpeg.so"
44   rm "$pkgdir/usr/share/lua/5.1/re.lua"
45   chmod 755 "$pkgdir/usr" "$pkgdir/usr/bin/" "$pkgdir/usr/share/lua/5.1/" \
46     "$pkgdir/usr/lib/lua/5.1/" "$pkgdir/usr/lib" "$pkgdir/usr/share" \
47     "$pkgdir/usr/share/lua" "$pkgdir/usr/lib/lua"
50 # vim:set ts=2 sw=2 et: