Changeset 129347 for trunk/dports/mail


Ignore:
Timestamp:
Dec 10, 2014, 9:22:06 PM (5 years ago)
Author:
devans@…
Message:

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
Location:
trunk/dports/mail/sympa
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/mail/sympa/Portfile

    r129087 r129347  
    66name                sympa
    77version             6.1.23
     8revision            1
    89set branch          [join [lrange [split ${version} .] 0 1] .]
    910categories          mail
     
    2627                    sha256  3d15aa8816dafcc4017cc06e52def44d5461498a05e9ef7634498b0993234ae4
    2728
    28 depends_lib         path:bin/mysql_config5:mysql5 \
    29                     port:apache2 \
     29depends_lib         port:apache2 \
    3030                    port:mod_fcgid \
    3131                    port:openssl \
     
    3838                    port:p5.16-crypt-openssl-x509 \
    3939                    port:p5.16-data-password \
    40                     port:p5.16-dbd-mysql \
    4140                    port:p5.16-dbi \
    4241                    port:p5.16-digest-md5 \
     42                    port:p5.16-fcgi \
    4343                    port:p5.16-file-copy-recursive \
    4444                    port:p5.16-html-format \
     
    6767                    port:p5.16-xml-libxml
    6868
     69pre-patch {
     70    copy ${filespath}/httpd-sympa.conf ${worksrcpath}
     71}
     72
     73patchfiles          patch-src-etc-script-sympa.in.diff \
     74                    patch-src-lib-confdef.pm.diff
     75
     76post-patch {
     77    reinplace "s|__MP_PREFIX__|${prefix}|" \
     78                    ${worksrcpath}/httpd-sympa.conf \
     79                    ${worksrcpath}/src/lib/confdef.pm
     80}
     81
    6982configure.args      --with-perl=${prefix}/bin/perl5.16 \
    7083                    --with-user=www \
    7184                    --with-group=www \
    7285                    --enable-fhs \
    73                     --with-aliases_file=${prefix}/etc/${name}/sympa_aliases \
    74                     --with-newaliases=${prefix}/bin/newaliases \
    75                     --with-postmap=${prefix}/sbin/postmap
     86                    --sysconfdir=${prefix}/etc/${name} \
     87                    --with-cgidir=${prefix}/www/${name}/cgi \
     88                    --with-staticdir=${prefix}/www/${name}/static_content \
     89                    --with-aliases_file=${prefix}/etc/${name}/sympa_aliases
    7690
    77 # Create a startupitem to start/stop the server
    78 startupitem.create    yes
    79 startupitem.start    "${prefix}/share/${name}/sympa"
    80 startupitem.stop     "${prefix}/share/${name}/sympa"
     91# Create a startupitem to start/stop/restart the server processes
     92
     93startupitem.create  yes
     94startupitem.start   "${prefix}/etc/sympa/rc.d/init.d/sympa start"
     95startupitem.stop    "${prefix}/etc/sympa/rc.d/init.d/sympa stop"
     96startupitem.restart "${prefix}/etc/sympa/rc.d/init.d/sympa restart"
     97startupitem.pidfile auto ${prefix}/var/run/${name}/${name}.pid
     98
     99# Apache2 conf/extra directory violates mtree
     100
     101destroot.violate_mtree yes
     102
     103# Keep these empty directories
     104
     105destroot.keepdirs   ${destroot}${prefix}/var/lib/${name}/arc \
     106                    ${destroot}${prefix}/var/lib/${name}/bounce \
     107                    ${destroot}${prefix}/var/lib/${name}/list_data \
     108                    ${destroot}${prefix}/var/lock/subsys \
     109                    ${destroot}${prefix}/var/log/${name} \
     110                    ${destroot}${prefix}/var/run/${name} \
     111                    ${destroot}${prefix}/var/spool/${name}
    81112
    82113post-destroot {
    83114    xinstall -m 644 ${worksrcpath}/INSTALL ${destroot}${prefix}/share/doc/${name}
     115    xinstall -d ${destroot}${prefix}/apache2/conf/extra
     116    xinstall -m 644 ${worksrcpath}/httpd-sympa.conf ${destroot}${prefix}/apache2/conf/extra
     117    delete  ${destroot}${prefix}/etc/sympa/sympa.conf ${destroot}${prefix}/etc/sympa/wwsympa.conf
     118}
     119
     120variant postgresql description {Install optional dependencies for PostgreSQL database support} {
     121    depends_lib-append \
     122                    port:p5.16-dbd-pg
     123}
     124
     125variant sqlite description {Install optional dependencies for SQLite version 3 database support} {
     126    depends_lib-append \
     127                    port:p5.16-dbd-sqlite
     128}
     129
     130# if neither postgresql nor sqlite selected default to mysql
     131
     132if {![variant_isset postgresql] && ![variant_isset sqlite]} {
     133    depends_lib-append \
     134                    port:p5.16-dbd-mysql
     135}
     136
     137post-activate {
     138
     139#   create default configuration files if they don't already exist
     140
     141    foreach cfile "sympa.conf wwsympa.conf" {
     142        if {![file exists ${prefix}/etc/sympa/${cfile}]} {
     143            system "${prefix}/sbin/sympa_wizard.pl --create ${cfile}"
     144        }
     145    }
    84146}
    85147
    86148notes "
    87 You can find documentation at:
     149You can find the reference documentation at:
    88150    http://www.sympa.org/manual_${branch}/index
    89151
    90152Check that you have all the required perl modules:
    91     ${prefix}/sbin/sympa_wizard.pl --check
     153    $ ${prefix}/sbin/sympa_wizard.pl --check
    92154
    93155First installation:
    94156    Check the INSTALL file:
    95157        ${prefix}/share/doc/sympa/INSTALL
    96     Run the wizard to define some required parameters that can't be guessed:
    97         ${prefix}/sbin/sympa_wizard.pl
     158    Run the wizard to customize the default configuration files
     159        $ sudo ${prefix}/sbin/sympa_wizard.pl
     160    Create the sympa database and tables using the script for your database at
     161        ${prefix}/share/sympa/bin/create_db.*
     162    For example, if using MySQL, the appropriate command is
     163        $ mysql -u root -p  < ${prefix}/share/sympa/bin/create_db.mysql
     164    Create a database user with access to the sympa database. This should
     165    match to the parameters db_name, db_host, db_user and db_passwd
     166    in ${prefix}/etc/sympa/sympa.conf.
     167        $ mysql -u root -p
     168        mysql> CREATE USER 'sympa'@'localhost' IDENTIFIED BY 'my_password';
     169        mysql> GRANT ALL ON sympa.* TO 'sympa'@'localhost';
     170        mysql> FLUSH PRIVILEGES;
     171        mysql> quit
     172    Add these lines to the end of ${prefix}/apache2/conf/httpd.conf
     173        # Include module mod_fcgid
     174        Include conf/extra/httpd-fcgid.conf
     175        # Include sympa configuration file
     176        Include conf/extra/httpd-sympa.conf
     177    You should then restart apache2 to enable mod_fcgid and the sympa web interface
     178        $ sudo port unload apache2
     179        $ sudo port load apache2
     180    Start the sympa daemons now and at startup
     181        $ sudo port load sympa
    98182
    99 Upgrading:
    100     Run this script to upgrade your data structures:
     183Upgrading to a new version:
     184    Run this script to upgrade your existing data structures:
    101185        ${prefix}/sbin/sympa.pl --upgrade
    102186"
Note: See TracChangeset for help on using the changeset viewer.