]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - net-mail/mailman/mailman-2.1.15.ebuild
Bump mailman to 2.1.15.
[mjo-overlay.git] / net-mail / mailman / mailman-2.1.15.ebuild
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-mail/mailman/mailman-2.1.14.ebuild,v 1.7 2011/11/02 22:09:34 vapier Exp $
4
5 inherit eutils python multilib
6
7 DESCRIPTION="A python-based mailing list server with an extensive web interface"
8 SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
9 HOMEPAGE="http://www.list.org/"
10
11 SLOT="0"
12 LICENSE="GPL-2"
13 KEYWORDS="amd64 ppc sparc x86"
14 IUSE=""
15
16 DEPEND=">=dev-lang/python-2.3
17 virtual/mta
18 virtual/cron
19 virtual/httpd-cgi"
20 RDEPEND="${DEPEND}"
21
22 pkg_setup() {
23 INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
24 VAR_PREFIX=${MAILMAN_VAR_PREFIX:-"/var/lib/mailman"}
25 CGIUID=${MAILMAN_CGIUID:-apache}
26 CGIGID=${MAILMAN_CGIGID:-apache}
27 MAILUSR=${MAILMAN_MAILUSR:-mailman}
28 MAILUID=${MAILMAN_MAILUID:-280}
29 MAILGRP=${MAILMAN_MAILGRP:-mailman}
30 MAILGID=${MAILMAN_MAILGID:-280}
31
32 # Bug #58526: switch to enew{group,user}.
33 # need to add mailman here for compile process.
34 # Duplicated at pkg_postinst() for binary install.
35 enewgroup ${MAILGRP} ${MAILGID}
36 enewuser ${MAILUSR} ${MAILUID} /bin/bash ${INSTALLDIR} mailman,cron
37 }
38
39 src_unpack() {
40 unpack ${A}
41 cd "${S}"
42 epatch "${FILESDIR}/${PN}-2.1.14_rc1-directory-check.patch" || die "patch failed."
43 epatch "${FILESDIR}/${PN}-2.1.9-icons.patch" || die "patch failed."
44 epatch "${FILESDIR}/${PN}-2.1.13-ldflags.patch" || die "patch failed."
45 }
46
47 src_compile() {
48 econf --without-permcheck \
49 --prefix="${INSTALLDIR}" \
50 --with-mail-gid=${MAILGID} \
51 --with-cgi-gid=${CGIGID} \
52 --with-cgi-ext="${MAILMAN_CGIEXT}" \
53 --with-var-prefix="${VAR_PREFIX}" \
54 --with-username=${MAILUSR} \
55 --with-groupname=${MAILGRP} \
56 || die "configure failed"
57
58 emake || die "make failed"
59 }
60
61 src_install () {
62 emake "DESTDIR=${D}" doinstall || die
63
64 insinto /etc/apache2/modules.d
65 newins "${FILESDIR}/50_mailman.conf-r1" 50_mailman.conf
66 dosed "s:/usr/local/mailman/cgi-bin:${INSTALLDIR}/cgi-bin:g" /etc/apache2/modules.d/50_mailman.conf
67 dosed "s:/usr/local/mailman/icons:${INSTALLDIR}/icons:g" /etc/apache2/modules.d/50_mailman.conf
68 dosed "s:/usr/local/mailman/archives:${VAR_PREFIX}/archives:g" /etc/apache2/modules.d/50_mailman.conf
69
70 newdoc "${FILESDIR}/README.gentoo-r3" README.gentoo || die "newdoc failed"
71
72 dodoc ACK* BUGS FAQ NEWS README* TODO UPGRADING INSTALL contrib/mailman.mc \
73 contrib/README.check_perms_grsecurity contrib/virtusertable || die "dodoc failed"
74
75 exeinto ${INSTALLDIR}/bin
76 doexe build/contrib/*.py contrib/majordomo2mailman.pl contrib/auto \
77 contrib/mm-handler* || die
78
79 dodir /etc/mailman
80 mv "${D}/${INSTALLDIR}/Mailman/mm_cfg.py" "${D}/etc/mailman"
81 dosym /etc/mailman/mm_cfg.py ${INSTALLDIR}/Mailman/mm_cfg.py
82
83 # Save the old config for updates from pre-2.1.9-r2
84 # To be removed some distant day
85 for i in /var/mailman /home/mailman /usr/local/mailman ${INSTALLDIR}
86 do
87 if [ -f ${i}/Mailman/mm_cfg.py ] && ! [ -L ${i}/Mailman/mm_cfg.py ]; then
88 cp ${i}/Mailman/mm_cfg.py "${D}/etc/mailman/mm_cfg.py"
89 fi
90 done
91
92 newinitd "${FILESDIR}/mailman.rc" mailman
93
94 keepdir ${VAR_PREFIX}/logs
95 keepdir ${VAR_PREFIX}/locks
96 keepdir ${VAR_PREFIX}/spam
97 keepdir ${VAR_PREFIX}/archives/public
98 keepdir ${VAR_PREFIX}/archives/private
99 keepdir ${VAR_PREFIX}/lists
100 keepdir ${VAR_PREFIX}/qfiles
101
102 chown -R ${MAILUSR}:${MAILGRP} "${D}/${VAR_PREFIX}" "${D}/${INSTALLDIR}" "${D}"/etc/mailman/*
103 chown ${CGIUID}:${MAILGRP} "${D}/${VAR_PREFIX}/archives/private"
104 chmod 2775 "${D}/${INSTALLDIR}" "${D}/${INSTALLDIR}"/templates/* \
105 "${D}/${INSTALLDIR}"/messages/* "${D}/${VAR_PREFIX}" "${D}/${VAR_PREFIX}"/{logs,lists,spam,locks,archives/public}
106 chmod 2770 "${D}/${VAR_PREFIX}/archives/private"
107 chmod 2770 "${D}/${VAR_PREFIX}/qfiles"
108 chmod 2755 "${D}/${INSTALLDIR}"/cgi-bin/* "${D}/${INSTALLDIR}/mail/mailman"
109
110 }
111
112 pkg_postinst() {
113 python_mod_optimize ${INSTALLDIR}/bin/ ${INSTALLDIR}/Mailman \
114 ${INSTALLDIR}/Mailman/*/
115
116 enewgroup ${MAILGRP} ${MAILGID}
117 enewuser ${MAILUSR} ${MAILUID} -1 ${INSTALLDIR} mailman,cron
118 elog
119 elog "Please read /usr/share/doc/${PF}/README.gentoo.bz2 for additional"
120 elog "Setup information, mailman will NOT run unless you follow"
121 elog "those instructions!"
122 elog
123
124 elog "An example Mailman configuration file for Apache has been installed into:"
125 elog " ${APACHE2_MODULES_CONFDIR}/50_mailman.conf"
126 elog
127 elog "To enable, you will need to add \"-D MAILMAN\" to"
128 elog "/etc/conf.d/apache2."
129 elog
130
131 ewarn "Default-Configuration has changed deeply in 2.1.9-r2. You can configure"
132 ewarn "mailman with the following variables:"
133 ewarn "MAILMAN_PREFIX (default: /usr/$(get_libdir)/mailman)"
134 ewarn "MAILMAN_VAR_PREFIX (default: /var/lib/mailman)"
135 ewarn "MAILMAN_CGIUID (default: apache)"
136 ewarn "MAILMAN_CGIGID (default: apache)"
137 ewarn "MAILMAN_CGIEXT (default: empty)"
138 ewarn "MAILMAN_MAILUSR (default: mailman)"
139 ewarn "MAILMAN_MAILUID (default: 280)"
140 ewarn "MAILMAN_MAILGRP (default: mailman)"
141 ewarn "MAILMAN_MAILGID (default: 280)"
142 ewarn
143 ewarn "Config file is now symlinked in /etc/mailman, so etc-update works."
144 ewarn
145 ewarn "If you're upgrading from below 2.1.9-r2 or changed MAILMAN_PREFIX, you"
146 ewarn "NEED to make a few manual updates to your system:"
147 ewarn
148 ewarn "1. Update your mailman users's home directory: usermod -d ${INSTALLDIR} mailman"
149 ewarn "2. Re-import the crontab: su - mailman -c 'crontab cron/crontab.in'"
150 ewarn "3. Copy your old mm_cfg.py file to /etc/mailman/mm_cfg.py"
151 ewarn
152 ewarn "Additionally if you've modified MAILMAN_VAR_PREFIX (or upgraded from"
153 ewarn "a pre 2.1.9-r2 installation), you should move your old lists/ and"
154 ewarn "archives/ directory to the new location, ensuring that the"
155 ewarn "permissions is correct. See bug #208789 for a discussion."
156 ebeep
157 }
158
159 pkg_postrm() {
160 INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
161 python_mod_cleanup ${INSTALLDIR}/bin ${INSTALLDIR}/Mailman \
162 ${INSTALLDIR}/Mailman/*/
163 }