Репозиторий Sisyphus
Последнее обновление: 11 июля 2020 | Пакетов: 17700 | Посещений: 18864916
en ru br
Репозитории ALT
S:2.1.33.0.4.0f97-alt1
5.1: 2.1.12-alt2
4.1: 2.1.10-alt0.3.1.M41.1
4.0: 2.1.9-alt6.M40.1
3.0: 2.1.6-alt1
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: mailman

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

# Need to fix
# Bugs:
# 815297 Breaking signatures in message/rfc822 attachement!
Name: mailman
Version: 2.1.9
Release: alt6.M40.1
Epoch: 5
Packager: Grigory Batalov <bga at altlinux.ru>

%define mm_user %name
%define mm_group %name

%define contentdir /var/www
%define httpdconfdir %_sysconfdir/httpd/conf/addon-modules.d
%define crontabdir %_sysconfdir/cron.d
%define logrotate %_sysconfdir/logrotate.d

%define _prefix /usr/share/%name
%define _exec_prefix %_libdir/%name
%define _var_prefix %_localstatedir/%name

Summary: Mailing list manager with built in web access
License: GPL
Group: System/Servers
Url: http://www.list.org/

# http://prdownloads.sourceforge.net/%name/%name-%version.tar.tgz

Source: %name-%version.tar.gz
Source1: mm_cfg.py
Source2: README.ALT
Source3: %name-httpd.conf
Source4: %name.logrotate
Source5: mailman-2.1.9-deb-manpages.tar.gz
Source7: mailman-ftt0.3.po
Source8: mailman-2.1.9-alt-mm_config.py

Patch1: email-2.5.6-alt-charset.patch
Patch2: email-2.5.7-mdv-charset.patch
Patch3: mailman-2.1.9-alt-ru_po.patch
Patch4: mailman-2.1.9-alt-init.patch
Patch5: mailman-2.1.9-alt-cron.patch
Patch6: mailman-2.1.9-alt-rm_pidfile.patch
Patch7: mailman-2.1.9-alt-filterwarnings.patch
Patch8: mailman-2.1.9-alt-groupfile.patch
Patch9: mailman-2.1.9-alt-permissions.patch
Patch10: mailman-2.1.9-alt-fix_bounce.patch
Patch11: mailman-2.1.9-alt-postfix_maps.patch
Patch12: mailman-2.1.9-alt-update.patch

# CVE-2008-0564 fix provided by Mark Shapiro

# see: https://bugzilla.redhat.com/show_bug.cgi?id=431526
Patch13: mailman-2.1.9-CVE-2008-0564.patch

# SuSE patches

Patch15: mailman-2.1.2-suse-list_lists.patch

# RedHat patches

Patch20: mailman-2.1-rh-build.patch
Patch21: mailman-2.1-rh-mailmanctl-status.patch
Patch23: mailman-2.1.5-rh-FHS.patch
Patch25: mailman-2.1.5-rh-python-compile.patch

#conflicts patch35 (fix_file_permissions)

Patch29: mailman-2.1.9-rh-LC_CTYPE.patch

# Patch36: mailman-deb-omni.patch

# was splited into Debian patches:

# 15_mailmanctl_daemonize.patch

# 67_update_handle_old_versions.patch
# 21_newlist_help.patch
# 52_check_perms_lstat.patch
# 30_pipermail_threads.patch (updated!)
# 79_archiver_slash.patch (1st part)
# 74_admin_non-ascii_emails.patch
# 80_fix_string_search.patch
# 32_MIME_fixup.patch
# 07_snooze.patch
# 59_fix_missing_language_crash.patch
# 66_donot_let_cache_html_pages.patch
# 62_new_list_bad_pending_requests.patch
# 79_archiver_slash.patch (2nd part)
# 56_fix_de_broken_links.patch
# 58_fix_es_translation.patch
### ru.po patch absents in Debian! find the recent one ###
# 11_handle_propfind.patch
# 61_fix_ru_siteowner.patch

# Debian patches

# old ALT name: mailman-deb-from_head.patch
Patch40: mailman-2.1.9-deb-00_stolen_from_HEAD.patch
#Patch41: mailman-2.1.9-deb-01_defaults.debian.patch
Patch42: mailman-2.1.9-deb-07_snooze.patch
#Patch43: mailman-2.1.9-deb-10_wrapper_uid.patch
Patch44: mailman-2.1.9-deb-11_handle_propfind.patch
Patch45: mailman-2.1.9-deb-15_mailmanctl_daemonize.patch
Patch46: mailman-2.1.9-deb-16_update_debian.patch
Patch47: mailman-2.1.9-deb-20_qmail_to_mailman.debian.patch
#Patch48: mailman-2.1.9-deb-21_newlist_help.patch
Patch49: mailman-2.1.9-deb-30_pipermail_threads.patch
Patch50: mailman-2.1.9-deb-32_MIME_fixup.patch
#Patch51: mailman-2.1.9-deb-51_nocompile.pyc.patch
Patch52: mailman-2.1.9-deb-52_check_perms_lstat.patch
Patch53: mailman-2.1.9-deb-53_disable_addons.patch
Patch54: mailman-2.1.9-deb-56_fix_de_broken_links.patch
Patch55: mailman-2.1.9-deb-58_fix_es_translation.patch
Patch56: mailman-2.1.9-deb-59_fix_missing_language_crash.patch
Patch57: mailman-2.1.9-deb-61_fix_ru_siteowner.patch
Patch58: mailman-2.1.9-deb-62_new_list_bad_pending_requests.patch
Patch59: mailman-2.1.9-deb-63_update_default_server_language.patch
Patch60: mailman-2.1.9-deb-64_correct_html_nesting.patch
Patch61: mailman-2.1.9-deb-65_handle_templates_directories.patch
Patch62: mailman-2.1.9-deb-66_donot_let_cache_html_pages.patch
Patch63: mailman-2.1.9-deb-67_update_handle_old_versions.patch
# old ALT name: mailman-CVE-invalid_utf8_dos.patch
Patch64: mailman-2.1.9-deb-70_invalid_utf8_dos.patch
# old ALT name: mailman-alt-date_overflows.patch
Patch65: mailman-2.1.9-deb-71_date_overflows.patch
Patch66: mailman-2.1.9-deb-72_fblast_add_shebang.patch
Patch67: mailman-2.1.9-deb-74_admin_non-ascii_emails.patch
Patch68: mailman-2.1.9-deb-77_header_folding_in_attachments.patch
Patch69: mailman-2.1.9-deb-78_DeprecationWarning.patch
Patch70: mailman-2.1.9-deb-79_archiver_slash.patch
Patch71: mailman-2.1.9-deb-80_fix_string_search.patch
Patch72: mailman-2.1.9-deb-99_js_templates.patch


PreReq: mktemp, setup, shadow-utils, sendmail-common, vixie-cron
Requires: webserver, python = %__python_version
BuildRequires: python-devel = %__python_version

BuildRequires(pre): python
AutoProv: yes, nopython

%add_python_req_skip Defaults Mailman mm_config
%define _python_compile_include %_datadir/%name

%description
Mailman, the GNU Mailing List Management System, is a mailing list
management system written mostly in Python. Features:
- Web based list administration for nearly all tasks.  Web based            
 subscriptions and user configuration management.  A customizable          
 "home page" for each mailing list.                                        
- Privacy features such as moderation, open and closed list                
 subscription policies, private membership rosters, and                    
 sender-based filters.                                                    
- Automatic web based archiving built-in with support for private          
 and public archives, and hooks for external archivers.                    
- Per-user configuration optional digest delivery for either                
 MIME-compliant or RFC 1153 style "plain text" digests.                    
- Integrated mail/Usenet gateways.                                          
- Integrated auto-replies.                                                  
- Majordomo-style email based commands.                                    
- Integrated bounce detection within an extensible framework.              
- Integrated spam detection, and MIME-based content filtering.              
- An extensible mail delivery pipeline.                                    
- Support for virtual domains.                                              

See the Mailman home site for current status, including new releases
and known problems: %url

%package docs
Group: System/Servers
Summary: Mailing list manager with built in web access


%description docs
Documentation for mailman


%prep
%setup -q -a 5
%__install -pD -m644 %SOURCE1 Mailman/mm_cfg.py.dist.in
%__install -pD -m644 %SOURCE2 README.ALT

pushd misc
tar xfz email-*.tar.gz
cd email-*/
%patch1 -p1
%patch2 -p1
popd
%patch3 -p2
# patch4 see below
# because of mailmanctl patch
%patch5 -p2
%patch6 -p2
%patch7 -p2
%patch8 -p2
%patch9 -p0
%patch10 -p2
%patch11 -p2
%patch12 -p2
%patch13 -p0
sed -i -e 's, at LOCKFILE at ,%_lockdir/%name/master-qrunner,g' cron/crontab.in.in

# workaround for different Russian locales

mkdir -p messages/{ru_RU.cp1251,ru_RU.utf}/LC_MESSAGES
# convert default KOI8-R into CP1251
iconv -fkoi8-r -tcp1251 messages/ru/LC_MESSAGES/mailman.po > \
messages/ru_RU.cp1251/LC_MESSAGES/mailman.po
# and into UTF-8
iconv -fkoi8-r -tutf8 messages/ru/LC_MESSAGES/mailman.po > \
messages/ru_RU.utf/LC_MESSAGES/mailman.po
# replace encoding
sed -i -e 's,charset=koi8-r,charset=cp1251,' messages/ru_RU.cp1251/LC_MESSAGES/mailman.po
sed -i -e 's,charset=koi8-r,charset=utf-8,' messages/ru_RU.utf/LC_MESSAGES/mailman.po
# include ru_RU.cp1251 and ru_RU.utf in distribution
sed -i -e 's,ro ru sl,ro ru ru_RU.cp1251 ru_RU.utf sl,' messages/Makefile.in
# remove missing file references
sed -i -e '/^bin\/.svn.*/d' -e '/^cron\/.svn.*/d' messages/docstring.files

# SuSE patches

%patch15 -p0
# RedHat patches
%patch20 -p1
%patch21 -p1
%patch23 -p1
%patch25 -p1

%patch4 -p0

#conflicts with patch35 (fix_file_permissions)

#%patch29 -p1

# Debian patches

%patch40 -p0
%patch42 -p0
%patch44 -p0
%patch45 -p0
%patch46 -p0
%patch47 -p0
%patch49 -p0
%patch50 -p0
%patch52 -p0
%patch53 -p0
%patch54 -p0
%patch55 -p0
%patch56 -p0
%patch57 -p0
%patch58 -p0
%patch59 -p0
%patch60 -p0
%patch61 -p0
%patch62 -p0
%patch63 -p0
%patch64 -p0
%patch65 -p0
%patch66 -p0
%patch67 -p0
%patch68 -p0
%patch69 -p0
%patch70 -p0
%patch71 -p0
%patch72 -p0

touch src/*.c

%build
autoreconf -fisv
%configure \
--with-var-prefix=%_var_prefix \
--with-config-dir=%_sysconfdir/%name \
--with-lock-dir=%_lockdir/%name \
--with-log-dir=%_logdir/%name \
--with-pid-dir=%_var/run/%name \
--with-queue-dir=%_spooldir/%name \
--with-python=%__python \
--with-mail-groupfile=%_sysconfdir/%name/mail.groups \
--with-cgi-groupfile=%_sysconfdir/%name/cgi.groups \
--with-mailhost=localhost.localdomain \
--with-urlhost=localhost.localdomain \
--without-permcheck

# rebuild mailman.pot

%make -C messages potfile

%make_build OPT="$RPM_OPT_FLAGS"

%install
find bin -type f -print0 |
xargs -r0 %__grep -Zl '%__python$' |
xargs -r0 %__subst 's|%__python$|%__python -O|g'

%make_install doinstall \
DESTDIR=$RPM_BUILD_ROOT \
prefix=%prefix \
exec_prefix=%_exec_prefix \
var_prefix=%_var_prefix

chmod -R go-w $RPM_BUILD_ROOT{%prefix,%_exec_prefix}
find $RPM_BUILD_ROOT{%prefix,%_exec_prefix} -type d -print0 |
xargs -r0 chmod a-s,o-r
chmod a-s,go-r $RPM_BUILD_ROOT%_var_prefix

# Create directories we'll use for log and spool files. Create links

%__install -d -m2771 $RPM_BUILD_ROOT%_logdir/%name
%__install -d -m2770 $RPM_BUILD_ROOT%_spooldir/%name
%__install -d -m2771 $RPM_BUILD_ROOT%_spooldir/%name/{archive,bounces,commands,in,news,out,qfiles,retry,shunt,virgin}

ln -s ../../log/%name $RPM_BUILD_ROOT%_var_prefix/logs
ln -s ../../spool/%name $RPM_BUILD_ROOT%_var_prefix/qfiles

# Copy an icons into the web server's icons directory.

%__mkdir_p $RPM_BUILD_ROOT%contentdir
%__mv $RPM_BUILD_ROOT%prefix/icons $RPM_BUILD_ROOT%contentdir/

# Install a logrotate control file.

%__install -pD -m644 %SOURCE4 \
$RPM_BUILD_ROOT%logrotate/%name

# Install the httpd configuration file.

%__install -pD -m644 /dev/null $RPM_BUILD_ROOT%httpdconfdir/%name.conf
%__sed -e 's| at CODEDIR at |%_exec_prefix|g;s| at DATADIR at |%_var_prefix|g' \
%SOURCE3 > $RPM_BUILD_ROOT%httpdconfdir/%name.conf

# Install crontab file

install -pD -m644 cron/crontab.in $RPM_BUILD_ROOT%crontabdir/%name

# Install init script

install -pD -m755 misc/mailman $RPM_BUILD_ROOT%_initdir/%name

# Install config files for postfix

%__install -pD -m644 %SOURCE8 $RPM_BUILD_ROOT%_sysconfdir/%name/mm_config.py
%__install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/%name/aliases
%__install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/%name/virtual-mailman
%__install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/%name/aliases.db
%__install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/%name/virtual-mailman.db
install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/%name/aliases.cdb
install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/%name/virtual-mailman.cdb

cat <<EOF > $RPM_BUILD_ROOT%_sysconfdir/%name/mail.groups
mail
postman
%mm_group
EOF

cat <<EOF > $RPM_BUILD_ROOT%_sysconfdir/%name/cgi.groups
apache
EOF

# Install man pages

install -m755 -pd $RPM_BUILD_ROOT%_man8dir
install -m644 manpages/*.8 $RPM_BUILD_ROOT%_man8dir/

# Install lockdir and piddir

install -m755 -pd $RPM_BUILD_ROOT%_lockdir/%name
install -m755 -pd $RPM_BUILD_ROOT%_var/run/%name

# Remove unused files

%__rm -f $RPM_BUILD_ROOT%_sysconfdir/%name/sitelist.cfg
%__rm -rf $RPM_BUILD_ROOT%_datadir/%name/tests

%pre
/usr/sbin/groupadd -rf %mm_group ||:
/usr/sbin/useradd -M -r -s /dev/null -c "GNU Mailing List Manager" \
-d %_var_prefix -g %mm_group %mm_user &>/dev/null ||:

%post
%post_service mailman
# Fix file premissions
if [ -f %_localstatedir/%name/data/last_mailman_version ]; then
chown %mm_user:%mm_group %_localstatedir/%name/data/last_mailman_version ||:
chmod 644 %_localstatedir/%name/data/last_mailman_version ||:
echo "Update mailman's database:"
%_prefix/bin/update ||:
else
%_prefix/bin/update &> /dev/null ||:
fi

%preun
%preun_service mailman

%triggerin -- postfix
# Generate aliases
%_prefix/bin/genaliases

%triggerun -- mailman < 5:2.1.9-alt2
if [ $1 != 0 ]; then
# Move old configs and passwords and change group
for file in aliases virtual-mailman mm_config.py; do
if [ -f %_localstatedir/%name/etc/$file ]; then
mv %_localstatedir/%name/etc/$file %_sysconfdir/%name/$file ||:
chgrp %mm_group %_sysconfdir/%name/$file ||:
fi
done
for file in adm.pw creator.pw; do
if [ -f %_localstatedir/%name/data/$file ]; then
mv %_localstatedir/%name/data/$file %_sysconfdir/%name/$file ||:
chgrp %mm_group %_sysconfdir/%name/$file ||:
fi
done
# Change paths in Postfix config
if [ -f %_sysconfdir/postfix/main.cf ]; then
sed  -i -e 's,%_localstatedir/%name/etc/aliases,%_sysconfdir/%name/aliases,g' \
-e 's,%_localstatedir/%name/etc/virtual-mailman,%_sysconfdir/%name/virtual-mailman,g' \
%_sysconfdir/postfix/main.cf ||:
fi
# Move lockfiles and pidfile
for file in %_localstatedir/%name/locks/*; do
[ -f $file ] && mv $file %_lockdir/%name/ ||:
done
[ -f %_localstatedir/%name/data/master-qrunner.pid ] && \
mv -f %_localstatedir/%name/data/master-qrunner.pid %_var/run/%name/ ||:
fi
# Restart mailman again with configs at the new place
%post_service mailman


%files
%config(noreplace) %logrotate/%name
%config(noreplace) %httpdconfdir/%name.conf
%config(noreplace) %crontabdir/%name
%attr(0755,root,root) %_initdir/%name
%contentdir/icons/*
%dir %prefix
%prefix/bin
%prefix/cron
%prefix/Mailman
%prefix/messages
%prefix/pythonlib
%prefix/scripts
%prefix/templates
%doc ACKNOWLEDGMENTS BUGS FAQ INSTALL NEWS README* STYLEGUIDE.txt TODO UPGRADING
%doc misc/sitelist.cfg tests
%doc %_man8dir/*
%dir %attr(0770,root,%mm_group) %_lockdir/%name
%dir %attr(0770,root,%mm_group) %_var/run/%name

%defattr(-,root,%mm_group,-)
%_exec_prefix
%dir %attr(0751,root,%mm_group) %_var_prefix
%dir %_var_prefix/archives
%dir %_var_prefix/archives/*
%dir %_var_prefix/spam
%dir %_var_prefix/lists
%dir %_var_prefix/data
%dir %attr(2771,root,%mm_group) %_sysconfdir/%name
%config(noreplace) %attr(0664,root,%mm_group) %_sysconfdir/%name/mm_config.*
%config(noreplace) %attr(0664,root,%mm_group) %_sysconfdir/%name/aliases
%config(noreplace) %attr(0664,root,%mm_group) %_sysconfdir/%name/virtual-mailman
%config(noreplace) %attr(0664,root,%mm_group) %_sysconfdir/%name/mail.groups
%config(noreplace) %attr(0664,root,%mm_group) %_sysconfdir/%name/cgi.groups
%ghost %_sysconfdir/%name/aliases.db
%ghost %_sysconfdir/%name/virtual-mailman.db
%ghost %_sysconfdir/%name/aliases.cdb
%ghost %_sysconfdir/%name/virtual-mailman.cdb
%_var_prefix/logs
%_var_prefix/qfiles
%_logdir/%name
%dir %_spooldir/%name
%dir %_spooldir/%name/*

%files docs
%doc admin/www doc


%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin