Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/vpopmail/
Date: Tue, 25 Feb 2020 21:29:36
Message-Id: 1582666162.264b28523b9afd79eac7b9a0a969693e800ad616.slyfox@gentoo
1 commit: 264b28523b9afd79eac7b9a0a969693e800ad616
2 Author: Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
3 AuthorDate: Sat Jan 25 10:31:00 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 25 21:29:22 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=264b2852
7
8 net-mail/vpopmail: enable onchange script
9
10 If there is no script put there by the user then this simply does nothing as
11 before.
12
13 This also drops the dependency on postgresql[server] as I see no reason that
14 this would not work with a remote server.
15
16 Closes: https://bugs.gentoo.org/516100
17 Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
18 Closes: https://github.com/gentoo/gentoo/pull/14441
19 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
20
21 net-mail/vpopmail/vpopmail-5.4.33-r7.ebuild | 251 ++++++++++++++++++++++++++++
22 1 file changed, 251 insertions(+)
23
24 diff --git a/net-mail/vpopmail/vpopmail-5.4.33-r7.ebuild b/net-mail/vpopmail/vpopmail-5.4.33-r7.ebuild
25 new file mode 100644
26 index 00000000000..ceca711c4a4
27 --- /dev/null
28 +++ b/net-mail/vpopmail/vpopmail-5.4.33-r7.ebuild
29 @@ -0,0 +1,251 @@
30 +# Copyright 1999-2019 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +inherit autotools fixheadtails qmail
36 +
37 +HOMEPAGE="http://www.inter7.com/index.php?page=vpopmail"
38 +DESCRIPTION="Collection of programs to manage virtual email on Qmail servers"
39 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
40 +
41 +LICENSE="GPL-2"
42 +SLOT="0"
43 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
44 +IUSE="clearpasswd ipalias maildrop mysql postgres spamassassin"
45 +REQUIRED_USE="mysql? ( !postgres )"
46 +
47 +DEPEND="
48 + acct-group/vpopmail
49 + acct-user/vpopmail
50 + virtual/qmail
51 + maildrop? ( mail-filter/maildrop )
52 + mysql? ( dev-db/mysql-connector-c:0= )
53 + postgres? ( dev-db/postgresql:= )
54 + spamassassin? ( mail-filter/spamassassin )"
55 +RDEPEND="${DEPEND}"
56 +
57 +PATCHES=(
58 + "${FILESDIR}"/${PN}-5.4.9-access.violation.patch
59 + "${FILESDIR}"/${PN}-lazy.patch
60 + "${FILESDIR}"/${PN}-vpgsql.patch
61 + "${FILESDIR}"/${PN}-double-free.patch
62 + "${FILESDIR}"/${PN}-5.4.33-vdelivermail-add-static.patch
63 + "${FILESDIR}"/${PN}-5.4.33-fix-those-vfork-instances-that-do-more-than-exec.patch
64 + "${FILESDIR}"/${PN}-5.4.33-remove-unneeded-forward-declaration.patch
65 + "${FILESDIR}"/${PN}-5.4.33-clean-up-calling-maildrop.patch
66 + "${FILESDIR}"/${PN}-5.4.33-fix-S-tag-in-case-spamassassin-changed-the-file-size.patch
67 + "${FILESDIR}"/${PN}-5.4.33-strncat.patch
68 + "${FILESDIR}"/${PN}-5.4.33-unistd.patch
69 + "${FILESDIR}"/${PN}-5.4.33-check-crypt-return-value-for-NULL.patch
70 + "${FILESDIR}"/${PN}-5.4.33-use-proper-printf-format-strings.patch
71 +)
72 +DOCS=(
73 + ChangeLog
74 + doc/.
75 +)
76 +HTML_DOCS=(
77 + doc_html/.
78 + man_html/.
79 +)
80 +
81 +VPOP_HOME="/var/vpopmail"
82 +
83 +pkg_setup() {
84 + upgradewarning
85 +}
86 +
87 +src_prepare() {
88 + default
89 +
90 + echo 'install-recursive: install-exec-am' \
91 + >>"${S}"/Makefile.am || die
92 +
93 + # fix maildir paths
94 + sed -i -e 's|Maildir|.maildir|g' \
95 + vchkpw.c vconvert.c vdelivermail.c \
96 + vpopbull.c vpopmail.c vqmaillocal.c \
97 + vuserinfo.c maildirquota.c || die
98 +
99 + # remove vpopmail advertisement
100 + sed -i -e '/printf.*vpopmail/s:vpopmail (:(:' \
101 + vdelivermail.c vpopbull.c vqmaillocal.c || die
102 +
103 + # automake/autoconf
104 + mv "${S}"/configure.{in,ac} || die
105 + sed -i -e 's,AM_CONFIG_HEADER,AC_CONFIG_HEADERS,g' \
106 + configure.ac || die
107 +
108 + # _FORTIFY_SOURCE
109 + sed -i \
110 + -e 's/\(snprintf(\s*\(LI->[a-zA-Z_]\+\),\s*\)[a-zA-Z_]\+,/\1 sizeof(\2),/' \
111 + vlistlib.c || die
112 +
113 + eautoreconf
114 + ht_fix_file cdb/Makefile
115 +}
116 +
117 +src_configure() {
118 + local -a authopts
119 + if use mysql; then
120 + incdir=$(mysql_config --variable=pkgincludedir || die)
121 + libdir=$(mysql_config --variable=pkglibdir || die)
122 + authopts+=( "--enable-auth-module=mysql"
123 + "--enable-incdir=${incdir}"
124 + "--enable-libdir=${libdir}"
125 + "--enable-sql-logging"
126 + "--enable-valias"
127 + "--disable-mysql-replication"
128 + "--enable-mysql-limits"
129 + )
130 + elif use postgres; then
131 + libdir=$(pg_config --libdir || die)
132 + incdir=$(pg_config --pkgincludedir || die)
133 + authopts+=( "--enable-auth-module=pgsql"
134 + "--enable-incdir=${incdir}"
135 + "--enable-libdir=${libdir}"
136 + "--enable-sql-logging"
137 + "--enable-valias"
138 + )
139 + else
140 + authopts+=( "--enable-auth-module=cdb" )
141 + fi
142 +
143 + econf ${authopts[@]} \
144 + --sysconfdir=${VPOP_HOME}/etc \
145 + --enable-non-root-build \
146 + --enable-qmaildir=${QMAIL_HOME} \
147 + --enable-qmail-newu=${QMAIL_HOME}/bin/qmail-newu \
148 + --enable-qmail-inject=${QMAIL_HOME}/bin/qmail-inject \
149 + --enable-qmail-newmrh=${QMAIL_HOME}/bin/qmail-newmrh \
150 + --enable-vpopuser=vpopmail \
151 + --enable-vpopgroup=vpopmail \
152 + --enable-many-domains \
153 + --enable-file-locking \
154 + --enable-file-sync \
155 + --enable-md5-passwords \
156 + --enable-logging \
157 + --enable-auth-logging \
158 + --enable-log-name=vpopmail \
159 + --enable-qmail-ext \
160 + --enable-onchange-script \
161 + --disable-tcpserver-file \
162 + --disable-roaming-users \
163 + $(use_enable ipalias ip-alias-domains) \
164 + $(use_enable clearpasswd clear-passwd) \
165 + $(use_enable maildrop) \
166 + $(use_enable maildrop maildrop-prog /usr/bin/maildrop) \
167 + $(use_enable spamassassin)
168 +}
169 +
170 +src_install() {
171 + emake DESTDIR="${D}" install
172 + keepdir "${VPOP_HOME}"/domains
173 +
174 + # install helper script for maildir conversion
175 + into "${VPOP_HOME}"
176 + dobin "${FILESDIR}"/vpopmail-Maildir-dotmaildir-fix.sh
177 + into /usr
178 +
179 + mv doc/doc_html/ doc/man_html/ . || die
180 + einstalldocs
181 + rm -r "${D}/${VPOP_HOME}"/doc || die
182 +
183 + # create /etc/vpopmail.conf
184 + if use mysql; then
185 + insinto /etc
186 + newins "${D}${VPOP_HOME}"/etc/vpopmail.mysql vpopmail.conf
187 + dosym ../../../etc/vpopmail.conf "${VPOP_HOME}"/etc/vpopmail.mysql
188 +
189 + sed 's/^[^#]/# &/' -i "${D}"/etc/vpopmail.conf || die
190 + echo '# Read-only DB' >> "${D}"/etc/vpopmail.conf || die
191 + echo 'localhost|0|vpopmail|secret|vpopmail' >> "${D}"/etc/vpopmail.conf || die
192 + echo '# Write DB' >> "${D}"/etc/vpopmail.conf || die
193 + echo 'localhost|0|vpopmail|secret|vpopmail' >> "${D}"/etc/vpopmail.conf || die
194 +
195 + # lock down perms
196 + fperms 640 /etc/vpopmail.conf
197 + fowners root:vpopmail /etc/vpopmail.conf
198 + fi
199 +
200 + insinto "${VPOP_HOME}"/etc
201 + doins vusagec.conf
202 + dosym .."${VPOP_HOME}"/etc/vusagec.conf /etc/vusagec.conf
203 + sed -i 's/Disable = False;/Disable = True;/g' "${D}${VPOP_HOME}"/etc/vusagec.conf || die
204 +
205 + einfo "Installing env.d entry"
206 + doenvd "${FILESDIR}"/99vpopmail
207 +
208 + einfo "Locking down vpopmail permissions"
209 + fowners -R root:0 "${VPOP_HOME}"/{bin,etc,include}
210 + fowners root:vpopmail "${VPOP_HOME}"/bin/vchkpw
211 + fperms 4711 "${VPOP_HOME}"/bin/vchkpw
212 +}
213 +
214 +pkg_postinst() {
215 + if use mysql ; then
216 + elog
217 + elog "You have 'mysql' turned on in your USE"
218 + elog "Vpopmail needs a VALID MySQL USER. Let's call it 'vpopmail'"
219 + elog "You MUST add it and then specify its passwd in the /etc/vpopmail.conf file"
220 + elog
221 + elog "First log into mysql as your mysql root user and pass. Then:"
222 + elog "> create database vpopmail;"
223 + elog "> use mysql;"
224 + elog "> grant select, insert, update, delete, create, drop on vpopmail.* to"
225 + elog " vpopmail@localhost identified by 'your password';"
226 + elog "> flush privileges;"
227 + elog
228 + elog "If you have problems with vpopmail not accepting mail properly,"
229 + elog "please ensure that /etc/vpopmail.conf is chmod 640 and"
230 + elog "owned by root:vpopmail"
231 + elog
232 + fi
233 +
234 + # do this for good measure
235 + if [[ -e /etc/vpopmail.conf ]]; then
236 + chmod 640 /etc/vpopmail.conf || die
237 + chown root:vpopmail /etc/vpopmail.conf || die
238 + fi
239 +
240 + upgradewarning
241 +}
242 +
243 +pkg_postrm() {
244 + elog "The vpopmail DATA will NOT be removed automatically."
245 + elog "You can delete them manually by removing the ${VPOP_HOME} directory."
246 +}
247 +
248 +upgradewarning() {
249 + if has_version "<=net-mail/vpopmail-5.2.1-r8"; then
250 + ewarn
251 + ewarn "Massive important warning if you are upgrading to 5.2.1-r8 or older"
252 + ewarn "The internal structure of the mail storage has changed for"
253 + ewarn "consistancy with the rest of Gentoo! Please review and utilize the "
254 + ewarn "script at ${VPOP_HOME}/bin/vpopmail-Maildir-dotmaildir-fix.sh"
255 + ewarn "to upgrade your system! (It can do conversions both ways)."
256 + ewarn "You should be able to run it right away without any changes."
257 + ewarn
258 + fi
259 +
260 + elog
261 + elog "Use of vpopmail's tcp.smtp[.cdb] is also deprecated now, consider"
262 + elog "using net-mail/relay-ctrl instead."
263 + elog
264 +
265 + if use mysql; then
266 + if has_version "<=net-mail/vpopmail-5.4.17"; then
267 + elog
268 + elog "If you are upgrading from 5.4.17 or older, you have to fix your"
269 + elog "MySQL tables, please see the UPGRADE file in the documentation!"
270 + elog
271 + fi
272 + fi
273 +
274 + ewarn
275 + ewarn "Newer versions of vpopmail contain a quota daemon called vusaged."
276 + ewarn "This ebuild DOES NOT INSTALL vusaged and has therefore disabled"
277 + ewarn "its usage in ${VPOP_HOME}/etc/vusagec.conf. DO NOT ENABLE!"
278 + ewarn "Otherwise mail delivery WILL BREAK"
279 + ewarn
280 +}