summaryrefslogtreecommitdiff
path: root/community/luabitop/PKGBUILD
blob: 7dacdad3ec4c51d84a4933f4b9861e8ccf42fac2 (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
# $Id: PKGBUILD 81388 2012-12-19 13:22:34Z seblu $
# Maintainer: Sébastien Luttringer <seblu@aur.archlinux.org>
# Contributor: Lucas Hermann Negri <kkndrox@gmail.com>

pkgbase=luabitop
pkgname=(lua-bitop lua51-bitop)
pkgver=1.0.2
pkgrel=2
pkgdesc='C extension adding bitwise operations on numbers'
arch=(i686 x86_64)
url='http://bitop.luajit.org/index.html'
makedepends=('lua' 'lua51')
source=("http://bitop.luajit.org/download/LuaBitOp-$pkgver.tar.gz")
md5sums=('d0c1080fe0c844e8477279668e2d0d06')
license=('MIT')

build() {
  cp -a LuaBitOp-$pkgver LuaBitOp51-$pkgver
  msg2 'Building with lua 5.2'
  cd LuaBitOp-$pkgver
  make INCLUDES=' -I/usr/include' LUA='lua'
  msg2 'Building with lua 5.1'
  cd ../LuaBitOp51-$pkgver
  make INCLUDES=' -I/usr/include/lua5.1' LUA='lua5.1'
}

package_lua-bitop() {
  depends=('lua')
  cd LuaBitOp-$pkgver
  install -Dm 644 bit.so "$pkgdir/usr/lib/lua/5.2/bit.so"
  install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"
  ln -s '../lua/COPYRIGHT' "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
}

package_lua51-bitop() {
  depends=('lua51')
  conflicts=('luabitop')
  replaces=('luabitop')
  cd LuaBitOp51-$pkgver
  install -Dm 644 bit.so "$pkgdir/usr/lib/lua/5.1/bit.so"
  install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"
  ln -s '../lua51/COPYRIGHT' "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT"
}

# vim:set ts=2 sw=2 et: