source: trunk/dports/mail/sympa/Portfile

Last change on this file was 151848, checked in by mojca@…, 15 months ago

sympa: switch to perl5.24 (#52081)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.6 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 151848 2016-08-23 12:19:43Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           perl5 1.0
6
7name                sympa
8version             6.1.23
9revision            5
10set branch          [join [lrange [split ${version} .] 0 1] .]
11perl5.branches      5.24
12categories          mail
13license             GPL-2
14maintainers         nomaintainer
15platforms           darwin
16
17description         Sympa - Mailing List Manager with LDAP support
18
19long_description    An advanced perl-based mail list manager with a web interface \
20                    that supports LDAP authentication and LDAP extraction of \
21                    list subscribers and owners.
22
23homepage            http://www.sympa.org
24
25master_sites        http://www.sympa.org/distribution/ \
26                    http://www.sympa.org/distribution/old/
27
28checksums           rmd160  0c65549bc01e154081554a7d9ff8bb11db1d0ccc \
29                    sha256  3d15aa8816dafcc4017cc06e52def44d5461498a05e9ef7634498b0993234ae4
30
31depends_lib         port:apache2 \
32                    port:mod_fcgid \
33                    path:lib/libssl.dylib:openssl \
34                    port:postfix \
35                    port:p${perl5.major}-archive-zip \
36                    port:p${perl5.major}-authcas \
37                    port:p${perl5.major}-cgi \
38                    port:p${perl5.major}-cgi-fast \
39                    port:p${perl5.major}-crypt-ciphersaber \
40                    port:p${perl5.major}-crypt-openssl-x509 \
41                    port:p${perl5.major}-data-password \
42                    port:p${perl5.major}-dbi \
43                    port:p${perl5.major}-digest-md5 \
44                    port:p${perl5.major}-fcgi \
45                    port:p${perl5.major}-file-copy-recursive \
46                    port:p${perl5.major}-html-formatter \
47                    port:p${perl5.major}-html-stripscripts-parser \
48                    port:p${perl5.major}-html-tree \
49                    port:p${perl5.major}-io-stringy \
50                    port:p${perl5.major}-io-socket-ssl \
51                    port:p${perl5.major}-libintl-perl \
52                    port:p${perl5.major}-libwww-perl \
53                    port:p${perl5.major}-mailtools \
54                    port:p${perl5.major}-mail-dkim \
55                    port:p${perl5.major}-mhonarc \
56                    port:p${perl5.major}-mime-base64 \
57                    port:p${perl5.major}-mime-charset \
58                    port:p${perl5.major}-mime-encwords \
59                    port:p${perl5.major}-mime-lite-html \
60                    port:p${perl5.major}-mime-tools \
61                    port:p${perl5.major}-net-dns \
62                    port:p${perl5.major}-net-netmask \
63                    port:p${perl5.major}-perl-ldap \
64                    port:p${perl5.major}-soap-lite \
65                    port:p${perl5.major}-template-toolkit \
66                    port:p${perl5.major}-term-progressbar \
67                    port:p${perl5.major}-time-hires \
68                    port:p${perl5.major}-unicode-linebreak \
69                    port:p${perl5.major}-xml-libxml
70
71pre-patch {
72    copy ${filespath}/httpd-sympa.conf ${worksrcpath}
73}
74
75patchfiles          patch-src-etc-script-sympa.in.diff \
76                    patch-src-lib-confdef.pm.diff
77
78post-patch {
79    reinplace "s|__MP_PREFIX__|${prefix}|" \
80                    ${worksrcpath}/httpd-sympa.conf \
81                    ${worksrcpath}/src/lib/confdef.pm
82}
83
84configure.args      --with-perl=${perl5.bin} \
85                    --with-user=www \
86                    --with-group=www \
87                    --enable-fhs \
88                    --sysconfdir=${prefix}/etc/${name} \
89                    --with-cgidir=${prefix}/www/${name}/cgi \
90                    --with-staticdir=${prefix}/www/${name}/static_content \
91                    --with-aliases_file=${prefix}/etc/${name}/sympa_aliases
92
93# Create a startupitem to start/stop/restart the server processes
94
95startupitem.create  yes
96startupitem.start   "${prefix}/etc/sympa/rc.d/init.d/sympa start"
97startupitem.stop    "${prefix}/etc/sympa/rc.d/init.d/sympa stop"
98startupitem.restart "${prefix}/etc/sympa/rc.d/init.d/sympa restart"
99startupitem.pidfile auto ${prefix}/var/run/${name}/${name}.pid
100
101# Apache2 conf/extra directory violates mtree
102
103destroot.violate_mtree yes
104
105# Keep these empty directories
106
107destroot.keepdirs   ${destroot}${prefix}/var/lib/${name}/arc \
108                    ${destroot}${prefix}/var/lib/${name}/bounce \
109                    ${destroot}${prefix}/var/lib/${name}/list_data \
110                    ${destroot}${prefix}/var/lock/subsys \
111                    ${destroot}${prefix}/var/log/${name} \
112                    ${destroot}${prefix}/var/run/${name} \
113                    ${destroot}${prefix}/var/spool/${name}
114
115post-destroot {
116    xinstall -m 644 ${worksrcpath}/INSTALL ${destroot}${prefix}/share/doc/${name}
117    xinstall -d ${destroot}${prefix}/apache2/conf/extra
118    xinstall -m 644 ${worksrcpath}/httpd-sympa.conf ${destroot}${prefix}/apache2/conf/extra
119    delete  ${destroot}${prefix}/etc/sympa/sympa.conf ${destroot}${prefix}/etc/sympa/wwsympa.conf
120}
121
122variant postgresql description {Install optional dependencies for PostgreSQL database support} {
123    depends_lib-append \
124                    port:p${perl5.major}-dbd-pg
125}
126
127variant sqlite description {Install optional dependencies for SQLite version 3 database support} {
128    depends_lib-append \
129                    port:p${perl5.major}-dbd-sqlite
130}
131
132# if neither postgresql nor sqlite selected default to mysql
133
134if {![variant_isset postgresql] && ![variant_isset sqlite]} {
135    depends_lib-append \
136                    port:p${perl5.major}-dbd-mysql
137}
138
139post-activate {
140
141#   create default configuration files if they don't already exist
142
143    foreach cfile "sympa.conf wwsympa.conf" {
144        if {![file exists ${prefix}/etc/sympa/${cfile}]} {
145            system "${prefix}/sbin/sympa_wizard.pl --create ${cfile}"
146        }
147    }
148}
149
150notes "
151You can find the reference documentation at:
152    http://www.sympa.org/manual_${branch}/index
153
154Check that you have all the required perl modules:
155    $ ${prefix}/sbin/sympa_wizard.pl --check
156
157First installation:
158    Check the INSTALL file:
159        ${prefix}/share/doc/sympa/INSTALL
160    Run the wizard to customize the default configuration files
161        $ sudo ${prefix}/sbin/sympa_wizard.pl
162    Create the sympa database and tables using the script for your database at
163        ${prefix}/share/sympa/bin/create_db.*
164    For example, if using MySQL, the appropriate command is
165        $ mysql -u root -p  < ${prefix}/share/sympa/bin/create_db.mysql
166    Create a database user with access to the sympa database. This should
167    match to the parameters db_name, db_host, db_user and db_passwd
168    in ${prefix}/etc/sympa/sympa.conf.
169        $ mysql -u root -p
170        mysql> CREATE USER 'sympa'@'localhost' IDENTIFIED BY 'my_password';
171        mysql> GRANT ALL ON sympa.* TO 'sympa'@'localhost';
172        mysql> FLUSH PRIVILEGES;
173        mysql> quit
174    Add these lines to the end of ${prefix}/apache2/conf/httpd.conf
175        # Include module mod_fcgid
176        Include conf/extra/httpd-fcgid.conf
177        # Include sympa configuration file
178        Include conf/extra/httpd-sympa.conf
179    You should then restart apache2 to enable mod_fcgid and the sympa web interface
180        $ sudo port unload apache2
181        $ sudo port load apache2
182    Start the sympa daemons now and at startup
183        $ sudo port load sympa
184
185Upgrading to a new version:
186    Run this script to upgrade your existing data structures:
187        ${prefix}/sbin/sympa.pl --upgrade
188"
189
190livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.