void-packages/srcpkgs/rspamd/template
Đoàn Trần Công Danh 103ab731ab srcpkgs/r*: convert patches to -Np1
* runit is kept at -Np0

```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

55 lines
1.8 KiB
Bash

# Template file for 'rspamd'
pkgname=rspamd
version=1.9.4
revision=5
archs="x86_64* i686* aarch64* armv[67]* ppc64*"
build_style=cmake
configure_args="-DRSPAMD_USER=rspamd -DCONFDIR=/etc/rspamd
-DDBDIR=/var/lib/rspamd"
hostmakedepends="perl pkg-config ragel"
makedepends="LuaJIT-devel fann-devel file-devel gd-devel gmime-devel
hiredis-devel icu-devel libevent-devel sqlite-devel"
short_desc="Fast, free and open-source spam filtering system"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="Apache-2.0"
homepage="https://rspamd.com/"
changelog="https://raw.githubusercontent.com/vstakhov/rspamd/master/ChangeLog"
distfiles="https://github.com/vstakhov/rspamd/archive/${version}.tar.gz"
checksum=e4720c1f45defd07dd17b9563d0ddc480c70beadbc1a833235c077960092e030
system_accounts="rspamd"
rspamd_homedir=/var/lib/rspamd
conf_files="/etc/rspamd/*.conf /etc/rspamd/*.inc /etc/rspamd/modules.d/*.conf"
case "$XBPS_TARGET_MACHINE" in
aarch64*|arm*) configure_args+=" -DHAS_C11_ATOMICS_EXITCODE=0
-DHAS_C11_ATOMICS_EXITCODE__TRYRUN_OUTPUT=0
-DHAVE_ATOMIC_BUILTINS_EXITCODE=0
-DHAVE_ATOMIC_BUILTINS_EXITCODE__TRYRUN_OUTPUT=0"
esac
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" ${makedepends}"
pre_build() {
make -C build_native/contrib/snowball
vsed -e "s#${wrksrc}/build/contrib/snowball/snowball#${wrksrc}/build_native/contrib/snowball/snowball#g" \
-i build/build.ninja
}
fi
pre_configure() {
case "$XBPS_TARGET_MACHINE" in
*-musl) # Remove non existing library nsl
vsed -i CMakeLists.txt -e "/LIST(APPEND CMAKE_REQUIRED_LIBRARIES nsl)/d"
esac
if [ "$CROSS_BUILD" ]; then
configure_args+=" -C ${FILESDIR}/TryRunResults.cmake"
mkdir -p build_native
( cd build_native; LD= CC= CFLAGS= LDFLAGS= cmake .. )
fi
}
post_install() {
vsv rspamd
vlicense LICENSE.md
}