void-packages/srcpkgs/coturn/template
Đoàn Trần Công Danh c987560802 srcpkgs/c*: 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

50 lines
1.3 KiB
Bash

# Template file for 'coturn'
pkgname=coturn
version=4.5.1.3
revision=3
build_style=gnu-configure
configure_args="--libdir=/usr/lib"
conf_files="/etc/turnserver.conf"
makedepends="openssl-devel libevent-devel hiredis-devel sqlite-devel
postgresql-libs-devel libmariadbclient-devel"
short_desc="Server Implementation of TURN and STUN"
maintainer="Toyam Cox <Vaelatern@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://github.com/coturn/coturn"
distfiles="https://github.com/coturn/coturn/archive/${version}.tar.gz"
checksum=4ff1f8c041ac71445018d81321d4b66e5dce4f171ef73a348d858dc9a0cc1cce
post_patch() {
# LibreSSL does not support FIPS mode
vsed -i src/client/ns_turn_msg.c \
-e 's/^#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW$/#if 0/'
}
pre_build() {
# configure script does not like /usr when cross-building
if [ "$CROSS_BUILD" ]; then
LOCALSTATEDIR=/var ./configure --prefix=/tmp --confdir=/etc
sed -i 's:\${MANPREFIX}:/tmp/share:' Makefile
fi
}
system_accounts="_coturn"
post_install() {
if [ "$CROSS_BUILD" ]; then
vmkdir usr
mv -v ${DESTDIR}/tmp/* ${DESTDIR}/usr
fi
vlicense LICENSE
vsv coturnserver
vsconf examples/etc/turnserver.conf
}
coturn-devel_package() {
short_desc="${short_desc} - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove "usr/lib/*.a"
vmove usr/include
}
}