source: trunk/dports/mail/sympa/Portfile @ 125738

Last change on this file since 125738 was 125738, checked in by mf2k@…, 4 years ago

adodb argus-monitor base blt cacti cdpr doclifter eventlog expect gkrellm honeyd iwidgets kchmviewer libdnsres monarch moodss moomps nagios nagios-plugins nedi netmrg network-weathermap nfdump nfsen nrg nrpe nsca ntop p5-archive-zip p5-cgi p5-cgi-speedycgi p5-convert-asn1 p5-libintl-perl p5-mhonarc p5-net p5-perl-ldap rancid rrdtool scotty sendpage smokeping snort sympa syslog-ng tclx tftp-hpa tktable uplog vm-pop3d xserve-raid-tools zabbix: Ports abandoned by markd. (#44782)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.0 KB
Line 
1# $Id: Portfile 125738 2014-09-25 14:43:03Z mf2k@macports.org $
2
3PortSystem      1.0
4
5name                    sympa
6version                 5.4.7
7revision        2
8categories              mail
9license                 GPL-2
10maintainers             nomaintainer
11platforms               darwin
12
13description             Sympa - Mailing List Manager with LDAP support
14
15long_description        An advanced perl-based mail list manager with a web interface \
16                        that supports LDAP authentication and LDAP extraction of \
17                        list subscribers and owners.
18
19homepage                http://www.sympa.org
20
21master_sites            http://www.sympa.org/distribution/ \
22                        http://www.sympa.org/distribution/old/
23
24checksums               md5 74fb5b0c972919a2813cd6aca2d9224f
25default_variants        +server
26
27patchfiles              patch-configure.in \
28                        patch-Makefile.in \
29                        patch-sympa.generic \
30                        patch-src_alias_manager.pl
31
32depends_lib             path:bin/mysql_config5:mysql5 \
33                        port:apache2 \
34                        port:mod_fcgid \
35                        port:openssl \
36                        port:postfix \
37                        port:p5.12-libwww-perl \
38                        port:p5.12-archive-zip \
39                        port:p5.12-convert-asn1 \
40                        port:p5.12-pathtools \
41                        port:p5.12-dbi \
42                        port:p5.12-dbd-mysql \
43                        port:p5.12-mailtools \
44                        port:p5.12-io-stringy \
45                        port:p5.12-mime-tools \
46                        port:p5.12-mime-charset \
47                        port:p5.12-mime-encwords \
48                        port:p5.12-crypt-openssl-x509 \
49                        port:p5.12-fcgi \
50                        port:p5.12-libintl-perl \
51                        port:p5.12-template-toolkit \
52                        port:p5.12-crypt-ciphersaber \
53                        port:p5.12-mhonarc \
54                        port:p5.12-regexp-common \
55                        port:p5.12-xml-libxml \
56                        port:p5.12-io-socket-ssl \
57                        port:p5.12-soap-lite \
58                        port:p5.12-perl-ldap \
59                        port:p5.12-html-format \
60                        port:p5.12-html-stripscripts-parser
61
62configure.args          --with-bindir=${prefix}/bin/${name} \
63                        --with-sbindir=${prefix}/bin/${name} \
64                        --with-libexecdir=${prefix}/libexec/${name} \
65                        --with-libdir=${prefix}/lib/${name} \
66\
67                        --with-cgidir=${prefix}/share/${name}/cgi-bin \
68                        --with-localedir=${prefix}/share/locale \
69                        --with-scriptdir=${prefix}/share/${name}/script \
70                        --with-sampledir=${prefix}/share/${name}/sample \
71                        --with-docdir=${prefix}/share/doc/${name} \
72                        --with-datadir=${prefix}/share/${name} \
73\
74                        --with-confdir=${prefix}/etc/${name} \
75                        --with-etcdir=${prefix}/etc/${name} \
76                        --with-initdir=${prefix}/share/${name} \
77\
78                        --with-expldir=${prefix}/var/${name}/expl \
79                        --with-piddir=${prefix}/var/${name} \
80                        --with-lockdir=${prefix}/var/${name}/lock \
81                        --with-spooldir=${prefix}/var/${name}/spool \
82\
83                        --with-mandir=${prefix}/man \
84                        --with-perl=${prefix}/bin/perl5.12 \
85                        --with-openssl=${prefix}/bin/openssl \
86\
87                        --with-user=www \
88                        --with-group=www \
89                        --with-sendmail_aliases=${prefix}/etc/${name}/sympa_aliases \
90                        --with-virtual_aliases=${prefix}/etc/${name}/sympa_virtual \
91                        --with-newaliases=${prefix}/bin/newaliases \
92                        --with-postmap=${prefix}/sbin/postmap
93
94variant postgresql {
95    depends_lib-append      port:p5.12-dbd-pg
96    depends_lib-delete      port:p5.12-dbd-mysql
97}
98
99variant server  {
100# This variant doesn't do anything in this port, it only exists to trigger the server
101# variant in the mysql5 port.
102}
103
104# Create a startupitem to start/stop the server
105    startupitem.create    yes
106    startupitem.start    "${prefix}/share/${name}/sympa"
107    startupitem.stop     "${prefix}/share/${name}/sympa"
108
109
110pre-destroot {
111# Use sympa.generic startup script and fix paths
112        reinplace "s|PATH=/usr/bin:/bin:/usr/sbin:/sbin|PATH=${prefix}/bin:${prefix}/sbin:/usr/bin:/bin:/usr/sbin:/sbin|g" \
113                "${worksrcpath}/src/etc/script/sympa.generic"
114
115        reinplace "s|/dist/sympa/run|${prefix}/var/${name}|g" \
116                "${worksrcpath}/src/etc/script/sympa.generic"
117
118        system "mv ${worksrcpath}/src/etc/script/sympa.generic ${worksrcpath}/src/etc/script/sympa"
119}
120
121post-destroot {
122# Flag wwsympa.fcgi as executable
123        system "chmod ug+x ${destroot}${prefix}/share/sympa/cgi-bin/wwsympa.fcgi"
124# Create empty directories named in sympa.conf & wwsympa.conf not created by Sympa install
125        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/expl
126        xinstall -m 755 -d ${destroot}${prefix}/var/log/${name}
127   # Incoming spool directories
128        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/spool/msg
129        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/spool/bounce
130   # Storage directories
131        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/arc
132        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/bounce
133
134# Create sympa.log and sympa_aliases files
135        system "touch ${destroot}${prefix}/var/log/${name}/${name}.log"
136        system "touch ${destroot}${prefix}/etc/${name}/sympa_aliases"
137        system "chown www:www ${destroot}${prefix}/bin/${name}/*"
138        system "chown www:www ${destroot}${prefix}/etc/${name}/*"
139
140# Fix alias_manager.pl since the alias_wrapper seems not to work
141        reinplace "s|${prefix}/bin/${name}/aliaswrapper|${prefix}/bin/newaliases|g" \
142                "${destroot}${prefix}/bin/${name}/alias_manager.pl"
143
144# Keep these empty directories
145        destroot.keepdirs \
146                ${destroot}${prefix}/var/${name}/expl \
147                ${destroot}${prefix}/var/log/${name} \
148                ${destroot}${prefix}/var/${name}/spool/msg \
149                ${destroot}${prefix}/var/${name}/spool/bounce \
150                ${destroot}${prefix}/var/${name}/arc \
151                ${destroot}${prefix}/var/${name}/bounce
152
153# Fix permissions for arc directory
154        system "chown www:www ${destroot}${prefix}/var/${name}/arc"
155
156# Set sympa.conf variables (this file uses tabs as separators)
157        reinplace "s|#openssl   /usr/local/bin/openssl|openssl  ${prefix}/bin/openssl|g" \
158                "${destroot}${prefix}/etc/sympa/sympa.conf"
159
160        reinplace "s|#db_type   mysql|db_type   mysql|g" \
161                "${destroot}${prefix}/etc/sympa/sympa.conf"
162
163        reinplace "s|#db_name   sympa|db_name   sympa|g" \
164                "${destroot}${prefix}/etc/sympa/sympa.conf"
165
166        reinplace "s|#db_host   localhost|db_host       localhost|g" \
167                "${destroot}${prefix}/etc/sympa/sympa.conf"
168
169        reinplace "s|#db_user   sympa|db_user   sympa|g" \
170                "${destroot}${prefix}/etc/sympa/sympa.conf"
171
172        system "echo 'db_options  mysql_socket=${prefix}/var/run/mysql5/mysqld.sock' >> ${destroot}${prefix}/etc/sympa/sympa.conf"
173
174# Set wwsympa.conf variables
175        reinplace "s|${prefix}/arc|${prefix}/var/${name}/arc|g" \
176                "${destroot}${prefix}/etc/${name}/wwsympa.conf"
177
178        reinplace "s|${prefix}/bounce|${prefix}/var/${name}/bounce|g" \
179                "${destroot}${prefix}/etc/${name}/wwsympa.conf"
180
181        reinplace "s|/usr/bin/mhonarc|${prefix}/bin/mhonarc|g" \
182                "${destroot}${prefix}/etc/${name}/wwsympa.conf"
183
184        reinplace "s|#openssl   /usr/local/bin/openssl|openssl  ${prefix}/bin/openssl|g" \
185                "${destroot}${prefix}/etc/${name}/wwsympa.conf"
186}
187
188post-activate {
189
190# get rid of .turd files created by destroot.keepdirs because they cause problems in Sympa queues
191        system "rm ${prefix}/var/${name}/spool/msg/.turd_sympa"
192        system "rm ${prefix}/var/${name}/spool/bounce/.turd_sympa"
193        system "rm ${prefix}/var/${name}/bounce/.turd_sympa"
194        system "rm ${prefix}/var/${name}/arc/.turd_sympa"
195
196ui_msg "\n **** To complete Sympa installation ****
197
198You must read the documentation at ${prefix}/share/doc/${name}/index.html for full
199Sympa configuration information, however the installation steps are roughly as shown below.
200
201
2021) Setup MySQL and prepare it for Sympa (for PostgreSQL, see documentation)
203   Configure MySQL (new MySQL installs)
204        sudo -u mysql ${prefix}/lib/mysql5/bin/mysql_install_db
205
206   Start MySQL:
207        sudo ${prefix}/share/mysql5/mysql/mysql.server start
208
209   Set MySQL to start at system boot (optional)
210        sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
211
212   Set a MySQL root password:
213        Follow the instructions that were given after you executed 'mysql_install_db' above.
214
215   Create a Sympa MySQL user ...
216        mysql5 -u root -p (login with new root password when prompted)
217        mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on sympa.* to sympa@localhost;
218        mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on sympa.* to sympa;
219        mysql> quit;
220
221   Create the Sympa database:
222        cat ${prefix}/share/sympa/script/create_db.mysql | mysql5 -u root -p sympa
223
224   Verify Sympa DB:
225        mysql5 -u root -p
226        mysql> use sympa;
227        mysql> show tables;
228        mysql> exit;
229
230   NOTE: MySQL must start before Apache because of wwsympa.fcgi
231
232
2332) Setup Apache 2 & FastCGI
234        cd ${prefix}/apache2/conf
235        sudo cp httpd.conf.sample httpd.conf
236
237   Modify the ${prefix}/apache2/conf/httpd.conf file
238
239   Add directives and ScriptAlias:
240        IPCCommTimeout 120
241        MaxProcessCount 2
242
243        <Location /sympa>
244          SetHandler fcgid-script
245        </Location>
246
247        ScriptAlias /sympa ${prefix}/share/sympa/cgi-bin/wwsympa.fcgi
248
249   Start Apache 2: (Turn off personal web sharing first!)
250        sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
251
252
253   NOTE: The Apache user and group must be the same as the file wwsympa.fcgi.
254         Sympa files are owned by user/group 'www' so the apache user and group
255         must be www unless you chown Sympa files to something else.
256
257
2583) Enable Postfix (not covered), setup Sympa robot aliases, & list alias config
259   Robot aliases:
260        sympa: \"| ${prefix}/bin/sympa/queue sympa@mydomain.org\"
261        listmaster: \"| ${prefix}/bin/sympa/queue listmaster@mydomain.org\"
262        bounce+*: \"| ${prefix}/bin/sympa/bouncequeue sympa@mydomain.org\"
263        sympa-request: <sympa administrator's address>
264        sympa-owner: <sympa administrator's address>
265
266   Activate the robot aliases with the command \"sudo newaliases\"
267
268   List alias config: (automatic list aliases)
269   Add these statements to /etc/postfix/main.cf
270        alias_maps = hash:/etc/aliases,hash:${prefix}/etc/${name}/sympa_aliases
271        alias_database = hash:/etc/aliases,hash:${prefix}/etc/${name}/sympa_aliases
272
273   Activate the new configuration with the command \"sudo postfix reload\"
274
275
2764) Edit ${prefix}/etc/sympa/sympa.conf variables
277        domain
278        listmaster
279        email
280        db_password
281        wwsympa_url
282
283
2845) Edit ${prefix}/etc/sympa/wwsympa.conf variables
285        title
286        default_home
287
288
2896) Add a statement to OS X's syslog.conf file to support Sympa log files
290
291        local1.*       ${prefix}/var/log/sympa/sympa.log
292
293
2947) Start the Sympa daemon
295        sudo launchctl load -w /Library/LaunchDaemons/org.macports.sympa.plist
296
297
2988) Have Sympa generate a listmaster password
299        Go to http://localhost/sympa. Click the \"First login ?\" link, then
300        enter the listmaster address you set in the sympa.conf file, and
301        click \"Send me my password\" and retrieve the password in your inbox.
302
303
3049) Login to WWSympa at http://localhost/sympa with the listmaster address
305   and then change the password and setup your lists.
306
307-------------------------------------------------
308File Locations:
309
310Executable files -> ${prefix}/bin/${name}
311CGI directory -> ${prefix}/share/${name}/cgi-bin
312Configuration files -> ${prefix}/etc/${name}
313Sample files -> ${prefix}/share/${name}/sample
314Documentation directory -> ${prefix}/share/doc/${name}
315Expl (also spool/pid/bounce/archive) directories -> ${prefix}/var/${name}
316\n"
317
318}
Note: See TracBrowser for help on using the repository browser.