Browse code

restore mailman with recaptcha patch

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

remove mailman2

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

fix mailman sitedir with lib64/lib split

Hanno authored on04/08/2019 09:57:35
Showing1 changed files
... ...
@@ -52,6 +52,7 @@ src_prepare() {
52 52
 	epatch "${FILESDIR}/${PN}-2.1.14_rc1-directory-check.patch"
53 53
 	epatch "${FILESDIR}/${PN}-2.1.9-icons.patch"
54 54
 	epatch "${FILESDIR}/${PN}-2.1.26-add-recaptcha.diff"
55
+	epatch "${FILESDIR}/mailman-fix-sitedir.diff"
55 56
 	sed -i \
56 57
 	-e 's:<mm-digest-question-end>:<mm-digest-question-end><tr><td>\&nbsp;</td><td><mm-recaptcha-javascript></td></tr>:g' \
57 58
 	-e 's:</TITLE>:</TITLE>\n<MM-Recaptcha-Script>:g' \
Browse code

mailman sync with portage

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