void-packages/srcpkgs/mDNSResponder/template
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: 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

44 lines
1.3 KiB
Bash

# Template file for 'mDNSResponder'
pkgname=mDNSResponder
version=1310.80.1
revision=1
hostmakedepends="flex byacc"
short_desc="Implements the Bonjour/Zeroconf protocol"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0, BSD-3-Clause"
homepage="https://opensource.apple.com/"
distfiles="https://opensource.apple.com/tarballs/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=097662447e1535573484697861d9f50eceaf2c52ec2742e451ee6ffe9bbf3e75
conf_files="/etc/nss_mdns.conf"
conflicts="nss-mdns>=0"
do_build() {
sed -i "s,cc ,$CC ,g" Clients/Makefile
cd mDNSPosix
sed -i 's,/var/run,/run,g' Makefile
make os=linux HAVE_IPV6=1 CC=$CC LD="$CC -shared $LDFLAGS" CFLAGS_DEBUG="$CFLAGS $CPPFLAGS" STRIP=echo OPTIONALTARG="dnsextd nss_mdns" BISON=byacc
}
do_install() {
cd mDNSPosix
# nss_mdns
vconf nss_mdns.conf
vman nss_mdns.conf.5
vman libnss_mdns.8
vinstall build/prod/libdns_sd.so 755 usr/lib
vinstall build/prod/libnss_mdns-0.2.so 755 usr/lib
ln -s libnss_mdns-0.2.so ${DESTDIR}/usr/lib/libnss_mdns.so.2
# mdnsd
vbin build/prod/mdnsd
# dnsextd
vbin build/prod/dnsextd
vman ${wrksrc}/mDNSShared/dnsextd.8
# dns-sd
vbin ${wrksrc}/Clients/build/dns-sd
vman ${wrksrc}/mDNSShared/dns-sd.1
# runit services
vsv mdnsd
vsv dnsextd
vlicense ${wrksrc}/LICENSE
}