summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Chaintreuil <gentoo_bugs_peep@parallaxshift.com>2017-10-10 14:45:17 -0400
committerMichał Górny <mgorny@gentoo.org>2018-03-16 22:31:40 +0100
commitc70cb2949ef1ee4a399ded2c058946f1de63de00 (patch)
tree3a0040bf6d46fe448000ac61c0837b449e564f46 /mail-filter
parentmedia-sound/cantata: Fix runtime crash w/ >=dev-qt/qtsql-5.10 (diff)
downloadgentoo-c70cb2949ef1ee4a399ded2c058946f1de63de00.tar.gz
gentoo-c70cb2949ef1ee4a399ded2c058946f1de63de00.tar.bz2
gentoo-c70cb2949ef1ee4a399ded2c058946f1de63de00.zip
mail-filter/postforward: Initial ebuild
Postforward is a mail forwarding utility which aims to compliment the Postfix Sender Rewriting Scheme daemon (PostSRSd) by allowing only certain addresses to be forwarded while leaving leaving non-forwarded mail unaltered by PostSRSd. - Create initial ebuild - Work around upstream not putting their .go files in src/ which makes "go build" angry - Work around golang-build complaining about pkg not existing and just do the install by hand - Patch default sendmail path to respect EPREFIX and use the standard postfix install location instead of depending on it being in the path - Implement requests made by monsueirp on GitHub: https://github.com/gentoo/gentoo/pull/5910#pullrequestreview-83093569 - Implement requests made by mgorny on GitHub: https://github.com/gentoo/gentoo/pull/5910#pullrequestreview-103921727 Package-Manager: Portage-2.3.8, Repoman-2.3.3 Closes: https://bugs.gentoo.org/650398 Closes: https://github.com/gentoo/gentoo/pull/5910
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/postforward/Manifest1
-rw-r--r--mail-filter/postforward/files/postforward_apply-sendmail-path.patch11
-rw-r--r--mail-filter/postforward/metadata.xml17
-rw-r--r--mail-filter/postforward/postforward-1.1.0.ebuild47
4 files changed, 76 insertions, 0 deletions
diff --git a/mail-filter/postforward/Manifest b/mail-filter/postforward/Manifest
new file mode 100644
index 000000000000..7cdc14db3424
--- /dev/null
+++ b/mail-filter/postforward/Manifest
@@ -0,0 +1 @@
+DIST postforward-1.1.0.tar.gz 5707 BLAKE2B 2dc994628820b40caf3b9c65ad6be48e220abff8f5a6d6054b109600d9d368fab3e6e642dbc5a98235f440359600a3f4bbc19f7ead06fd84802a8900fa465dc1 SHA512 39d7a33c454b1529a691b24fd69b311ba368caf59168d39146654cfe319ebc3cf73835e66e6c95a43747f389a6b954ac8da0d7e934e562c16cb85dc20c0f4804
diff --git a/mail-filter/postforward/files/postforward_apply-sendmail-path.patch b/mail-filter/postforward/files/postforward_apply-sendmail-path.patch
new file mode 100644
index 000000000000..c64b76368a39
--- /dev/null
+++ b/mail-filter/postforward/files/postforward_apply-sendmail-path.patch
@@ -0,0 +1,11 @@
+--- a/postforward.go
++++ b/postforward.go
+@@ -27,7 +27,7 @@ const (
+ )
+
+ var dryRun = flag.Bool("dry-run", false, "show what would be done, don't actually forward mail")
+-var path = flag.String("path", "", "override $PATH with this value when executing binaries")
++var path = flag.String("path", "@GENTOO_PORTAGE_EPREFIX@/usr/sbin", "override $PATH with this value when executing binaries")
+ var rpHeader = flag.String("rp-header", "Return-Path", "header name containing the return-path (MAIL FROM) value")
+ var sendmailPath = flag.String("sendmail-path", "sendmail", "path to the sendmail binary (deprecated: use --path instead)")
+ var srsAddr = flag.String("srs-addr", "localhost:10001", "TCP address for SRS lookups")
diff --git a/mail-filter/postforward/metadata.xml b/mail-filter/postforward/metadata.xml
new file mode 100644
index 000000000000..e9e4ddc46066
--- /dev/null
+++ b/mail-filter/postforward/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gentoo_bugs_peep@parallaxshift.com</email>
+ <name>Philippe Chaintreuil</name>
+ </maintainer>
+
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+
+ <upstream>
+ <remote-id type="github">zoni/postforward</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/mail-filter/postforward/postforward-1.1.0.ebuild b/mail-filter/postforward/postforward-1.1.0.ebuild
new file mode 100644
index 000000000000..681a874c9e66
--- /dev/null
+++ b/mail-filter/postforward/postforward-1.1.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils golang-build
+
+DESCRIPTION="Postfix Sender Rewriting Scheme forwarding agent"
+EGO_PN="${PN}"
+SRC_URI="https://github.com/zoni/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+HOMEPAGE="https://github.com/zoni/postforward"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+ dev-lang/go:0"
+RDEPEND="
+ mail-filter/postsrsd"
+
+PATCHES=( "${FILESDIR}/${PN}_apply-sendmail-path.patch" )
+
+src_prepare() {
+ default
+
+ # Dynamically fix EPREFIX lines made by ${PN}_apply-sendmail-path.patch
+ sed -i -e "s/@GENTOO_PORTAGE_EPREFIX@/${EPREFIX}/" *.go || die
+
+ # go build assumes files will be in src dir, but
+ # source files are in root in this package, so move
+ # them.
+ local new_src_dir="${S}/src/${EGO_PN}"
+ # Freak out if there's already something there because
+ # it means the package has changed and we'll need to
+ # adjust to it.
+ [[ ! -e "${new_src_dir}" ]] || die "${new_src_dir} already exists"
+ mkdir -p "${new_src_dir}" || die
+ mv *.go "${new_src_dir}" || die
+}
+
+# Standard golang-build src_install complains about pkg not
+# existing, so we go custom.
+src_install() {
+ einstalldocs
+ dosbin "${PN}"
+}