Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/mailman/
Date: Fri, 30 Oct 2015 12:04:09
Message-Id: 1446206629.a839c5d22b0d6db8f7c9d54be23763e9eaa8e6ec.jlec@gentoo
1 commit: a839c5d22b0d6db8f7c9d54be23763e9eaa8e6ec
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 30 10:35:17 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 30 12:03:49 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a839c5d2
7
8 net-mail/mailman: Bump to new python eclasses
9
10 move to virtual/dnspython
11
12 QA fixes:
13 drop additional die
14 add missing die
15 streamline use of external tools
16
17 Package-Manager: portage-2.2.23
18 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
19
20 net-mail/mailman/mailman-2.1.20-r1.ebuild | 164 ++++++++++++++++++++++++++++++
21 1 file changed, 164 insertions(+)
22
23 diff --git a/net-mail/mailman/mailman-2.1.20-r1.ebuild b/net-mail/mailman/mailman-2.1.20-r1.ebuild
24 new file mode 100644
25 index 0000000..41ffb9e
26 --- /dev/null
27 +++ b/net-mail/mailman/mailman-2.1.20-r1.ebuild
28 @@ -0,0 +1,164 @@
29 +# Copyright 1999-2015 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +# $Id$
32 +
33 +EAPI=5
34 +
35 +PYTHON_COMPAT=( python2_7 )
36 +
37 +inherit eutils python-single-r1 multilib systemd user
38 +
39 +DESCRIPTION="A python-based mailing list server with an extensive web interface"
40 +SRC_URI="mirror://sourceforge/${PN}/${P/_p/-}.tgz"
41 +HOMEPAGE="http://www.list.org/"
42 +S="${WORKDIR}/${P/_p/-}"
43 +
44 +SLOT="0"
45 +LICENSE="GPL-2"
46 +KEYWORDS="~amd64 ~ppc ~x86"
47 +IUSE="selinux"
48 +
49 +DEPEND="
50 + virtual/mta
51 + virtual/cron
52 + virtual/httpd-cgi
53 + virtual/dnspython[${PYTHON_USEDEP}]"
54 +RDEPEND="${DEPEND}
55 + selinux? ( sec-policy/selinux-mailman )
56 +"
57 +
58 +pkg_setup() {
59 + python-single-r1_pkg_setup
60 + INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
61 + VAR_PREFIX=${MAILMAN_VAR_PREFIX:-"/var/lib/mailman"}
62 + CGIUID=${MAILMAN_CGIUID:-apache}
63 + CGIGID=${MAILMAN_CGIGID:-apache}
64 + MAILUSR=${MAILMAN_MAILUSR:-mailman}
65 + MAILUID=${MAILMAN_MAILUID:-280}
66 + MAILGRP=${MAILMAN_MAILGRP:-mailman}
67 + MAILGID=${MAILMAN_MAILGID:-280}
68 +
69 + # Bug #58526: switch to enew{group,user}.
70 + # need to add mailman here for compile process.
71 + # Duplicated at pkg_postinst() for binary install.
72 + enewgroup ${MAILGRP} ${MAILGID}
73 + enewuser ${MAILUSR} ${MAILUID} /bin/bash ${INSTALLDIR} mailman,cron
74 +}
75 +
76 +src_prepare() {
77 + epatch "${FILESDIR}/${PN}-2.1.14_rc1-directory-check.patch"
78 + epatch "${FILESDIR}/${PN}-2.1.9-icons.patch"
79 +}
80 +
81 +src_configure() {
82 + econf \
83 + --without-permcheck \
84 + --prefix="${INSTALLDIR}" \
85 + --with-mail-gid=${MAILGID} \
86 + --with-cgi-gid=${CGIGID} \
87 + --with-cgi-ext="${MAILMAN_CGIEXT}" \
88 + --with-var-prefix="${VAR_PREFIX}" \
89 + --with-username=${MAILUSR} \
90 + --with-groupname=${MAILGRP} \
91 + --with-python="${PYTHON}"
92 +}
93 +
94 +src_install () {
95 + emake "DESTDIR=${D}" doinstall
96 +
97 + insinto /etc/apache2/modules.d
98 + newins "${FILESDIR}/50_mailman.conf-r2" 50_mailman.conf
99 + sed \
100 + -e "s:/usr/local/mailman/cgi-bin:${INSTALLDIR}/cgi-bin:g" \
101 + -e "s:/usr/local/mailman/icons:${INSTALLDIR}/icons:g" \
102 + -e "s:/usr/local/mailman/archives:${VAR_PREFIX}/archives:g" \
103 + -i "${D}/etc/apache2/modules.d/50_mailman.conf" || die
104 +
105 + newdoc "${FILESDIR}/README.gentoo-r3" README.gentoo
106 +
107 + dodoc ACK* BUGS FAQ NEWS README* TODO UPGRADING INSTALL contrib/mailman.mc \
108 + contrib/README.check_perms_grsecurity contrib/virtusertable
109 +
110 + exeinto ${INSTALLDIR}/bin
111 + doexe build/contrib/*.py contrib/majordomo2mailman.pl contrib/auto \
112 + contrib/mm-handler*
113 +
114 + dodir /etc/mailman
115 + mv "${D}/${INSTALLDIR}/Mailman/mm_cfg.py" "${D}/etc/mailman"
116 + dosym /etc/mailman/mm_cfg.py ${INSTALLDIR}/Mailman/mm_cfg.py
117 +
118 + # Save the old config for updates from pre-2.1.9-r2
119 + # To be removed some distant day
120 + for i in /var/mailman /home/mailman /usr/local/mailman ${INSTALLDIR}; do
121 + if [ -f ${i}/Mailman/mm_cfg.py ] && ! [ -L ${i}/Mailman/mm_cfg.py ]; then
122 + cp ${i}/Mailman/mm_cfg.py "${D}/etc/mailman/mm_cfg.py" || die
123 + fi
124 + done
125 +
126 + newinitd "${FILESDIR}/mailman.rc" mailman
127 + cp "${FILESDIR}/mailman.service" "${T}/mailman.service" || die
128 + sed -i "s/^User=.*/User=${MAILUSR}/" "${T}/mailman.service" || die
129 + systemd_dounit "${T}/mailman.service"
130 +
131 + keepdir ${VAR_PREFIX}/logs
132 + keepdir ${VAR_PREFIX}/locks
133 + keepdir ${VAR_PREFIX}/spam
134 + keepdir ${VAR_PREFIX}/archives/public
135 + keepdir ${VAR_PREFIX}/archives/private
136 + keepdir ${VAR_PREFIX}/lists
137 + keepdir ${VAR_PREFIX}/qfiles
138 +
139 + chown -R ${MAILUSR}:${MAILGRP} "${D}/${VAR_PREFIX}" "${D}/${INSTALLDIR}" "${D}"/etc/mailman/* || die
140 + chown ${CGIUID}:${MAILGRP} "${D}/${VAR_PREFIX}/archives/private" || die
141 + chmod 2775 "${D}/${INSTALLDIR}" "${D}/${INSTALLDIR}"/templates/* \
142 + "${D}/${INSTALLDIR}"/messages/* "${D}/${VAR_PREFIX}" "${D}/${VAR_PREFIX}"/{logs,lists,spam,locks,archives/public} || die
143 + chmod 2770 "${D}/${VAR_PREFIX}/archives/private" || die
144 + chmod 2770 "${D}/${VAR_PREFIX}/qfiles" || die
145 + chmod 2755 "${D}/${INSTALLDIR}"/cgi-bin/* "${D}/${INSTALLDIR}/mail/mailman" || die
146 +
147 + python_optimize ${INSTALLDIR}/bin/ ${INSTALLDIR}/Mailman \
148 + ${INSTALLDIR}/Mailman/*/
149 +}
150 +
151 +pkg_postinst() {
152 + enewgroup ${MAILGRP} ${MAILGID}
153 + enewuser ${MAILUSR} ${MAILUID} -1 ${INSTALLDIR} mailman,cron
154 + echo
155 + elog "Please read /usr/share/doc/${PF}/README.gentoo.bz2 for additional"
156 + elog "Setup information, mailman will NOT run unless you follow"
157 + elog "those instructions!"
158 + echo
159 +
160 + elog "An example Mailman configuration file for Apache has been installed into:"
161 + elog " ${APACHE2_MODULES_CONFDIR}/50_mailman.conf"
162 + echo
163 + elog "To enable, you will need to add \"-D MAILMAN\" to"
164 + elog "/etc/conf.d/apache2."
165 + echo
166 +
167 + ewarn "Default-Configuration has changed deeply in 2.1.9-r2. You can configure"
168 + ewarn "mailman with the following variables:"
169 + ewarn "MAILMAN_PREFIX (default: /usr/$(get_libdir)/mailman)"
170 + ewarn "MAILMAN_VAR_PREFIX (default: /var/lib/mailman)"
171 + ewarn "MAILMAN_CGIUID (default: apache)"
172 + ewarn "MAILMAN_CGIGID (default: apache)"
173 + ewarn "MAILMAN_CGIEXT (default: empty)"
174 + ewarn "MAILMAN_MAILUSR (default: mailman)"
175 + ewarn "MAILMAN_MAILUID (default: 280)"
176 + ewarn "MAILMAN_MAILGRP (default: mailman)"
177 + ewarn "MAILMAN_MAILGID (default: 280)"
178 + ewarn
179 + ewarn "Config file is now symlinked in /etc/mailman, so etc-update works."
180 + ewarn
181 + ewarn "If you're upgrading from below 2.1.9-r2 or changed MAILMAN_PREFIX, you"
182 + ewarn "NEED to make a few manual updates to your system:"
183 + ewarn
184 + ewarn "1. Update your mailman users's home directory: usermod -d ${INSTALLDIR} mailman"
185 + ewarn "2. Re-import the crontab: su - mailman -c 'crontab cron/crontab.in'"
186 + ewarn "3. Copy your old mm_cfg.py file to /etc/mailman/mm_cfg.py"
187 + ewarn
188 + ewarn "Additionally if you've modified MAILMAN_VAR_PREFIX (or upgraded from"
189 + ewarn "a pre 2.1.9-r2 installation), you should move your old lists/ and"
190 + ewarn "archives/ directory to the new location, ensuring that the"
191 + ewarn "permissions is correct. See bug #208789 for a discussion."
192 +}