Diff nullmailer-2.0-r2 with a nullmailer-2.2

/usr/portage/mail-mta/nullmailer/nullmailer-2.2.ebuild 2019-12-11 02:41:00.000000000 +0300
1 1
# Copyright 1999-2019 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=6
4
EAPI=7
5 5

  
6 6
inherit autotools eutils flag-o-matic multilib systemd user
7 7

  
......
11 11

  
12 12
LICENSE="GPL-2"
13 13
SLOT="0"
14
KEYWORDS="~amd64 ~ppc ~x86"
14
KEYWORDS="amd64 ~arm ppc x86 ~x64-cygwin"
15 15
IUSE="ssl test"
16 16
RESTRICT="!test? ( test )"
17 17

  
18 18
DEPEND="
19
	sys-apps/groff
20 19
	ssl? ( net-libs/gnutls:0= )
21
	test? ( sys-apps/ucspi-tcp[ipv6] sys-process/daemontools )"
20
	test? ( sys-apps/ucspi-tcp[ipv6] sys-process/daemontools )
21
"
22 22
RDEPEND="
23 23
	virtual/logger
24 24
	virtual/shadow
......
27 27
	!mail-mta/esmtp
28 28
	!mail-mta/exim
29 29
	!mail-mta/mini-qmail
30
	!mail-mta/msmtp
30
	!mail-mta/msmtp[mta(+)]
31 31
	!mail-mta/netqmail
32
	!mail-mta/opensmtpd[mta(+)]
32 33
	!mail-mta/postfix
33 34
	!mail-mta/qmail-ldap
34 35
	!mail-mta/sendmail
35
	!mail-mta/opensmtpd
36
	!mail-mta/ssmtp"
36
	!mail-mta/ssmtp[mta(+)]
37
"
38

  
39
PATCHES=(
40
	"${FILESDIR}/${P}-fix-test-racecondition.patch"
41
	"${FILESDIR}/${P}-disable-dns-using-test.patch"
42
	"${FILESDIR}/${P}-disable-smtp-auth-tests.patch"
43
)
37 44

  
38 45
pkg_setup() {
39 46
	enewgroup nullmail 88
......
44 51
	default
45 52
	sed -i.orig \
46 53
		-e '/\$(localstatedir)\/trigger/d' \
47
		"${S}"/Makefile.am || die "Sed failed"
54
		"${S}"/Makefile.am || die
48 55
	sed \
49 56
		-e "s:^AC_PROG_RANLIB:AC_CHECK_TOOL(AR, ar, false)\nAC_PROG_RANLIB:g" \
50 57
		-i configure.ac || die
51 58
	sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die
52 59
	sed \
53
		-e "s#/usr/lib#\0exec#" -e "s#/usr/local#/usr#" \
60
		-e "s#/usr/local#/usr#" \
54 61
		-e 's:/usr/etc/:/etc/:g' \
55 62
		-i doc/nullmailer-send.8 || die
56 63
	eautoreconf
......
69 76

  
70 77
	# A small bit of sample config
71 78
	insinto /etc/nullmailer
72
	newins "${FILESDIR}"/remotes.sample-${PV} remotes
79
	newins "${FILESDIR}"/remotes.sample-2.0 remotes
73 80

  
74 81
	# This contains passwords, so should be secure
75 82
	fperms 0640 /etc/nullmailer/remotes
......
87 94
	fperms 700 /var/spool/nullmailer/service/log/run
88 95

  
89 96
	# usability
90
	dosym /usr/sbin/sendmail usr/$(get_libdir)/sendmail
97
	dosym ../sbin/sendmail usr/$(get_libdir)/sendmail
91 98

  
92 99
	# permissions stuff
93
	keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue}
100
	keepdir /var/log/nullmailer /var/spool/nullmailer/{tmp,queue,failed}
94 101
	fperms 770 /var/log/nullmailer
95 102
	fowners nullmail:nullmail /usr/sbin/nullmailer-queue /usr/bin/mailq
96 103
	fperms 4711 /usr/sbin/nullmailer-queue /usr/bin/mailq
......
100 107
}
101 108

  
102 109
pkg_postinst() {
103
	if [ ! -e "${EROOT}var/spool/nullmailer/trigger" ]; then
104
		mkfifo "${EROOT}var/spool/nullmailer/trigger" || die
110
	if [[ ! -e ${EROOT}/var/spool/nullmailer/trigger ]]; then
111
		mkfifo --mode=0660 "${EROOT}/var/spool/nullmailer/trigger" || die
105 112
	fi
106 113
	chown nullmail:nullmail \
107
		"${EROOT}"var/log/nullmailer \
108
		"${EROOT}"var/spool/nullmailer/{tmp,queue,trigger} || die
114
		"${EROOT}"/var/log/nullmailer \
115
		"${EROOT}"/var/spool/nullmailer/{tmp,queue,failed,trigger} || die
109 116
	chmod 770 \
110
		"${EROOT}"var/log/nullmailer \
111
		"${EROOT}"var/spool/nullmailer/{tmp,queue} || die
112
	chmod 660 "${EROOT}"var/spool/nullmailer/trigger || die
117
		"${EROOT}"/var/log/nullmailer \
118
		"${EROOT}"/var/spool/nullmailer/{tmp,queue,failed} || die
119
	chmod 660 "${EROOT}"/var/spool/nullmailer/trigger || die
113 120

  
114 121
	# This contains passwords, so should be secure
115
	chmod 0640 "${EROOT}"etc/nullmailer/remotes || die
116
	chown root:nullmail "${EROOT}"etc/nullmailer/remotes || die
122
	chmod 0640 "${EROOT}"/etc/nullmailer/remotes || die
123
	chown root:nullmail "${EROOT}"/etc/nullmailer/remotes || die
117 124

  
118 125
	if [[ -z ${REPLACING_VERSIONS} ]]; then
119 126
		elog "To create an initial setup, please do:"
......
122 129
}
123 130

  
124 131
pkg_postrm() {
125
	if [[ -e "${EROOT}var/spool/nullmailer/trigger" ]]; then
126
		rm "${EROOT}var/spool/nullmailer/trigger" || die
132
	if [[ -e ${EROOT}/var/spool/nullmailer/trigger ]]; then
133
		rm "${EROOT}/var/spool/nullmailer/trigger" || die
127 134
	fi
128 135
}
129 136

  
130 137
pkg_config() {
131
	if [ ! -s "${EROOT}etc/nullmailer/me" ]; then
138
	if [[ ! -s ${EROOT}/etc/nullmailer/me ]]; then
132 139
		einfo "Setting /etc/nullmailer/me"
133
		hostname --fqdn > "${EROOT}etc/nullmailer/me"
140
		hostname --fqdn > "${EROOT}/etc/nullmailer/me"
141
		if [[ ! -s ${EROOT}/etc/nullmailer/me ]]; then
142
			eerror "Got no output from 'hostname --fqdn'"
143
		fi
134 144
	fi
135
	if [ ! -s "${EROOT}etc/nullmailer/defaultdomain" ]; then
145
	if [[ ! -s ${EROOT}/etc/nullmailer/defaultdomain ]]; then
136 146
		einfo "Setting /etc/nullmailer/defaultdomain"
137
		hostname --domain > "${EROOT}etc/nullmailer/defaultdomain"
147
		hostname --domain > "${EROOT}/etc/nullmailer/defaultdomain"
148
		if [[ ! -s ${EROOT}/etc/nullmailer/me ]]; then
149
			eerror "Got no output from 'hostname --domain'"
150
		fi
151
	fi
152
	if ! grep -q '^[ \t]*[^# \t]' "${EROOT}/etc/nullmailer/remotes"; then
153
		ewarn "Remember to tweak ${EROOT}/etc/nullmailer/remotes yourself!"
138 154
	fi
139 155
}
Thank you!