mailman via WBM

This commit is contained in:
tengel 2024-03-20 09:19:02 -05:00
parent 9b127ecf84
commit 30253b7861

View file

@ -0,0 +1,425 @@
# These macros will not assume an apache RPM
# The place where mailman binaries go.
%define mmdir /var/mailman
# The place where mutable data goes.
%define varmmdir /var/mailman
# Now, the user and group the CGIs will expect to be run under. This should
# match the user and group the web server is configured to run as. The scripts
# will error out if they are invoked by any other user.
%define cgiuser nobody
%define cgiuserid 99
%define cgigroup nobody
%define cgigroupid 99
# Now, the user and group the scripts will actually execute as.
%define mmuser mail
%define mmuserid 8
%define mmgroup mail
%define mmgroupid 12
# Directory/File modes & permissions
%define dirmode 2775
%define exemode 2755
# Now, the groups your mail spoolers run as. Sendmail uses 'mail'(12)
# and postfix uses 'nobody'(99).
%define mailgroup "mail nobody"
%define mailgid "12 99"
# The mail wrapper program
%define mail_wrapper mailman
Summary: Mailing list manager with built in Web access.
Name: mailman
Version: 2.1.1
Release: 2
Epoch: 1
Group: Applications/Internet
Source0: ftp://ftp.gnu.org/pub/gnu/mailman/mailman-%{version}.tgz
Source1: mm_cfg.py
Source2: mailman-README.REDHAT
Source3: httpd-mailman.conf
Source4: mailman.logrotate
Patch0: mailman-2.1-syntax-error.patch
Patch1: mailman-2.1-permissions.patch
License: GPL
URL: http://www.list.org/
BuildRoot: %{_tmppath}/%{name}-root
Prereq: shadow-utils, /usr/bin/crontab, /sbin/chkconfig, /sbin/service
Requires: mktemp
Packager: Troy Engel <tengel@sonic.net>
%description
Mailman is software to help manage email discussion lists, much like
Majordomo and Smartmail. Unlike most similar products, Mailman gives
each mailing list a webpage, and allows users to subscribe,
unsubscribe, etc. over the Web. Even the list manager can administer
his or her list entirely from the Web. Mailman also integrates most
things people want to do with mailing lists, including archiving, mail
<-> news gateways, and so on.
When the package has finished installing, you will need to:
* Run %{mmdir}/bin/mmsitepass to set the mailman administrator password.
* Edit %{mmdir}/Mailman/mm_cfg.py to configure Mailman for your site.
* update Mailman list files to new verson by running: %{mmdir}/bin/update
* install the %{mmdir}/cron/crontab.in contents to your mail user crontab
* As of mailman version 2.1 mailman requires a service (daemon) to be
run for mailman to operate. RedHat does not ship RPM's that enable
services as part of package installation. You will need to enable
the mailman service if you want mailman to run.
To enable the mailman service after package installation you may run
the "serviceconf" GUI tool, or you may do the following on the
command line as root.
/sbin/service mailman start
To have the mailman service automatically start at certain run
levels (replace the runlevel below with your desired run levels, for
example to start mailman at run levels 3 and 5 runlevel would be 35:
/sbin/service --level runlevel mailman on
Users upgrading from previous releases of this package may need to
move their data or adjust the configuration files to point to the
locations where their data is.
%prep
%setup -q
%patch0 -p1 -b .syntax
%patch1 -p1 -b .permissions
cp $RPM_SOURCE_DIR/mailman-README.REDHAT README.REDHAT
aclocal
autoconf
%build
# Override the RPM macro for older RH7.x. Not graceful, but works.
MYPYTHON=%{__python}
if [ -f /usr/bin/python2 ]; then
MYPYTHON=/usr/bin/python2
fi
CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
MAILHOST=localhost.localdomain \
URLHOST=localhost.localdomain \
MAILMAN_UID=%{mmuserid} \
MAILMAN_GID=%{mmgroupid} \
MAIL_GID=%{mailgid} \
CGI_UID=%{cgiuserid} \
CGI_GID=%{cgigroupid} \
./configure \
--prefix=%{mmdir} \
--with-var-prefix=%{varmmdir} \
--with-python=$MYPYTHON \
--with-username=%{mmuser} \
--with-groupname=%{mmgroup} \
--with-mail-gid=%{mailgroup} \
--with-cgi-id=%{cgiuser} \
--with-cgi-gid=%{cgigroup} \
--with-mailhost=localhost.localdomain \
--with-urlhost=localhost.localdomain \
--without-permcheck
cp %{SOURCE1} Mailman/mm_cfg.py.dist
make
%install
rm -fr $RPM_BUILD_ROOT
# Normal install.
make install prefix=$RPM_BUILD_ROOT%{mmdir} var_prefix=$RPM_BUILD_ROOT%{varmmdir}
# Create directories we'll use for log and spool files.
install -m775 -d $RPM_BUILD_ROOT/var/log/mailman
install -m775 -d $RPM_BUILD_ROOT/var/spool/mailman/qfiles
# Install the mailman init.d script
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install $RPM_BUILD_ROOT%{mmdir}/scripts/mailman $RPM_BUILD_ROOT/etc/init.d/mailman
# Create a link to the wrapper in /etc/smrsh to allow sendmail to run it.
mkdir -p $RPM_BUILD_ROOT/etc/smrsh
ln -s ../..%{mmdir}/mail/%{mail_wrapper} $RPM_BUILD_ROOT/etc/smrsh
# Install a logrotate control file.
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m644 $RPM_SOURCE_DIR/mailman.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/mailman
# Install the httpd configuration file.
install -m755 -d $RPM_BUILD_ROOT%{mmdir}/www
install -m644 /dev/null $RPM_BUILD_ROOT%{mmdir}/www/httpd-mailman.conf
sed -e 's|@VARMMDIR@|%{varmmdir}|g' -e 's|@MMDIR@|%{mmdir}|g' \
$RPM_SOURCE_DIR/httpd-mailman.conf > \
$RPM_BUILD_ROOT%{mmdir}/www/httpd-mailman.conf
# The file fblast confuses /usr/lib/rpm/find-requires because its an executable
# script file that does not have the interpreter as the first line, its not
# executable by itself so turn off its execute permissions
chmod 0644 $RPM_BUILD_ROOT/%{mmdir}/tests/fblast.py
# Remove this, we don't want to overwrite a site's config. Address in post
rm -f $RPM_BUILD_ROOT%{mmdir}/Mailman/mm_cfg.py
%clean
rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/files.%{name}
%post
# Clean out any byte-compiled python modules and recompile them.
find %{mmdir} -name "*.pyc" -exec rm -f '{}' ';'
%{__python} -c 'from compileall import *; compile_dir("%{mmdir}",10,"%{mmdir}")' > /dev/null 2>&1
# add core aliases for the mailman subsystem
if ! grep -q "mailman-owner" /etc/aliases 2> /dev/null ; then
cat >> /etc/aliases << EOF
# mailman aliases
mailman: postmaster
mailman-owner: mailman
EOF
/usr/bin/newaliases > /dev/null 2>&1 || :
fi
# This adds the proper /etc/rc*.d links for the script that runs the mailman qrunner daemon
chkconfig --add mailman
# copy the default config over if needed (protect upgrades)
if [ ! -f %{mmdir}/Mailman/mm_cfg.py ]; then
cp -f %{mmdir}/Mailman/mm_cfg.py.dist %{mmdir}/Mailman/mm_cfg.py
fi
%preun
# if [ $1 = 0 ]' checks that this is the actual deinstallation of
# the package, as opposed to just removing the old package on upgrade.
if [ $1 = 0 ]; then
# These statements stop the service, and remove the /etc/rc*.d links.
/sbin/service mailman stop >/dev/null 2>&1
/sbin/chkconfig --del mailman
fi
%postun
if [ "$1" -ge "1" ]; then
# if [ "$1" -ge "1" ] checks that this is an upgrade of the package.
# If so, restart the service if it's running.
/sbin/service mailman restart >/dev/null 2>&1
fi
if [ $1 = 0 ]; then
crontab -u %{mmuser} -r
TMPFILE=`mktemp /etc/aliasesXXXXXX`
if test -n "$TMPFILE" ; then
egrep -E -v 'mailman aliases|mailman:|mailman-owner:' /etc/aliases >${TMPFILE}
mv ${TMPFILE} /etc/aliases
fi
/usr/bin/newaliases > /dev/null 2>&1 || :
# remove compiled python files
find %{mmdir} -name "*.pyc" -exec rm -f '{}' ';'
fi
%files
%doc %attr(-,root,root) ACKNOWLEDGMENTS BUGS FAQ gnu-COPYING-GPL INSTALL NEWS README README.CONTRIB README.EXIM README-I18N.en README.LINUX README.NETSCAPE README.POSTFIX README.QMAIL README.REDHAT README.SENDMAIL README.USERAGENT TODO UPGRADING
%defattr(-,root,%{mmgroup})
%{mmdir}
/etc/logrotate.d/mailman
/etc/smrsh/%{mail_wrapper}
%attr(2775,root,%{mmgroup}) /var/log/mailman
%attr(2775,root,%{mmgroup}) /var/spool/mailman
%attr(0755 root root) /etc/init.d/mailman
%changelog
* Fri Mar 7 2003 Troy Engel <tengel@sonic.net> 2.1.1-2
- added --with-mailhost and --with-urlhost set to localhost.localdomain
- update mm_cfg.py to have DEFAULT_EMAIL_HOST and DEFAULT_URL_HOST
- add some logic to protect mm_cfg.py on upgrades (proper way would
be to mark it config/noreplace, but that would now involve building
a whole filelist)
* Fri Mar 7 2003 Troy Engel <tengel@sonic.net> 2.1.1-1
- upgraded to 2.1.1
- make webserver agnostic (leave icons in mailman dir, remove 'webserver'
dependancy, user nobody, etc). A webserver is not *required*
- change user/group to mail.mail -- exim, postfix and sendmail all seem
to use this. Using 'mailman' has caused me nothing but problems
- remove config, multimail, and xss patches
- update mm_cfg.py
- remove newaliases requirement -- MTAs like Exim don't require futzing
with /etc/aliases for each list
- move sample apache config to %{mmdir}/www/
- check for /usr/bin/python2 and pass that to ./configure if found
- added a doc section in the filelist
- removed automatic crontab insertion, added to post-install instructions
* Fri Jan 31 2003 John Dennis <jdennis@finch.boston.redhat.com>
- various small tweaks to the spec file to make installation cleaner
- use %{__python} when compiling, redirect compile output to /dev/null,
- don't run update in %post, let the user do it, remove the .pyc files in %postun,
- add setting of MAILHOST and URLHOST to localhost.localdomain, don't let
- configure set them to the build machine.
* Mon Jan 27 2003 John Dennis <jdennis@finch.boston.redhat.com>
- add the cross site scripting (xss) security patch to version 2.1
* Fri Jan 24 2003 John Dennis <jdennis@finch.boston.redhat.com>
- do not start mailman service in %post
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt
* Mon Jan 20 2003 John Dennis <jdennis@finch.boston.redhat.com>
- 1) remove config patch, mailmanctl was not the right file to install in init.d,
- it needed to be scripts/mailman
- 2) rename httpd-mailman.conf to mailman.conf, since the file now lives
- in httpd/conf.d directory the http prefix is redundant and inconsistent
- with the other file names in that directory.
* Tue Jan 7 2003 John Dennis <jdennis@finch.boston.redhat.com>
- Bring package up to date with current upstream source, 2.1
- Fix several install/packaging problems that were in upstream source
- Add multiple mail group functionality
- Fix syntax error in fblast.py
- Remove the forced setting of mail host and url host in mm_cfg.py
* Tue Nov 12 2002 Tim Powers <timp@redhat.com> 2.0.13-4
- remove files from $$RPM_BUILD_ROOT that we don't intent to ship
* Thu Aug 14 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.13-3
- set MAILHOST and WWWHOST in case the configure script can't figure out the
local host name
* Fri Aug 2 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.13-2
- rebuild
* Fri Aug 2 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.13-1
- specify log files individually, per faq wizard
- update to 2.0.13
* Wed May 22 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.11-1
- update to 2.0.11
* Fri Apr 5 2002 Nalin Dahyabhai <nalin@redhat.com> 2.0.9-1
- include README.QMAIL in with the docs (#58887)
- include README.SENDMAIL and README.EXIM in with the docs
- use an included httpd.conf file instead of listing the configuration
directives in the %%description, which due to specspo magic might look
wrong sometimes (part of #51324)
- interpolate the DEFAULT_HOST_NAME value in mm.cfg into both the DEFAULT_URL
and MAILMAN_OWNER (#57987)
- move logs to /var/log/mailman, qfiles to /var/spool/mailman, rotate
logs in the log directory (#48724)
- raise exceptions when someone tries to set the admin address for a list
to that of the admin alias (#61468)
* Thu Apr 4 2002 Nalin Dahyabhai <nalin@redhat.com>
- fix a default permissions problem in %{_var}/mailman/archives/private,
reported by Johannes Erdfelt
- update to 2.0.9
* Tue Apr 2 2002 Nalin Dahyabhai <nalin@redhat.com>
- make the symlink in /etc/smrsh relative
* Tue Dec 11 2001 Nalin Dahyabhai <nalin@redhat.com> 2.0.8-1
- set FQDN and URL at build-time so that they won't be set to the host the
RPM package is built on (#59177)
* Wed Nov 28 2001 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.0.8
* Sat Nov 17 2001 Florian La Roche <Florian.LaRoche@redhat.de> 2.0.7-1
- update to 2.0.7
* Wed Jul 25 2001 Nalin Dahyabhai <nalin@redhat.com> 2.0.6-1
- update to 2.0.6
* Mon Jun 25 2001 Nalin Dahyabhai <nalin@redhat.com>
- code in default user/group names/IDs
* Wed May 30 2001 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.0.5
- change the default hostname from localhost to localhost.localdomain in the
default configuration
- chuck configuration file settings other than those dependent on the host name
(the build system's host name is not a good default) (#32337)
* Tue Mar 13 2001 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.0.3
* Tue Mar 6 2001 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.0.2
* Wed Feb 21 2001 Nalin Dahyabhai <nalin@redhat.com>
- patch from Barry Warsaw (via mailman-developers) to not die on
broken Content-Type: headers
* Tue Jan 9 2001 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.0.1
* Wed Dec 6 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to 2.0 final release
- move the data to %{_var}
* Fri Oct 20 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to beta 6
* Thu Aug 3 2000 Nalin Dahyabhai <nalin@redhat.com>
- add note about adding FollowSymlinks so that archives work
* Wed Aug 2 2000 Nalin Dahyabhai <nalin@redhat.com>
- make the default owner root again so that root owns the docs
- update to 2.0beta5, which fixes a possible security vulnerability
- add smrsh symlink
* Mon Jul 24 2000 Prospector <prospector@redhat.com>
- rebuilt
* Wed Jul 19 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to beta4
- change uid/gid to apache.apache to match apache (#13593)
- properly recompile byte-compiled versions of the scripts (#13619)
- change mailman alias from root to postmaster
* Sat Jul 1 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to beta3
- drop bugs and arch patches (integrated into beta3)
* Tue Jun 27 2000 Nalin Dahyabhai <nalin@redhat.com>
- move web files to reside under %{contentdir}
- move files from /usr/share to %{_datadir}
- integrate spot-fixes from mailman lists via gnome.org
* Mon Jun 19 2000 Nalin Dahyabhai <nalin@redhat.com>
- rebuild for Power Tools
* Wed May 23 2000 Nalin Dahyabhai <nalin@redhat.com>
- Update to 2.0beta2 to pick up security fixes.
- Change equires python to list >= 1.5.2
* Mon Nov 8 1999 Bernhard Rosenkränzer <bero@redhat.com>
- 1.1
* Tue Sep 14 1999 Preston Brown <pbrown@redhat.com>
- 1.0 final.
* Tue Jun 15 1999 Preston Brown <pbrown@redhat.com>
- security fix for cookies
- moved to /usr/share/mailman
* Fri May 28 1999 Preston Brown <pbrown@redhat.com>
- fix up default values.
* Fri May 07 1999 Preston Brown <pbrown@redhat.com>
- modifications to install scripts
* Thu May 06 1999 Preston Brown <pbrown@redhat.com>
- initial RPM for SWS 3.0