commit 112e0d0a2b8e1db7e75ceca1e12078a44581894e Author: Daniel Berteaud Date: Mon Jun 18 22:33:49 2012 +0200 Premier commit diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..3ff579a --- /dev/null +++ b/createlinks @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); + +safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/mailman'); +safe_symlink("/var/service/mailman" , 'root/service/mailman'); +safe_touch("root/var/service/mailman/down"); + +foreach my $event (qw/webapps-update ipasserelle-update bootstrap-ldap-save/){ + event_link("ipasserelle-mailman-init-domain", "$event", "55"); +} + diff --git a/ipasserelle-listes.spec b/ipasserelle-listes.spec new file mode 100644 index 0000000..e6c44c1 --- /dev/null +++ b/ipasserelle-listes.spec @@ -0,0 +1,56 @@ +%define version 0.2.0 +%define release 1 +%define name ipasserelle-listes + +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +Summary: iPasserelle mailing list module +Group: System Environment/Applications +License: GPLv3+ +URL: http://www.ipasserelle.com +Source0: %{name}-%{version}.tar.gz + +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot + +BuildRequires: e-smith-devtools + +Requires: ipasserelle-base +Requires: smeserver-mailman + +%description +iPasserelle module for the mailing list service +Uses smeserver-mailman + +%changelog +* Mon Jun 18 2012 Daniel Berteaud - 0.2.0 +- Import in GIT + +* Thu Sep 12 2011 Daniel Berteaud - 0.1-1.sme +- Initial release + +%prep +%setup -q + +%build +perl ./createlinks + +%install +rm -rf $RPM_BUILD_ROOT +rm -f %{name}-%{version}-filelist +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/sbin/e-smith/genfilelist \ + --file /var/service/mailman/qrunner 'attr(0755,root,root)' \ + --file /var/service/mailman/run 'attr(0755,root,root)' \ + $RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist + +%files -f %{name}-%{version}-%{release}-filelist + +%clean +rm -rf $RPM_BUILD_ROOT + +%post + +%postun + + diff --git a/root/etc/e-smith/events/actions/ipasserelle-mailman-init-domain b/root/etc/e-smith/events/actions/ipasserelle-mailman-init-domain new file mode 100644 index 0000000..b40e9ab --- /dev/null +++ b/root/etc/e-smith/events/actions/ipasserelle-mailman-init-domain @@ -0,0 +1,47 @@ +#!/usr/bin/perl -w +#---------------------------------------------------------------------- +# copyright (C) 2010-2011 Firewall-Services +# daniel@firewall-services.com +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +#---------------------------------------------------------------------- + +use strict; +use warnings; +use esmith::DomainsDB; +use esmith::ConfigDB; + +my $d = esmith::DomainsDB->open or die "Couldn't open DomainsDB\n"; +my $c = esmith::ConfigDB->open_ro() or die "Couldn't open ConfigDB\n"; + +my $domain = $c->get('DomainName')->value; +my $vhost; + +$vhost = $d->get("listes.$domain"); + +if (!$vhost){ + $d->new_record("listes.$domain",{ + type => 'domain', + Content => 'Primary', + Description => "Mailinglist", + Nameservers => 'internet', + }); + + unless ( system("/sbin/e-smith/signal-event", "domain-create", "listes.$domain") == 0 ){ + die "Failed to create domain listes.$domain\n"; + } +} + diff --git a/root/etc/e-smith/templates/usr/lib/mailman/Mailman/mm_cfg.py/15Language b/root/etc/e-smith/templates/usr/lib/mailman/Mailman/mm_cfg.py/15Language new file mode 100644 index 0000000..d637bbd --- /dev/null +++ b/root/etc/e-smith/templates/usr/lib/mailman/Mailman/mm_cfg.py/15Language @@ -0,0 +1 @@ +DEFAULT_SERVER_LANGUAGE = '{$mailman{'Language'} || 'fr'}' diff --git a/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/060mailman b/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/060mailman new file mode 100644 index 0000000..4eb05f6 --- /dev/null +++ b/root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/060mailman @@ -0,0 +1,18 @@ +{ + +$conf->{'applicationList'}->{'010apps'}->{'mailman'} = { + 'options' => { + 'logo' => 'mailappt.png', + 'name' => 'Mailman', + 'description' => 'Liste de diffusion', + 'uri' => "http://listes.$domain/mailman", + 'display' => 'on' + }, + 'type' => 'application' +} unless ($conf->{'applicationList'}->{'010apps'}->{'mailman'}); + + +$OUT = ''; + +} + diff --git a/root/var/service/mailman/qrunner b/root/var/service/mailman/qrunner new file mode 100644 index 0000000..4d0d1f7 --- /dev/null +++ b/root/var/service/mailman/qrunner @@ -0,0 +1,7 @@ +#!/bin/sh + +while `/bin/true`; do + /usr/lib/mailman/bin/qrunner --runner=All --once + sleep 10 +done + diff --git a/root/var/service/mailman/run b/root/var/service/mailman/run new file mode 100644 index 0000000..04a5f42 --- /dev/null +++ b/root/var/service/mailman/run @@ -0,0 +1,3 @@ +#!/bin/sh +exec setuidgid mailman ./qrunner +