source: net-mail/mailman/mailman-2.1.20.ebuild @ cfd4a56

Revision cfd4a56, 7.6 KB checked in by Mario Fetka <mario.fetka@…>, 5 years ago (diff)

Bump

Package-Manager: portage-2.2.14
RepoMan?-Options: --force

  • Property mode set to 100644
RevLine 
[da4656d]1# Copyright 1999-2015 Gentoo Foundation
[7ee0426]2# Distributed under the terms of the GNU General Public License v2
[da4656d]3# $Header: /var/cvsroot/gentoo-x86/net-mail/mailman/mailman-2.1.20.ebuild,v 1.2 2015/04/01 07:53:43 ago Exp $
[7ee0426]4
[da4656d]5EAPI="4"
6PYTHON_DEPEND="2"
[7ee0426]7
[da4656d]8inherit eutils python multilib systemd user
[7ee0426]9
[cfd4a56]10INDEXING_VER="2.1.20-0.1"
11HTDIG_VER="2.1.20-0.1"
[da4656d]12EXITSTATUS_VER="2.1.12-0.1"
[cfd4a56]13MODINC_VER="2.1.20-0.1"
[da4656d]14ANTISPAM_VER="2.1.15-0.1"
15RESPONSE_VER="2.1.12-0.1"
16DAILYMBOX_VER="2.1.12-0.1"
[2dba70d]17
[7ee0426]18DESCRIPTION="A python-based mailing list server with an extensive web interface"
[da4656d]19SRC_URI="mirror://sourceforge/${PN}/${P/_p/-}.tgz
20        http://www.openinfo.co.uk/mm/patches/444879/indexing-${INDEXING_VER}.patch.gz
21        http://ftp.disconnected-by-peer.at/pub/indexing-${INDEXING_VER}.patch.gz
22        http://www.openinfo.co.uk/mm/patches/444884/htdig-${HTDIG_VER}.patch.gz
[cfd4a56]23        http://ftp.disconnected-by-peer.at/pub/htdig-${HTDIG_VER}.patch.gz
[da4656d]24        http://www.openinfo.co.uk/mm/patches/644797/exitstatus-${EXITSTATUS_VER}.patch.gz
25        http://www.openinfo.co.uk/mm/patches/760567/modinc-${MODINC_VER}.patch.gz
26        http://ftp.disconnected-by-peer.at/pub/modinc-${MODINC_VER}.patch.gz
27        http://www.openinfo.co.uk/mm/patches/850805/antispam-${ANTISPAM_VER}.patch.gz
28        http://ftp.disconnected-by-peer.at/pub/antispam-${ANTISPAM_VER}.patch.gz
29        http://www.openinfo.co.uk/mm/patches/supportlist/response-${RESPONSE_VER}.patch.gz
30        http://www.openinfo.co.uk/mm/patches/dailymbox/dailymbox-${DAILYMBOX_VER}.patch.gz"
[7ee0426]31HOMEPAGE="http://www.list.org/ http://www.openinfo.co.uk/mm/"
[da4656d]32S="${WORKDIR}/${P/_p/-}"
[7ee0426]33
34SLOT="0"
35LICENSE="GPL-2"
[da4656d]36KEYWORDS="amd64 arm ppc x86"
37IUSE="selinux"
[7ee0426]38
[da4656d]39DEPEND="virtual/mta
[7ee0426]40        virtual/cron
[da4656d]41        virtual/httpd-cgi
42        dev-python/dnspython"
43RDEPEND="${DEPEND}
44        selinux? ( sec-policy/selinux-mailman )
45"
[2dba70d]46
[7ee0426]47pkg_setup() {
[da4656d]48        python_set_active_version 2
[7ee0426]49        INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
50        VAR_PREFIX=${MAILMAN_VAR_PREFIX:-"/var/lib/mailman"}
51        CGIUID=${MAILMAN_CGIUID:-apache}
52        CGIGID=${MAILMAN_CGIGID:-apache}
53        MAILUSR=${MAILMAN_MAILUSR:-mailman}
54        MAILUID=${MAILMAN_MAILUID:-280}
55        MAILGRP=${MAILMAN_MAILGRP:-mailman}
56        MAILGID=${MAILMAN_MAILGID:-280}
57
58        # Bug #58526: switch to enew{group,user}.
59        # need to add mailman here for compile process.
60        # Duplicated at pkg_postinst() for binary install.
61        enewgroup ${MAILGRP} ${MAILGID}
[2dba70d]62        enewuser  ${MAILUSR} ${MAILUID} /bin/bash ${INSTALLDIR} mailman,cron
[da4656d]63
64        python_pkg_setup
[7ee0426]65}
66
[da4656d]67src_prepare() {
[7ee0426]68        epatch "${FILESDIR}/${PN}-2.1.14_rc1-directory-check.patch" || die "patch failed."
69        epatch "${FILESDIR}/${PN}-2.1.9-icons.patch" || die "patch failed."
[da4656d]70        epatch "${DISTDIR}/indexing-${INDEXING_VER}.patch.gz" || die "patch failed."
71        epatch "${DISTDIR}/htdig-${HTDIG_VER}.patch.gz" || die "patch failed."
72        epatch "${DISTDIR}/exitstatus-${EXITSTATUS_VER}.patch.gz" || die "patch failed."
73        epatch "${DISTDIR}/modinc-${MODINC_VER}.patch.gz" || die "patch failed."
74        epatch "${DISTDIR}/antispam-${ANTISPAM_VER}.patch.gz" || die "patch failed."
75        epatch "${DISTDIR}/response-${RESPONSE_VER}.patch.gz" || die "patch failed."
76        epatch "${DISTDIR}/dailymbox-${DAILYMBOX_VER}.patch.gz" || die "patch failed."
[7ee0426]77}
78
[da4656d]79src_configure() {
[7ee0426]80        econf --without-permcheck \
81                --prefix="${INSTALLDIR}" \
82                --with-mail-gid=${MAILGID} \
83                --with-cgi-gid=${CGIGID} \
84                --with-cgi-ext="${MAILMAN_CGIEXT}" \
85                --with-var-prefix="${VAR_PREFIX}" \
86                --with-username=${MAILUSR} \
87                --with-groupname=${MAILGRP} \
[da4656d]88                --with-python=$(PYTHON -2 -a) \
[7ee0426]89        || die "configure failed"
[da4656d]90}
[7ee0426]91
[da4656d]92src_compile() {
[7ee0426]93        emake || die "make failed"
94}
95
96src_install () {
97        emake "DESTDIR=${D}" doinstall || die
98
99        insinto /etc/apache2/modules.d
[da4656d]100        newins "${FILESDIR}/50_mailman.conf-r2" 50_mailman.conf
101        sed -i "s:/usr/local/mailman/cgi-bin:${INSTALLDIR}/cgi-bin:g" "${D}/etc/apache2/modules.d/50_mailman.conf"
102        sed -i "s:/usr/local/mailman/icons:${INSTALLDIR}/icons:g" "${D}/etc/apache2/modules.d/50_mailman.conf"
103        sed -i "s:/usr/local/mailman/archives:${VAR_PREFIX}/archives:g" "${D}/etc/apache2/modules.d/50_mailman.conf"
[7ee0426]104
105        newdoc "${FILESDIR}/README.gentoo-r3" README.gentoo || die "newdoc failed"
106
[2dba70d]107        dodoc ACK* BUGS FAQ NEWS README* TODO UPGRADING INSTALL contrib/mailman.mc \
[7ee0426]108                contrib/README.check_perms_grsecurity contrib/virtusertable || die "dodoc failed"
109
110        exeinto ${INSTALLDIR}/bin
111        doexe build/contrib/*.py contrib/majordomo2mailman.pl contrib/auto \
112                contrib/mm-handler* || die
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}
121        do
122                if [ -f ${i}/Mailman/mm_cfg.py ] && ! [ -L ${i}/Mailman/mm_cfg.py ]; then
123                        cp ${i}/Mailman/mm_cfg.py "${D}/etc/mailman/mm_cfg.py"
124                fi
125        done
126
127        newinitd "${FILESDIR}/mailman.rc" mailman
[da4656d]128        cp "${FILESDIR}/mailman.service" "${T}/mailman.service" || die
129        sed -i "s/^User=.*/User=${MAILUSR}/" "${T}/mailman.service" || die
130        systemd_dounit "${T}/mailman.service"
[7ee0426]131
132        keepdir ${VAR_PREFIX}/logs
133        keepdir ${VAR_PREFIX}/locks
134        keepdir ${VAR_PREFIX}/spam
135        keepdir ${VAR_PREFIX}/archives/public
136        keepdir ${VAR_PREFIX}/archives/private
137        keepdir ${VAR_PREFIX}/lists
138        keepdir ${VAR_PREFIX}/qfiles
139
140        chown -R ${MAILUSR}:${MAILGRP} "${D}/${VAR_PREFIX}" "${D}/${INSTALLDIR}" "${D}"/etc/mailman/*
141        chown ${CGIUID}:${MAILGRP} "${D}/${VAR_PREFIX}/archives/private"
142        chmod 2775 "${D}/${INSTALLDIR}" "${D}/${INSTALLDIR}"/templates/* \
143                "${D}/${INSTALLDIR}"/messages/* "${D}/${VAR_PREFIX}" "${D}/${VAR_PREFIX}"/{logs,lists,spam,locks,archives/public}
144        chmod 2770 "${D}/${VAR_PREFIX}/archives/private"
145        chmod 2770 "${D}/${VAR_PREFIX}/qfiles"
146        chmod 2755 "${D}/${INSTALLDIR}"/cgi-bin/* "${D}/${INSTALLDIR}/mail/mailman"
147
148}
149
150pkg_postinst() {
151        python_mod_optimize ${INSTALLDIR}/bin/ ${INSTALLDIR}/Mailman \
152                ${INSTALLDIR}/Mailman/*/
153
154        enewgroup ${MAILGRP} ${MAILGID}
[2dba70d]155        enewuser  ${MAILUSR} ${MAILUID} -1 ${INSTALLDIR} mailman,cron
[7ee0426]156        elog
157        elog "Please read /usr/share/doc/${PF}/README.gentoo.bz2 for additional"
158        elog "Setup information, mailman will NOT run unless you follow"
159        elog "those instructions!"
160        elog
161
162        elog "An example Mailman configuration file for Apache has been installed into:"
163        elog "  ${APACHE2_MODULES_CONFDIR}/50_mailman.conf"
164        elog
165        elog "To enable, you will need to add \"-D MAILMAN\" to"
166        elog "/etc/conf.d/apache2."
167        elog
168
169        ewarn "Default-Configuration has changed deeply in 2.1.9-r2. You can configure"
170        ewarn "mailman with the following variables:"
171        ewarn "MAILMAN_PREFIX (default: /usr/$(get_libdir)/mailman)"
172        ewarn "MAILMAN_VAR_PREFIX (default: /var/lib/mailman)"
173        ewarn "MAILMAN_CGIUID (default: apache)"
174        ewarn "MAILMAN_CGIGID (default: apache)"
175        ewarn "MAILMAN_CGIEXT (default: empty)"
176        ewarn "MAILMAN_MAILUSR (default: mailman)"
177        ewarn "MAILMAN_MAILUID (default: 280)"
178        ewarn "MAILMAN_MAILGRP (default: mailman)"
179        ewarn "MAILMAN_MAILGID (default: 280)"
180        ewarn
181        ewarn "Config file is now symlinked in /etc/mailman, so etc-update works."
182        ewarn
183        ewarn "If you're upgrading from below 2.1.9-r2 or changed MAILMAN_PREFIX, you"
184        ewarn "NEED to make a few manual updates to your system:"
185        ewarn
186        ewarn "1.  Update your mailman users's home directory: usermod -d ${INSTALLDIR} mailman"
187        ewarn "2.  Re-import the crontab: su - mailman -c 'crontab cron/crontab.in'"
188        ewarn "3.  Copy your old mm_cfg.py file to /etc/mailman/mm_cfg.py"
189        ewarn
190        ewarn "Additionally if you've modified MAILMAN_VAR_PREFIX (or upgraded from"
191        ewarn "a pre 2.1.9-r2 installation), you should move your old lists/ and"
192        ewarn "archives/ directory to the new location, ensuring that the"
193        ewarn "permissions is correct.  See bug #208789 for a discussion."
194}
195
196pkg_postrm() {
197        INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
198        python_mod_cleanup ${INSTALLDIR}/bin ${INSTALLDIR}/Mailman \
199                ${INSTALLDIR}/Mailman/*/
200}
Note: See TracBrowser for help on using the repository browser.