<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[129347] trunk/dports/mail/sympa</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/129347">129347</a></dd>
<dt>Author</dt> <dd>devans@macports.org</dd>
<dt>Date</dt> <dd>2014-12-10 13:22:06 -0800 (Wed, 10 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>sympa: address various configuration and dependency issues (#46134, #46135):
* add variants +sqlite, +postgresql to load dependencies for these databases if desired
* otherwise load dependencies for MySQL
* drop the direct dependency on mysql5 and rely on p5-dbd-mysql variant to select the specific version
* actual database selection and configuration is handled in sympa.conf
* update configuration options and dependencies
* correct destroot processing
* correct startup item specification
* install apache2 configuration file conf/extra/html-sympa.conf to aid setup
* defer creation of default configuration files to post-activate
* only create default configuration files in post-activate if none already exists
* amplify setup procedure in notes</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsmailsympaPortfile">trunk/dports/mail/sympa/Portfile</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/dports/mail/sympa/files/</li>
<li><a href="#trunkdportsmailsympafileshttpdsympaconf">trunk/dports/mail/sympa/files/httpd-sympa.conf</a></li>
<li><a href="#trunkdportsmailsympafilespatchsrcetcscriptsympaindiff">trunk/dports/mail/sympa/files/patch-src-etc-script-sympa.in.diff</a></li>
<li><a href="#trunkdportsmailsympafilespatchsrclibconfdefpmdiff">trunk/dports/mail/sympa/files/patch-src-lib-confdef.pm.diff</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsmailsympaPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/mail/sympa/Portfile (129346 => 129347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/mail/sympa/Portfile        2014-12-10 20:50:46 UTC (rev 129346)
+++ trunk/dports/mail/sympa/Portfile        2014-12-10 21:22:06 UTC (rev 129347)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx">
</span><span class="cx"> name sympa
</span><span class="cx"> version 6.1.23
</span><ins>+revision 1
</ins><span class="cx"> set branch [join [lrange [split ${version} .] 0 1] .]
</span><span class="cx"> categories mail
</span><span class="cx"> license GPL-2
</span><span class="lines">@@ -25,8 +26,7 @@
</span><span class="cx"> checksums rmd160 0c65549bc01e154081554a7d9ff8bb11db1d0ccc \
</span><span class="cx"> sha256 3d15aa8816dafcc4017cc06e52def44d5461498a05e9ef7634498b0993234ae4
</span><span class="cx">
</span><del>-depends_lib path:bin/mysql_config5:mysql5 \
- port:apache2 \
</del><ins>+depends_lib port:apache2 \
</ins><span class="cx"> port:mod_fcgid \
</span><span class="cx"> port:openssl \
</span><span class="cx"> port:postfix \
</span><span class="lines">@@ -37,9 +37,9 @@
</span><span class="cx"> port:p5.16-crypt-ciphersaber \
</span><span class="cx"> port:p5.16-crypt-openssl-x509 \
</span><span class="cx"> port:p5.16-data-password \
</span><del>- port:p5.16-dbd-mysql \
</del><span class="cx"> port:p5.16-dbi \
</span><span class="cx"> port:p5.16-digest-md5 \
</span><ins>+ port:p5.16-fcgi \
</ins><span class="cx"> port:p5.16-file-copy-recursive \
</span><span class="cx"> port:p5.16-html-format \
</span><span class="cx"> port:p5.16-html-stripscripts-parser \
</span><span class="lines">@@ -66,38 +66,122 @@
</span><span class="cx"> port:p5.16-unicode-linebreak \
</span><span class="cx"> port:p5.16-xml-libxml
</span><span class="cx">
</span><ins>+pre-patch {
+ copy ${filespath}/httpd-sympa.conf ${worksrcpath}
+}
+
+patchfiles patch-src-etc-script-sympa.in.diff \
+ patch-src-lib-confdef.pm.diff
+
+post-patch {
+ reinplace "s|__MP_PREFIX__|${prefix}|" \
+ ${worksrcpath}/httpd-sympa.conf \
+ ${worksrcpath}/src/lib/confdef.pm
+}
+
</ins><span class="cx"> configure.args --with-perl=${prefix}/bin/perl5.16 \
</span><span class="cx"> --with-user=www \
</span><span class="cx"> --with-group=www \
</span><span class="cx"> --enable-fhs \
</span><del>- --with-aliases_file=${prefix}/etc/${name}/sympa_aliases \
- --with-newaliases=${prefix}/bin/newaliases \
- --with-postmap=${prefix}/sbin/postmap
</del><ins>+ --sysconfdir=${prefix}/etc/${name} \
+ --with-cgidir=${prefix}/www/${name}/cgi \
+ --with-staticdir=${prefix}/www/${name}/static_content \
+ --with-aliases_file=${prefix}/etc/${name}/sympa_aliases
</ins><span class="cx">
</span><del>-# Create a startupitem to start/stop the server
-startupitem.create yes
-startupitem.start "${prefix}/share/${name}/sympa"
-startupitem.stop "${prefix}/share/${name}/sympa"
</del><ins>+# Create a startupitem to start/stop/restart the server processes
</ins><span class="cx">
</span><ins>+startupitem.create yes
+startupitem.start "${prefix}/etc/sympa/rc.d/init.d/sympa start"
+startupitem.stop "${prefix}/etc/sympa/rc.d/init.d/sympa stop"
+startupitem.restart "${prefix}/etc/sympa/rc.d/init.d/sympa restart"
+startupitem.pidfile auto ${prefix}/var/run/${name}/${name}.pid
+
+# Apache2 conf/extra directory violates mtree
+
+destroot.violate_mtree yes
+
+# Keep these empty directories
+
+destroot.keepdirs ${destroot}${prefix}/var/lib/${name}/arc \
+ ${destroot}${prefix}/var/lib/${name}/bounce \
+ ${destroot}${prefix}/var/lib/${name}/list_data \
+ ${destroot}${prefix}/var/lock/subsys \
+ ${destroot}${prefix}/var/log/${name} \
+ ${destroot}${prefix}/var/run/${name} \
+ ${destroot}${prefix}/var/spool/${name}
+
</ins><span class="cx"> post-destroot {
</span><span class="cx"> xinstall -m 644 ${worksrcpath}/INSTALL ${destroot}${prefix}/share/doc/${name}
</span><ins>+ xinstall -d ${destroot}${prefix}/apache2/conf/extra
+ xinstall -m 644 ${worksrcpath}/httpd-sympa.conf ${destroot}${prefix}/apache2/conf/extra
+ delete ${destroot}${prefix}/etc/sympa/sympa.conf ${destroot}${prefix}/etc/sympa/wwsympa.conf
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+variant postgresql description {Install optional dependencies for PostgreSQL database support} {
+ depends_lib-append \
+ port:p5.16-dbd-pg
+}
+
+variant sqlite description {Install optional dependencies for SQLite version 3 database support} {
+ depends_lib-append \
+ port:p5.16-dbd-sqlite
+}
+
+# if neither postgresql nor sqlite selected default to mysql
+
+if {![variant_isset postgresql] && ![variant_isset sqlite]} {
+ depends_lib-append \
+ port:p5.16-dbd-mysql
+}
+
+post-activate {
+
+# create default configuration files if they don't already exist
+
+ foreach cfile "sympa.conf wwsympa.conf" {
+ if {![file exists ${prefix}/etc/sympa/${cfile}]} {
+ system "${prefix}/sbin/sympa_wizard.pl --create ${cfile}"
+ }
+ }
+}
+
</ins><span class="cx"> notes "
</span><del>-You can find documentation at:
</del><ins>+You can find the reference documentation at:
</ins><span class="cx"> http://www.sympa.org/manual_${branch}/index
</span><span class="cx">
</span><span class="cx"> Check that you have all the required perl modules:
</span><del>- ${prefix}/sbin/sympa_wizard.pl --check
</del><ins>+ $ ${prefix}/sbin/sympa_wizard.pl --check
</ins><span class="cx">
</span><span class="cx"> First installation:
</span><span class="cx"> Check the INSTALL file:
</span><span class="cx"> ${prefix}/share/doc/sympa/INSTALL
</span><del>- Run the wizard to define some required parameters that can't be guessed:
- ${prefix}/sbin/sympa_wizard.pl
</del><ins>+ Run the wizard to customize the default configuration files
+ $ sudo ${prefix}/sbin/sympa_wizard.pl
+ Create the sympa database and tables using the script for your database at
+ ${prefix}/share/sympa/bin/create_db.*
+ For example, if using MySQL, the appropriate command is
+ $ mysql -u root -p < ${prefix}/share/sympa/bin/create_db.mysql
+ Create a database user with access to the sympa database. This should
+ match to the parameters db_name, db_host, db_user and db_passwd
+ in ${prefix}/etc/sympa/sympa.conf.
+ $ mysql -u root -p
+ mysql> CREATE USER 'sympa'@'localhost' IDENTIFIED BY 'my_password';
+ mysql> GRANT ALL ON sympa.* TO 'sympa'@'localhost';
+ mysql> FLUSH PRIVILEGES;
+ mysql> quit
+ Add these lines to the end of ${prefix}/apache2/conf/httpd.conf
+ # Include module mod_fcgid
+ Include conf/extra/httpd-fcgid.conf
+ # Include sympa configuration file
+ Include conf/extra/httpd-sympa.conf
+ You should then restart apache2 to enable mod_fcgid and the sympa web interface
+ $ sudo port unload apache2
+ $ sudo port load apache2
+ Start the sympa daemons now and at startup
+ $ sudo port load sympa
</ins><span class="cx">
</span><del>-Upgrading:
- Run this script to upgrade your data structures:
</del><ins>+Upgrading to a new version:
+ Run this script to upgrade your existing data structures:
</ins><span class="cx"> ${prefix}/sbin/sympa.pl --upgrade
</span><span class="cx"> "
</span><span class="cx">
</span></span></pre></div>
<a id="trunkdportsmailsympafileshttpdsympaconf"></a>
<div class="addfile"><h4>Added: trunk/dports/mail/sympa/files/httpd-sympa.conf (0 => 129347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/mail/sympa/files/httpd-sympa.conf         (rev 0)
+++ trunk/dports/mail/sympa/files/httpd-sympa.conf        2014-12-10 21:22:06 UTC (rev 129347)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Alias /static-sympa __MP_PREFIX__/www/sympa/static_content
+ScriptAlias /sympa __MP_PREFIX__/www/sympa/cgi/wwsympa-wrapper.fcgi
+
+<Directory "__MP_PREFIX__/www/sympa/">
+ AllowOverride None
+ Options None
+ Order allow,deny
+ Allow from all
+</Directory>
+
+<IfModule mod_fcgid.c>
+ AddHandler fcgid-script .fcgi
+</IfModule>
</ins></span></pre></div>
<a id="trunkdportsmailsympafilespatchsrcetcscriptsympaindiff"></a>
<div class="addfile"><h4>Added: trunk/dports/mail/sympa/files/patch-src-etc-script-sympa.in.diff (0 => 129347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/mail/sympa/files/patch-src-etc-script-sympa.in.diff         (rev 0)
+++ trunk/dports/mail/sympa/files/patch-src-etc-script-sympa.in.diff        2014-12-10 21:22:06 UTC (rev 129347)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+--- src/etc/script/sympa.in.orig        2010-11-16 23:25:42.000000000 -0800
++++ src/etc/script/sympa.in        2014-12-09 00:04:38.000000000 -0800
+@@ -33,10 +33,14 @@
+ fi
+
+ # OSTYPE *is* defined on Solaris 10! (bug #3149)
++# OSTYPE has many variants on darwin platforms
+ case "$OSTYPE" in
+ *solaris*)
+ OSTYPE=SunOS
+ ;;
++ *darwin*)
++        OSTYPE=darwin
++ ;;
+ esac
+
+ if [ -f /etc/SuSE-release ] ; then
+@@ -59,8 +63,8 @@
+ sympaconf="--CONFIG--"
+ wwsympaconf="--WWSCONFIG--"
+
+-##'echo -n' not supported with SH on Solaris
+-if [ ${OSTYPE} = "SunOS" ]; then
++##'echo -n' not supported with SH on Solaris or darwin
++if [ "${OSTYPE}" = "SunOS" -o "${OSTYPE}" = "darwin" ]; then
+ echo_opt=""
+ else
+ echo_opt="-n"
+@@ -159,7 +163,7 @@
+         if [ "$pids" != "" ]; then
+          for pid in $pids; do
+                 killcount=0
+-                running=`ps -A | grep "$pid ..* $1\\.pl"`
++                running=`ps -A | grep "$pid.*$1\\.pl"`
+                 while [ "$running" != "" ]; do
+                  if [ $killcount -gt 10 ]; then
+                         if [ ${use_functions} ]; then
+@@ -171,13 +175,13 @@
+                  fi
+
+                  kill -TERM $pid >/dev/null 2>&1
+-                 running=`ps -A | grep "$pid ..* $1\\.pl"`
++                 running=`ps -A | grep "$pid.*$1\\.pl"`
+                  if [ "$running" = "" ]; then
+                         runcount=`expr $runcount + 1`
+                         break
+                  fi
+                  sleep 2
+-                 running=`ps -A | grep "$pid ..* $1\\.pl"`
++                 running=`ps -A | grep "$pid.*$1\\.pl"`
+                  if [ "$running" = "" ]; then
+                         runcount=`expr $runcount + 1`
+                         break
+@@ -204,8 +208,10 @@
+
+
+ # Check that networking is up.
+-if [ ${OSTYPE} != "Slack" -a ${OSTYPE} != "FreeBSD" -a ${OSTYPE} != "SunOS" -a ${OSTYPE} != "darwin7.0" -a ${OSTYPE} != "Debian" -a ${OSTYPE} != "Suse" ]; then
+- if [ ${NETWORKING} = "no" ]
++# NETWORKING is not defined on any darwin platforms
++# Just in case fix 'expected unary operator' error if $NETWORKING is null
++if [ ${OSTYPE} != "Slack" -a ${OSTYPE} != "FreeBSD" -a ${OSTYPE} != "SunOS" -a ${OSTYPE} != "darwin" -a ${OSTYPE} != "Debian" -a ${OSTYPE} != "Suse" ]; then
++ if [ "${NETWORKING}" = "no" ]
+ then
+          exit 0
+ fi
</ins></span></pre></div>
<a id="trunkdportsmailsympafilespatchsrclibconfdefpmdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/mail/sympa/files/patch-src-lib-confdef.pm.diff (0 => 129347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/mail/sympa/files/patch-src-lib-confdef.pm.diff         (rev 0)
+++ trunk/dports/mail/sympa/files/patch-src-lib-confdef.pm.diff        2014-12-10 21:22:06 UTC (rev 129347)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+--- src/lib/confdef.pm.orig        2014-09-10 07:08:55.000000000 -0700
++++ src/lib/confdef.pm        2014-12-10 11:43:03.000000000 -0800
+@@ -459,7 +459,7 @@
+
+ {
+ 'name' => 'sendmail',
+- 'default' => '/usr/sbin/sendmail',
++ 'default' => '__MP_PREFIX__/sbin/sendmail',
+ 'query' => 'Path to the MTA (sendmail, postfix, exim or qmail)',
+ 'file' => 'sympa.conf',
+ 'edit' => '1',
+@@ -1203,7 +1203,7 @@
+
+ {
+ 'name' => 'openssl',
+- 'sample' => '/usr/bin/ssl',
++ 'sample' => '__MP_PREFIX__/bin/openssl',
+ 'query' => 'Path to OpenSSL',
+ 'file' => 'sympa.conf',
+ 'edit' => '1',
+@@ -1221,7 +1221,7 @@
+ },
+ {
+ 'name' => 'cafile',
+- 'sample' => '/usr/local/apache/conf/ssl.crt/ca-bundle.crt',
++ 'sample' => '/__MP_PREFIX__/apache2/conf/ssl.crt/ca-bundle.crt',
+ 'query' => 'File containing bundled trusted CA certificates',
+ 'file' => 'sympa.conf',
+ 'edit' => '1',
+@@ -1481,7 +1481,7 @@
+ },
+ {
+ 'name' => 'mhonarc',
+- 'default' => '/usr/bin/mhonarc',
++ 'default' => '__MP_PREFIX__/bin/mhonarc',
+ 'query' => 'Path to MHonArc mail2html plugin',
+ 'file' => 'wwsympa.conf',
+ 'edit' => '1',
</ins></span></pre>
</div>
</div>
</body>
</html>