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

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

Make stable in arm and bump

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

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