void-packages/srcpkgs/lua54-lualdap/template
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

84 lines
2 KiB
Bash

# Template file for 'lua54-lualdap'
pkgname=lua54-lualdap
version=1.2.5
revision=3
wrksrc="lualdap-${version}"
build_style=gnu-makefile
hostmakedepends="pkg-config"
makedepends="lua51-devel lua52-devel lua53-devel lua54-devel libldap-devel"
_desc="LDAP bindings for Lua"
short_desc="${_desc} (5.4.x)"
maintainer="John Regan <john@jrjrtech.com>"
license="MIT"
homepage="https://github.com/lualdap/lualdap"
distfiles="https://github.com/lualdap/lualdap/archive/v${version}.tar.gz"
checksum=3e028faa6a5798cf2f3d50b9853b9b3fb6eb562b62010747bd5b6f50b57bb1cc
post_patch() {
cd ${wrksrc}
mkdir -p lua51
mv * lua51 || true
cp -a lua51 lua52
cp -a lua51 lua53
cp -a lua51 lua54
}
do_build() {
for luaver in 5.1 5.2 5.3 5.4; do
cd ${wrksrc}/lua${luaver//.}
vsed -i "s|^LUA_VERSION.*|LUA_VERSION = ${luaver}|g" config
make \
CC=$CC \
LD=$CC \
CFLAGS="$(pkg-config --cflags lua${luaver})" \
LDLIBS="$(pkg-config --libs lua${luaver}) -lldap" \
LUA_MODULES="$(pkg-config --variable=INSTALL_CMOD lua${luaver})" \
${makejobs}
done
}
do_install() {
for luaver in 5.1 5.2 5.3 5.4; do
vmkdir usr/lib/lua/$luaver
cd ${wrksrc}/lua${luaver//.}
make \
CC=$CC \
LD=$CC \
CFLAGS="$(pkg-config --cflags lua${luaver})" \
LDLIBS="$(pkg-config --libs lua${luaver}) -lldap" \
LUA_MODULES="$(pkg-config --variable=INSTALL_CMOD lua${luaver})" \
DESTDIR="${DESTDIR}" \
install
done
vlicense ${wrksrc}/lua54/LICENSE.md
}
lua51-lualdap_package() {
short_desc="${_desc} (5.1.x)"
pkg_install() {
vmove usr/lib/lua/5.1
vlicense lua51/LICENSE.md
}
}
lua52-lualdap_package() {
short_desc="${_desc} (5.2.x)"
pkg_install() {
vmove usr/lib/lua/5.2
vlicense lua52/LICENSE.md
}
}
lua53-lualdap_package() {
short_desc="${_desc} (5.3.x)"
pkg_install() {
vmove usr/lib/lua/5.3
vlicense lua53/LICENSE.md
}
}
lua-lualdap_package() {
depends="lua53-lualdap>=${version}_${revision}"
short_desc="${_desc} (5.3.x) (transitional dummy package)"
build_style=meta
}