Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-mta/nullmailer/
Date: Sat, 27 May 2017 18:41:32
Message-Id: 1495910480.6ba577ac452784c5b80c3ab1aff14e4049fb6d79.robbat2@gentoo
1 commit: 6ba577ac452784c5b80c3ab1aff14e4049fb6d79
2 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 27 18:40:00 2017 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Sat May 27 18:41:20 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ba577ac
7
8 mail-mta/nullmailer: use revbump for USE=test due to unstable-only dep.
9
10 Package-Manager: portage-2.3.6
11
12 mail-mta/nullmailer/nullmailer-2.0-r2.ebuild | 138 +++++++++++++++++++++++++++
13 1 file changed, 138 insertions(+)
14
15 diff --git a/mail-mta/nullmailer/nullmailer-2.0-r2.ebuild b/mail-mta/nullmailer/nullmailer-2.0-r2.ebuild
16 new file mode 100644
17 index 00000000000..8da57096407
18 --- /dev/null
19 +++ b/mail-mta/nullmailer/nullmailer-2.0-r2.ebuild
20 @@ -0,0 +1,138 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=6
25 +
26 +inherit autotools eutils flag-o-matic multilib systemd user
27 +
28 +DESCRIPTION="Simple relay-only local mail transport agent"
29 +HOMEPAGE="http://untroubled.org/nullmailer/ https://github.com/bruceg/nullmailer"
30 +SRC_URI="http://untroubled.org/${PN}/archive/${P}.tar.gz"
31 +
32 +LICENSE="GPL-2"
33 +SLOT="0"
34 +KEYWORDS="~amd64 ~ppc ~x86"
35 +IUSE="ssl test"
36 +
37 +DEPEND="
38 + sys-apps/groff
39 + ssl? ( net-libs/gnutls:0= )
40 + test? ( sys-apps/ucspi-tcp[ipv6] sys-process/daemontools )"
41 +RDEPEND="
42 + virtual/logger
43 + virtual/shadow
44 + ssl? ( net-libs/gnutls:0= )
45 + !mail-mta/courier
46 + !mail-mta/esmtp
47 + !mail-mta/exim
48 + !mail-mta/mini-qmail
49 + !mail-mta/msmtp
50 + !mail-mta/netqmail
51 + !mail-mta/postfix
52 + !mail-mta/qmail-ldap
53 + !mail-mta/sendmail
54 + !mail-mta/opensmtpd
55 + !mail-mta/ssmtp"
56 +
57 +pkg_setup() {
58 + enewgroup nullmail 88
59 + enewuser nullmail 88 -1 /var/spool/nullmailer nullmail
60 +}
61 +
62 +src_prepare() {
63 + default
64 + sed -i.orig \
65 + -e '/\$(localstatedir)\/trigger/d' \
66 + "${S}"/Makefile.am || die "Sed failed"
67 + sed \
68 + -e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \
69 + -i configure.ac || die
70 + sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
71 + sed \
72 + -e "s#/usr/lib#\0exec#" -e "s#/usr/local#/usr#" \
73 + -e 's:/usr/etc/:/etc/:g' \
74 + -i doc/nullmailer-send.8 || die
75 + eautoreconf
76 +}
77 +
78 +src_configure() {
79 + # https://github.com/bruceg/nullmailer/pull/31/commits
80 + append-lfs-flags #471102
81 + econf \
82 + --localstatedir="${EPREFIX}"/var \
83 + $(use_enable ssl tls)
84 +}
85 +
86 +src_install() {
87 + default
88 +
89 + # A small bit of sample config
90 + insinto /etc/nullmailer
91 + newins "${FILESDIR}"/remotes.sample-${PV} remotes
92 +
93 + # This contains passwords, so should be secure
94 + fperms 0640 /etc/nullmailer/remotes
95 + fowners root:nullmail /etc/nullmailer/remotes
96 +
97 + # daemontools stuff
98 + dodir /var/spool/nullmailer/service{,/log}
99 +
100 + insinto /var/spool/nullmailer/service
101 + newins scripts/nullmailer.run run
102 + fperms 700 /var/spool/nullmailer/service/run
103 +
104 + insinto /var/spool/nullmailer/service/log
105 + newins scripts/nullmailer-log.run run
106 + fperms 700 /var/spool/nullmailer/service/log/run
107 +
108 + # usability
109 + dosym /usr/sbin/sendmail usr/$(get_libdir)/sendmail
110 +
111 + # permissions stuff
112 + keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue}
113 + fperms 770 /var/log/nullmailer
114 + fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
115 + fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
116 +
117 + newinitd "${FILESDIR}"/init.d-nullmailer-r6 nullmailer
118 + systemd_dounit scripts/${PN}.service
119 +}
120 +
121 +pkg_postinst() {
122 + if [ ! -e "${EROOT}var/spool/nullmailer/trigger" ]; then
123 + mkfifo "${EROOT}var/spool/nullmailer/trigger" || die
124 + fi
125 + chown nullmail:nullmail \
126 + "${EROOT}"var/log/nullmailer \
127 + "${EROOT}"var/spool/nullmailer/{tmp,queue,trigger} || die
128 + chmod 770 \
129 + "${EROOT}"var/log/nullmailer \
130 + "${EROOT}"var/spool/nullmailer/{tmp,queue} || die
131 + chmod 660 "${EROOT}"var/spool/nullmailer/trigger || die
132 +
133 + # This contains passwords, so should be secure
134 + chmod 0640 "${EROOT}"etc/nullmailer/remotes || die
135 + chown root:nullmail "${EROOT}"etc/nullmailer/remotes || die
136 +
137 + if [[ -z ${REPLACING_VERSIONS} ]]; then
138 + elog "To create an initial setup, please do:"
139 + elog "emerge --config =${CATEGORY}/${PF}"
140 + fi
141 +}
142 +
143 +pkg_postrm() {
144 + if [[ -e "${EROOT}var/spool/nullmailer/trigger" ]]; then
145 + rm "${EROOT}var/spool/nullmailer/trigger" || die
146 + fi
147 +}
148 +
149 +pkg_config() {
150 + if [ ! -s "${EROOT}etc/nullmailer/me" ]; then
151 + einfo "Setting /etc/nullmailer/me"
152 + hostname --fqdn > "${EROOT}etc/nullmailer/me"
153 + fi
154 + if [ ! -s "${EROOT}etc/nullmailer/defaultdomain" ]; then
155 + einfo "Setting /etc/nullmailer/defaultdomain"
156 + hostname --domain > "${EROOT}etc/nullmailer/defaultdomain"
157 + fi
158 +}