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

57 lines
1.8 KiB
Bash

# Template file for 'opensmtpd'
pkgname=opensmtpd
version=6.8.0p2
revision=4
build_style=gnu-configure
configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin
--with-path-socket=/run --with-path-pidfile=/run
--with-mantype=doc --with-pie --with-table-db
--with-path-CAfile=/etc/ssl/certs/ca-certificates.crt
--with-maildir=/var/mail
--with-auth-pam=smtpd
ac_cv_func_explicit_bzero=no
ac_cv_func_reallocarray=no
ac_cv_func_strlcat=no
ac_cv_func_strlcpy=no"
hostmakedepends="automake libtool pkg-config bison"
makedepends="zlib-devel openssl-devel libevent-devel db-devel pam-devel"
depends="ca-certificates"
conf_files="/etc/smtpd/smtpd.conf /etc/smtpd/aliases"
short_desc="Free implementation of the server-side SMTP protocol"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="BSD-3-Clause, ISC, MIT"
homepage="https://www.opensmtpd.org"
distfiles="https://www.opensmtpd.org/archives/${pkgname}-${version}.tar.gz"
checksum=51bf05312fe56764748faab9e63170bfbb7c7d84a37c4117b62b2681eb3a4d17
provides="smtp-forwarder-0_1 smtp-server-0_1"
replaces="smtp-forwarder>=0 smtp-server>=0"
system_accounts="_smtpd _smtpq"
CFLAGS=-D_DEFAULT_SOURCE
case "$XBPS_TARGET_MACHINE" in
*-musl) configure_args+=" --with-libfts=${XBPS_CROSS_BASE}/usr"
makedepends+=" musl-fts-devel"
;;
esac
pre_configure() {
touch README AUTHORS NEWS ChangeLog
autoreconf -fi
# XXX hardcode the libevent major version for now.
# XXX the configure test needs to execute a binary to
# XXX get this result.
sed -e 's,^\(libevent_major_version\)=.*$,\1=2,' -i configure
sed -ri 's,/etc/mail,/etc/smtpd,g' usr.sbin/smtpd/smtpd.conf
}
post_install() {
for f in newaliases mailq makemap sendmail; do
ln -s smtpctl ${DESTDIR}/usr/bin/$f
done
vinstall ${FILESDIR}/smtpd.pam 644 etc/pam.d smtpd
vsv opensmtpd
vlicense LICENSE
vinstall /dev/null 644 etc/smtpd aliases
}