summaryrefslogtreecommitdiff
path: root/net-mail/sympa/files
diff options
context:
space:
mode:
authorMarcin Deranek <gringo@slonko.net>2016-12-04 21:41:45 +0100
committerMarcin Deranek <gringo@slonko.net>2016-12-04 21:42:09 +0100
commite49e93e882bbc004c4576416afebd5ca6058e170 (patch)
tree1487952de3a37b29f5f4eadb018152fa5afaf4aa /net-mail/sympa/files
parent01a2a669b6a70e587523fdbcd6fe19ecdcf2e0c1 (diff)
downloadportage-e49e93e882bbc004c4576416afebd5ca6058e170.tar.gz
portage-e49e93e882bbc004c4576416afebd5ca6058e170.tar.bz2
portage-e49e93e882bbc004c4576416afebd5ca6058e170.zip
Initial ebuild for Sympa 6.2
Diffstat (limited to 'net-mail/sympa/files')
-rw-r--r--net-mail/sympa/files/sympa-6.2.initd57
-rw-r--r--net-mail/sympa/files/sympa-6.2.sqlite.upgrade.patch20
2 files changed, 77 insertions, 0 deletions
diff --git a/net-mail/sympa/files/sympa-6.2.initd b/net-mail/sympa/files/sympa-6.2.initd
new file mode 100644
index 0000000..ebb3215
--- /dev/null
+++ b/net-mail/sympa/files/sympa-6.2.initd
@@ -0,0 +1,57 @@
+#!/sbin/openrc-run
+
+sympaconf="/etc/sympa/sympa.conf"
+wwsympaconf="/etc/sympa/wwsympa.conf"
+data_structure="/etc/sympa/data_structure.version"
+sympadir="/usr"
+rundir="/var/run/sympa"
+
+depend() {
+ use logger mysql postgres ldap
+ before apache apache2 lighttpd
+}
+
+sympa_start() {
+ ebegin "Starting Sympa module $1.pl: "
+ start-stop-daemon --start --quiet --pidfile "${rundir}"/$1.pid --exec ${sympadir}/sbin/$1.pl
+ eend $?
+}
+
+sympa_stop() {
+ if [ -f "${rundir}"/$1.pid ]; then
+ ebegin "Stopping Sympa module $1.pl: "
+ start-stop-daemon --stop --retry 30 --quiet --pidfile "${rundir}"/$1.pid
+ eend $?
+ fi
+}
+
+start() {
+ if [ ! -f "${data_structure}" ]; then
+ eerror "Please run 'sympa.pl --upgrade' first"
+ return 1
+ fi
+ # Check config files
+ if [ ! -f "${sympaconf}" ]; then
+ eerror "Missing Sympa config (${sympaconf})"
+ return 2
+ fi
+ if [ ! -f "${wwsympaconf}" ]; then
+ eerror "Missing WWSympa config (${wwsympaconf})"
+ return 3
+ fi
+ echo "Starting Sympa subsystems: "
+ sympa_start sympa_msg
+ sympa_start bulk
+ sympa_start archived
+ sympa_start bounced
+ sympa_start task_manager
+}
+
+stop(){
+ echo "Stopping Sympa subsystems: "
+ sympa_stop task_manager
+ sympa_stop bounced
+ sympa_stop archived
+ sympa_stop bulk
+ sympa_stop sympa_msg
+}
diff --git a/net-mail/sympa/files/sympa-6.2.sqlite.upgrade.patch b/net-mail/sympa/files/sympa-6.2.sqlite.upgrade.patch
new file mode 100644
index 0000000..e1ea6d8
--- /dev/null
+++ b/net-mail/sympa/files/sympa-6.2.sqlite.upgrade.patch
@@ -0,0 +1,20 @@
+--- src/lib/Sympa/DatabaseDriver/SQLite.pm.old 2016-01-06 11:18:57.000000000 +0100
++++ src/lib/Sympa/DatabaseDriver/SQLite.pm 2016-12-04 17:03:15.872560407 +0100
+@@ -455,7 +455,7 @@
+ $param->{'index'}, $param->{'table'});
+
+ my $sth;
+- unless ($sth = $self->do_query(q{DROP INDEX "%s"}, $param->{'index'})) {
++ unless ($sth = $self->do_query(q{DROP INDEX IF EXISTS "%s"}, $param->{'index'})) {
+ $log->syslog('err',
+ 'Could not drop index %s from table %s in database %s',
+ $param->{'index'}, $param->{'table'}, $self->{'db_name'});
+@@ -806,7 +806,7 @@
+ } elsif ($r) {
+ return $r;
+ } else {
+- unless ($self->do_query(q{DROP TABLE "%s"}, $table)) {
++ unless ($self->do_query(q{DROP TABLE IF EXISTS "%s"}, $table)) {
+ $log->syslog('err', 'Could not drop table "%s"', $table);
+ return undef;
+ }