1 |
commit: 1916dc504837114a2fcd018363632edac9a9b0e8 |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 9 22:05:44 2021 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 9 22:36:32 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1916dc50 |
7 |
|
8 |
mail-mta/nullmailer: migrate to GLEP 81 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/781320 |
11 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
12 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
13 |
|
14 |
mail-mta/nullmailer/nullmailer-2.2-r2.ebuild | 157 +++++++++++++++++++++++++++ |
15 |
1 file changed, 157 insertions(+) |
16 |
|
17 |
diff --git a/mail-mta/nullmailer/nullmailer-2.2-r2.ebuild b/mail-mta/nullmailer/nullmailer-2.2-r2.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..3ea8f8fe0a9 |
20 |
--- /dev/null |
21 |
+++ b/mail-mta/nullmailer/nullmailer-2.2-r2.ebuild |
22 |
@@ -0,0 +1,157 @@ |
23 |
+# Copyright 1999-2021 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+inherit autotools flag-o-matic multilib systemd |
29 |
+ |
30 |
+DESCRIPTION="Simple relay-only local mail transport agent" |
31 |
+HOMEPAGE="http://untroubled.org/nullmailer/ https://github.com/bruceg/nullmailer" |
32 |
+SRC_URI="http://untroubled.org/${PN}/archive/${P}.tar.gz" |
33 |
+ |
34 |
+LICENSE="GPL-2" |
35 |
+SLOT="0" |
36 |
+KEYWORDS="amd64 ~arm ~arm64 ppc x86 ~x64-cygwin" |
37 |
+IUSE="ssl test" |
38 |
+RESTRICT="!test? ( test )" |
39 |
+ |
40 |
+BDEPEND=" |
41 |
+ acct-group/nullmail |
42 |
+ acct-user/nullmail |
43 |
+" |
44 |
+ |
45 |
+DEPEND=" |
46 |
+ ssl? ( net-libs/gnutls:0= ) |
47 |
+ test? ( sys-apps/ucspi-tcp[ipv6] sys-process/daemontools ) |
48 |
+" |
49 |
+RDEPEND=" |
50 |
+ ${BDEPEND} |
51 |
+ virtual/logger |
52 |
+ sys-apps/shadow |
53 |
+ ssl? ( net-libs/gnutls:0= ) |
54 |
+ !mail-mta/courier |
55 |
+ !mail-mta/esmtp |
56 |
+ !mail-mta/exim |
57 |
+ !mail-mta/mini-qmail |
58 |
+ !mail-mta/msmtp[mta(+)] |
59 |
+ !mail-mta/netqmail |
60 |
+ !mail-mta/opensmtpd[mta(+)] |
61 |
+ !mail-mta/postfix |
62 |
+ !mail-mta/qmail-ldap |
63 |
+ !mail-mta/sendmail |
64 |
+ !mail-mta/ssmtp[mta(+)] |
65 |
+" |
66 |
+ |
67 |
+PATCHES=( |
68 |
+ "${FILESDIR}/${P}-fix-test-racecondition.patch" |
69 |
+ "${FILESDIR}/${P}-disable-dns-using-test.patch" |
70 |
+ "${FILESDIR}/${P}-disable-smtp-auth-tests.patch" |
71 |
+ "${FILESDIR}/${P}-c++11.patch" |
72 |
+) |
73 |
+ |
74 |
+src_prepare() { |
75 |
+ default |
76 |
+ sed -i.orig \ |
77 |
+ -e '/\$(localstatedir)\/trigger/d' \ |
78 |
+ "${S}"/Makefile.am || die |
79 |
+ sed \ |
80 |
+ -e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \ |
81 |
+ -i configure.ac || die |
82 |
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die |
83 |
+ sed \ |
84 |
+ -e "s#/usr/local#/usr#" \ |
85 |
+ -e 's:/usr/etc/:/etc/:g' \ |
86 |
+ -i doc/nullmailer-send.8 || die |
87 |
+ eautoreconf |
88 |
+} |
89 |
+ |
90 |
+src_configure() { |
91 |
+ # https://github.com/bruceg/nullmailer/pull/31/commits |
92 |
+ append-lfs-flags #471102 |
93 |
+ econf \ |
94 |
+ --localstatedir="${EPREFIX}"/var \ |
95 |
+ $(use_enable ssl tls) |
96 |
+} |
97 |
+ |
98 |
+src_install() { |
99 |
+ default |
100 |
+ |
101 |
+ # A small bit of sample config |
102 |
+ insinto /etc/nullmailer |
103 |
+ newins "${FILESDIR}"/remotes.sample-2.0 remotes |
104 |
+ |
105 |
+ # This contains passwords, so should be secure |
106 |
+ fperms 0640 /etc/nullmailer/remotes |
107 |
+ fowners root:nullmail /etc/nullmailer/remotes |
108 |
+ |
109 |
+ # daemontools stuff |
110 |
+ dodir /var/spool/nullmailer/service{,/log} |
111 |
+ |
112 |
+ insinto /var/spool/nullmailer/service |
113 |
+ newins scripts/nullmailer.run run |
114 |
+ fperms 700 /var/spool/nullmailer/service/run |
115 |
+ |
116 |
+ insinto /var/spool/nullmailer/service/log |
117 |
+ newins scripts/nullmailer-log.run run |
118 |
+ fperms 700 /var/spool/nullmailer/service/log/run |
119 |
+ |
120 |
+ # usability |
121 |
+ dosym ../sbin/sendmail usr/$(get_libdir)/sendmail |
122 |
+ |
123 |
+ # permissions stuff |
124 |
+ keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue,failed} |
125 |
+ fperms 770 /var/log/nullmailer |
126 |
+ fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq |
127 |
+ fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq |
128 |
+ |
129 |
+ newinitd "${FILESDIR}"/init.d-nullmailer-r6 nullmailer |
130 |
+ systemd_dounit scripts/${PN}.service |
131 |
+} |
132 |
+ |
133 |
+pkg_postinst() { |
134 |
+ if [[ ! -e ${EROOT}/var/spool/nullmailer/trigger ]]; then |
135 |
+ mkfifo --mode=0660 "${EROOT}/var/spool/nullmailer/trigger" || die |
136 |
+ fi |
137 |
+ chown nullmail:nullmail \ |
138 |
+ "${EROOT}"/var/log/nullmailer \ |
139 |
+ "${EROOT}"/var/spool/nullmailer/{tmp,queue,failed,trigger} || die |
140 |
+ chmod 770 \ |
141 |
+ "${EROOT}"/var/log/nullmailer \ |
142 |
+ "${EROOT}"/var/spool/nullmailer/{tmp,queue,failed} || die |
143 |
+ chmod 660 "${EROOT}"/var/spool/nullmailer/trigger || die |
144 |
+ |
145 |
+ # This contains passwords, so should be secure |
146 |
+ chmod 0640 "${EROOT}"/etc/nullmailer/remotes || die |
147 |
+ chown root:nullmail "${EROOT}"/etc/nullmailer/remotes || die |
148 |
+ |
149 |
+ if [[ -z ${REPLACING_VERSIONS} ]]; then |
150 |
+ elog "To create an initial setup, please do:" |
151 |
+ elog "emerge --config =${CATEGORY}/${PF}" |
152 |
+ fi |
153 |
+} |
154 |
+ |
155 |
+pkg_postrm() { |
156 |
+ if [[ -e ${EROOT}/var/spool/nullmailer/trigger ]]; then |
157 |
+ rm "${EROOT}/var/spool/nullmailer/trigger" || die |
158 |
+ fi |
159 |
+} |
160 |
+ |
161 |
+pkg_config() { |
162 |
+ if [[ ! -s ${EROOT}/etc/nullmailer/me ]]; then |
163 |
+ einfo "Setting /etc/nullmailer/me" |
164 |
+ hostname --fqdn > "${EROOT}/etc/nullmailer/me" |
165 |
+ if [[ ! -s ${EROOT}/etc/nullmailer/me ]]; then |
166 |
+ eerror "Got no output from 'hostname --fqdn'" |
167 |
+ fi |
168 |
+ fi |
169 |
+ if [[ ! -s ${EROOT}/etc/nullmailer/defaultdomain ]]; then |
170 |
+ einfo "Setting /etc/nullmailer/defaultdomain" |
171 |
+ hostname --domain > "${EROOT}/etc/nullmailer/defaultdomain" |
172 |
+ if [[ ! -s ${EROOT}/etc/nullmailer/me ]]; then |
173 |
+ eerror "Got no output from 'hostname --domain'" |
174 |
+ fi |
175 |
+ fi |
176 |
+ if ! grep -q '^[ \t]*[^# \t]' "${EROOT}/etc/nullmailer/remotes"; then |
177 |
+ ewarn "Remember to tweak ${EROOT}/etc/nullmailer/remotes yourself!" |
178 |
+ fi |
179 |
+} |