# $Id: PKGBUILD 113676 2014-06-27 18:32:24Z arodseth $ # Maintainer: Alexander Rødseth # Contributor: Sébastien Luttringer # Contributor: SpepS # Contributor: Laszlo Papp # Contributor: Donald Ephraim Curtis # Dear ${mantainer}, # could you please make this package support both lua and lua5.1? As far as I # can tell, this split package works. # # source is taken from github via https, there's no need to use git. the tarball # will create a directory luaposix-$version. there's no real need to move it as # I did in prepare, but I'm kind of lazy and using $pkgbase as name will make # future mantainance easier in case the directory name changes. # # You may also want to give "bootstrap" a look: i think that skipping those # checks is fine if we check dependencies with pacman, so I did what you can see # in prepare. Overriding default values in configure makes the whole build work # even for lua 5.1 # # Best regards, # a happy user pkgbase=lua-posix pkgname=( 'lua51-posix' 'lua-posix' ) pkgver=33.0.0 pkgrel=1 pkgdesc='POSIX library for Lua' arch=('x86_64' 'i686') url='https://github.com/luaposix/luaposix' license=('MIT') makedepends=('help2man' 'ldoc' 'lua' 'lua51') options=('!makeflags') source=("luaposix::https://github.com/luaposix/luaposix/archive/v${pkgver}.tar.gz") md5sums=('4021853a4b0a41c65805531c3d75b40e') prepare() { mv "luaposix-${pkgver}" $pkgbase cd $pkgbase ./bootstrap --skip-rock-checks } build() { for pkg in ${pkgname[@]}; do cp -r ${pkgbase} ${pkg}-build done pushd lua-posix-build ./configure \ --prefix=/usr \ --libdir=/usr/lib/lua/5.2 \ --datadir=/usr/share/lua/5.2 \ --docdir=/usr/share/doc/lua-posix make popd pushd lua51-posix-build ./bootstrap --skip-rock-checks ./configure \ LUA=/usr/bin/lua5.1 LUA_INCLUDE=-I/usr/include/lua5.1 \ --prefix=/usr \ --libdir=/usr/lib/lua/5.1 \ --datadir=/usr/share/lua/5.1 \ --docdir=/usr/share/doc/lua51-posix make } package_lua-posix() { depends=( lua ) cd "${pkgname}-build" make DESTDIR="$pkgdir" install install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING" } package_lua51-posix() { depends=( lua51 ) cd "${pkgname}-build" make DESTDIR="$pkgdir" install install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING" } # vim:set ts=2 sw=2 et: