upgpkg: ocaml-integers 0.5.0-1
[arch-packages.git] / lpeg / trunk / PKGBUILD
blob4b85714f59fa7c4fe73475d4988392716f2728e9
1 # Maintainer: Christian Hesse <mail@eworm.de>
2 # Contributor: Gustavo Alvarez <sl1pkn07@gmail.com>
4 pkgbase=lpeg
5 pkgname=(lua-lpeg lua51-lpeg lua52-lpeg lua53-lpeg)
6 pkgver=1.0.2
7 pkgrel=3
8 arch=('x86_64')
9 url='http://www.inf.puc-rio.br/~roberto/lpeg'
10 license=('MIT')
11 makedepends=('lua' 'lua51' 'lua52' 'lua53')
12 source=("http://www.inf.puc-rio.br/~roberto/$pkgbase/$pkgbase-$pkgver.tar.gz"
13         'LICENSE')
14 sha256sums=('48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe'
15             '6be7688c9c648e7c7cde693081be938c869a10aa4de09fe0a4c4c1d66b3cf03d')
17 prepare() {
18   sed 's/^CFLAGS =/CFLAGS +=/' -i $pkgbase-$pkgver/makefile
19   sed 's/^COPT =/# COPT =/' -i $pkgbase-$pkgver/makefile
21   cp -r $pkgbase-$pkgver $pkgbase-$pkgver-51
22   cp -r $pkgbase-$pkgver $pkgbase-$pkgver-52
23   cp -r $pkgbase-$pkgver $pkgbase-$pkgver-53
26 build() {
27   cd $pkgbase-$pkgver
28   make LUADIR=/usr/include
30   cd "$srcdir"/$pkgbase-$pkgver-51
31   make LUADIR=/usr/include/lua5.1
33   cd "$srcdir"/$pkgbase-$pkgver-52
34   make LUADIR=/usr/include/lua5.2
35   
36   cd "$srcdir"/$pkgbase-$pkgver-53
37   make LUADIR=/usr/include/lua5.3
40 check() {
41   msg2 "Testing with Lua 5.4"
42   cd $srcdir/$pkgbase-$pkgver
43   lua test.lua
45   msg2 "Testing with Lua 5.1"
46   cd $srcdir/$pkgbase-$pkgver-51
47   lua5.1 test.lua
49   msg2 "Testing with Lua 5.2"
50   cd $srcdir/$pkgbase-$pkgver-52
51   lua5.2 test.lua
52   
53   msg2 "Testing with Lua 5.3"
54   cd $srcdir/$pkgbase-$pkgver-53
55   lua5.3 test.lua
58 package_lua-lpeg() {
59   pkgdesc='Pattern-matching library for Lua 5.4'
60   depends=('lua')
62   cd $pkgbase-$pkgver
63   install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.4/$pkgbase.so
64   install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.4/re.lua
65   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
68 package_lua51-lpeg() {
69   pkgdesc='Pattern-matching library for Lua 5.1'
70   depends=('lua51')
72   cd $pkgbase-$pkgver-51
73   install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.1/$pkgbase.so
74   install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.1/re.lua
75   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
78 package_lua52-lpeg() {
79   pkgdesc='Pattern-matching library for Lua 5.2'
80   depends=('lua52')
82   cd $pkgbase-$pkgver-52
83   install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.2/$pkgbase.so
84   install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.2/re.lua
85   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
88 package_lua53-lpeg() {
89   pkgdesc='Pattern-matching library for Lua 5.3'
90   depends=('lua53')
92   cd $pkgbase-$pkgver-53
93   install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.3/$pkgbase.so
94   install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.3/re.lua
95   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE