summaryrefslogtreecommitdiff
path: root/community/luasec/PKGBUILD
blob: 28dc9560815a74496b8707e97e9cb390f8cf5884 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# $Id: PKGBUILD 105499 2014-02-09 10:04:32Z bpiotrowski $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Dwayne Bent <dbb.1@liqd.org>
# Contributor: Paul-Sebastian Manole <brokenthorn@gmail.com>

pkgbase=luasec
pkgname=(lua-sec lua51-sec)
pkgver=0.5
pkgrel=1
epoch=1
pkgdesc='Lua bindings for OpenSSL library to provide TLS/SSL communication.'
arch=('i686' 'x86_64' 'mips64el')
url='https://github.com/brunoos/luasec/wiki'
license=('MIT')
makedepends=('openssl' 'lua' 'lua-socket' 'lua51' 'lua51-socket')
options=('!buildflags')
source=("https://github.com/brunoos/luasec/archive/luasec-$pkgver.tar.gz")
md5sums=('0518f4524f399f33424c6f450e1d06db')

prepare() {
  cp -a luasec-luasec-$pkgver luasec-luasec-$pkgver-51
}

build() {
  msg2 'Building with lua 5.2'
  cd luasec-luasec-$pkgver
  make linux

  msg2 'Building with lua 5.1'
  cd ../luasec-luasec-$pkgver-51
  find . -type f -name \*.[ch] -exec sed -i \
    -e 's|include .lua.h.|include "lua5.1/lua.h"|g' \
    -e 's|include .lualib.h.|include "lua5.1/lualib.h"|g' \
    -e 's|include .luaconf.h.|include "lua5.1/luaconf.h"|g' \
    -e 's|include .lauxlib.h.|include "lua5.1/lauxlib.h"|g' \
    {} \;
  make linux
}

package_lua-sec() {
  depends=('openssl' 'lua' 'lua-socket')

  install -dm755 "$pkgdir/usr/lib/lua/5.2"
  cd luasec-luasec-$pkgver
  make LUACPATH="$pkgdir/usr/lib/lua/5.2" LUAPATH="$pkgdir/usr/share/lua/5.2" install
  install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lua51-sec() {
  depends=('openssl' 'lua51' 'lua51-socket')
  conflicts=('luasec')
  replaces=('luasec')

  install -dm755 "$pkgdir/usr/lib/lua/5.1"
  cd luasec-luasec-$pkgver-51
  make LUACPATH="$pkgdir/usr/lib/lua/5.1" LUAPATH="$pkgdir/usr/share/lua/5.1" install
  install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

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