Ticket #31031: Unified-Diff-Portfile.txt

File Unified-Diff-Portfile.txt, 18.5 KB (added by kwcheong@…, 13 years ago)

output of diff -u oldPortfile newPortfile

Line 
1--- Portfile-1.8.2      2011-08-31 09:35:35.000000000 +0800
2+++ Portfile-1.8.6      2011-08-31 09:35:47.000000000 +0800
3@@ -1,45 +1,46 @@
4 # $Id: Portfile 71305 2010-09-08 01:38:10Z markd@macports.org $
5
6-PortSystem     1.0
7+PortSystem      1.0
8
9-name                   zabbix
10-version                        1.8.2
11-categories             net
12-maintainers            markd openmaintainer
13-platforms              darwin
14-
15-description            An open source application and network monitor
16-
17-long_description       ${description}
18-
19-homepage               http://www.zabbix.com/
20-master_sites           sourceforge
21-checksums              md5 fa4be4fa7ac20a33cc0aa5c27b827746
22-patchfiles     patch-src-zabbix_server-poller-checks_snmp.c.diff
23-depends_lib            port:fping \
24-                       port:curl \
25-                       port:openssl
26-
27-configure.args         --enable-server \
28-                       --enable-agent \
29-                       --with-net-snmp \
30-                       --bindir=${prefix}/bin/zabbix \
31-                       --sbindir=${prefix}/sbin/zabbix \
32-                       --libexecdir=${prefix}/libexec/zabbix \
33-                       --datadir=${prefix}/share/zabbix \
34-                       --sysconfdir=${prefix}/etc/zabbix \
35-                       --localstatedir=${prefix}/var/zabbix
36-
37-configure.ldflags-append       -lresolv
38-
39-if { [variant_isset agent_only] } {
40-       startupitem.create      yes
41-       startupitem.start       "${prefix}/share/zabbix/zabbix_agentd.init start"
42-       startupitem.stop        "${prefix}/share/zabbix/zabbix_agentd.init stop"
43+name                    zabbix
44+version                 1.8.6
45+categories              net
46+maintainers             markd openmaintainer
47+platforms               darwin
48+
49+description             An open source application and network monitor (Server or proxy module)
50+
51+long_description        ${description}
52+
53+homepage                http://www.zabbix.com/
54+master_sites            sourceforge
55+checksums               md5 4642fd263167211a73a02fe7f3bcd998
56+patchfiles             patch-src-zabbix_server-poller-checks_snmp.c.diff
57+depends_lib             port:fping \
58+                        port:curl \
59+                        port:openssl
60+
61+configure.args          --enable-server \
62+                        --with-net-snmp \
63+                        --bindir=${prefix}/bin/zabbix \
64+                        --sbindir=${prefix}/sbin/zabbix \
65+                        --libexecdir=${prefix}/libexec/zabbix \
66+                        --datadir=${prefix}/share/zabbix \
67+                        --sysconfdir=${prefix}/etc/zabbix \
68+                        --localstatedir=${prefix}/var/zabbix
69+
70+configure.ldflags-append        -lresolv
71+
72+if { [variant_isset proxy] } {
73+        startupitem.create      yes
74+       startupitem.name        zabbix_proxy
75+        startupitem.start       "${prefix}/share/zabbix/zabbix_proxy.init start"
76+        startupitem.stop        "${prefix}/share/zabbix/zabbix_proxy.init stop"
77 } else {
78-       startupitem.create      yes
79-       startupitem.start       "${prefix}/share/zabbix/zabbix_server.init start"
80-       startupitem.stop        "${prefix}/share/zabbix/zabbix_server.init stop"
81+        startupitem.create      yes
82+       startupitem.name        zabbix_server
83+        startupitem.start       "${prefix}/share/zabbix/zabbix_server.init start"
84+        startupitem.stop        "${prefix}/share/zabbix/zabbix_server.init stop"
85 }
86
87 variant mysql5 conflicts pgsql81 pgsql82 pgsql83 pgsql84 sqlite3 \
88@@ -55,9 +56,9 @@
89 }
90
91 variant pgsql82 conflicts mysql5 pgsql81 pgsql83 pgsql84 sqlite3 \
92-       description {Use PostgreSQL 8.2.x for server database} {
93-       depends_lib-append      port:postgresql82
94-       configure.args-append   --with-pgsql=${prefix}/lib/postgresql82/bin/pg_config
95+        description {Use PostgreSQL 8.2.x for server database} {
96+        depends_lib-append      port:postgresql82
97+        configure.args-append   --with-pgsql=${prefix}/lib/postgresql82/bin/pg_config
98 }
99
100 variant pgsql83 conflicts mysql5 pgsql81 pgsql82 pgsql84 sqlite3 \
101@@ -78,26 +79,39 @@
102         configure.args-append   --with-sqlite3=${prefix}
103 }
104
105-variant agent_only conflicts mysql5 pgsql81 pgsql82 pgsql83 pgsql84 sqlite3 \
106-       description {Do not install the Zabbix server} {
107-       depends_lib-delete      port:fping \
108-                               port:curl \
109-                               port:openssl
110-
111-       configure.args-delete   --enable-server \
112-                               --with-net-snmp
113+variant proxy \
114+        description {Do not install the Zabbix server but install the proxy} {
115+        configure.args-delete   --enable-server
116+        configure.args-append   --enable-proxy
117 }
118
119-if {![variant_isset pgsql81] && ![variant_isset pgsql82] && ![variant_isset pgsql83] && ![variant_isset pgsql84] && ![variant_isset sqlite3] && ![variant_isset agent_only]} {
120+if {![variant_isset pgsql81] && ![variant_isset pgsql82] && ![variant_isset pgsql83] && ![variant_isset pgsql84] && ![variant_isset sqlite3]} {
121         default_variants +mysql5
122 }
123
124 post-patch {
125-        reinplace "s|#DBSocket=/tmp/mysql.sock|DBSocket=${prefix}/var/run/mysql5/mysqld.sock|g" \
126-                ${worksrcpath}/misc/conf/zabbix_server.conf
127+        if { [variant_isset proxy] } {
128+                if {![variant_isset pgsql81] && ![variant_isset pgsql82] && ![variant_isset pgsql83] && ![variant_isset pgsql84] && ![variant_isset sqlite3]} {
129
130-        reinplace "s|#FpingLocation=/usr/sbin/fping|FpingLocation=${prefix}/sbin/fping|g" \
131-               ${worksrcpath}/misc/conf/zabbix_server.conf
132+                        reinplace "s|# DBSocket=/tmp/mysql.sock|DBSocket=${prefix}/var/run/mysql5/mysqld.sock|g" \
133+                                ${worksrcpath}/misc/conf/zabbix_proxy.conf
134+                }
135+
136+                reinplace "s|# FpingLocation=/usr/sbin/fping|FpingLocation=${prefix}/sbin/fping|g" \
137+                        ${worksrcpath}/misc/conf/zabbix_proxy.conf
138+                reinplace "s|# Fping6Location=/usr/sbin/fping6|Fping6Location=${prefix}/sbin/fping6|g" \
139+                        ${worksrcpath}/misc/conf/zabbix_proxy.conf
140+        } else {
141+                if {![variant_isset pgsql81] && ![variant_isset pgsql82] && ![variant_isset pgsql83] && ![variant_isset pgsql84] && ![variant_isset sqlite3]} {
142+                        reinplace "s|# DBSocket=/tmp/mysql.sock|DBSocket=${prefix}/var/run/mysql5/mysqld.sock|g" \
143+                                 ${worksrcpath}/misc/conf/zabbix_server.conf
144+                }
145+
146+                reinplace "s|# FpingLocation=/usr/sbin/fping|FpingLocation=${prefix}/sbin/fping|g" \
147+                        ${worksrcpath}/misc/conf/zabbix_server.conf
148+                reinplace "s|# Fping6Location=/usr/sbin/fping6|Fping6Location=${prefix}/sbin/fping6|g" \
149+                        ${worksrcpath}/misc/conf/zabbix_server.conf
150+        }
151 }
152
153 pre-destroot {
154@@ -107,165 +121,202 @@
155
156 post-destroot {
157
158-if { [variant_isset agent_only] } {
159-# Don't install MySQL data and frontend stuff for agent_only
160+if { [variant_isset proxy] } {
161+# Copy sample server .conf files
162+        xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
163+        xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_proxy.conf \
164+                ${destroot}${prefix}/etc/zabbix/zabbix_proxy.conf.sample
165+
166+# Copy database data and schemas
167+        xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data
168+        xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema
169+
170+        eval xinstall -m 755 [glob ${worksrcpath}/create/data/*.*] \
171+                ${destroot}${prefix}/share/zabbix/data
172+        eval xinstall -m 755 [glob ${worksrcpath}/create/schema/*] \
173+                ${destroot}${prefix}/share/zabbix/schema
174+
175+# Create a startup script for the proxy
176+        xinstall -m 755 ${portpath}/${filesdir}/zabbix_proxy.init \
177+                ${destroot}${prefix}/share/zabbix
178+        reinplace "s|__PREFIX__|${prefix}|g" \
179+                ${destroot}${prefix}/share/zabbix/zabbix_proxy.init
180+
181+# Set permissions for etc (protect passwords)
182+        system "chmod 660 ${destroot}${prefix}/etc/zabbix/*"
183+        system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*"
184
185-# Copy sample agent .conf files
186-       xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
187-       xinstall -m 755  ${worksrcpath}/misc/conf/zabbix_agent.conf \
188-               ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample
189-        xinstall -m 755  ${worksrcpath}/misc/conf/zabbix_agentd.conf \
190-                ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample
191-
192-# Copy a startup script for the agent
193-               xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix
194-               xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \
195-                       ${destroot}${prefix}/share/zabbix
196-               reinplace "s|__PREFIX__|${prefix}|g" \
197-                ${destroot}${prefix}/share/zabbix/zabbix_agentd.init
198 } else {
199
200-# Copy sample server and agent .conf files
201-       xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
202-       xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_agent.conf \
203-               ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample
204-        xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_agentd.conf \
205-                ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample
206+# Copy sample server .conf files
207+        xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
208         xinstall -m 755 ${worksrcpath}/misc/conf/zabbix_server.conf \
209                 ${destroot}${prefix}/etc/zabbix/zabbix_server.conf.sample
210-
211+
212 # Copy database data and schemas
213         xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data
214         xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema
215-
216+
217         eval xinstall -m 755 [glob ${worksrcpath}/create/data/*.*] \
218                 ${destroot}${prefix}/share/zabbix/data
219         eval xinstall -m 755 [glob ${worksrcpath}/create/schema/*] \
220                 ${destroot}${prefix}/share/zabbix/schema
221-
222+
223 # Copy the front end files
224-
225         file mkdir ${destroot}${prefix}/share/zabbix/frontends/
226         file copy ${worksrcpath}/frontends/php/ \
227                 ${destroot}${prefix}/share/zabbix/frontends/
228-
229+
230 # Create a startup script for the server
231-               xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init \
232-                       ${destroot}${prefix}/share/zabbix
233-               reinplace "s|__PREFIX__|${prefix}|g" \
234-               ${destroot}${prefix}/share/zabbix/zabbix_server.init
235-
236-# Create a startup script for the agent
237-               xinstall -m 755 ${portpath}/${filesdir}/zabbix_agentd.init \
238-                       ${destroot}${prefix}/share/zabbix
239-               reinplace "s|__PREFIX__|${prefix}|g" \
240-            ${destroot}${prefix}/share/zabbix/zabbix_agentd.init
241-
242+        xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init \
243+                ${destroot}${prefix}/share/zabbix
244+        reinplace "s|__PREFIX__|${prefix}|g" \
245+                ${destroot}${prefix}/share/zabbix/zabbix_server.init
246+
247 # Set permissions for etc (protect passwords) and the frontend
248-               system "chmod 660 ${destroot}${prefix}/etc/zabbix/*"
249-               system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*"
250-               system "chown -R www:www ${destroot}${prefix}/share/zabbix/frontends/*"
251-
252+        system "chmod 660 ${destroot}${prefix}/etc/zabbix/*"
253+        system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*"
254+        system "chown -R www:www ${destroot}${prefix}/share/zabbix/frontends/*"
255+
256 # End else clause - Done with server stuff
257 }
258
259-# Copy Win32 agent for normal and agent_only installs
260-               xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
261-               xinstall -m 755 ${worksrcpath}/bin/win32/zabbix_agentd.exe \
262-                       ${destroot}${prefix}/share/zabbix/zabbix_agent_win32
263 }
264
265
266+if { [variant_isset proxy] } {
267 notes \
268-"#### ZABBIX agent installation section (steps 1 - 3 only) ####
269+"####                                         ####
270+#### Begin ZABBIX proxy installation section ####
271+
272+
273+1) Setup MySQL, i.e. via MacPorts:
274+
275+        sudo port install mysql5-server
276
277-1) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_agentd.conf (rename & omit .sample)
278
279-   Set the following variable to the ip address of your ZABBIX server to
280-   allow it access to the agent.
281+2) Setup the ZABBIX MySQL database
282+
283+-Create the ZABBIX database
284+        mysql5 -u root -p (enter password at prompt)
285+        mysql> create database zabbix character set utf8;
286+        mysql> quit;
287+
288+-Import the ZABBIX Schema
289+        cd ${prefix}/share/zabbix/schema
290+        cat mysql.sql | mysql5 -u root -p zabbix
291+        cd ${prefix}/share/zabbix/data
292+        cat data.sql | mysql5 -u root -p zabbix
293+        cat images_mysql.sql | mysql5 -u root -p zabbix
294
295-       Server=x.x.x.x
296+-Create a MySQL 'zabbix' user and password
297+        mysql5 -u root -p
298+        mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<zabbix-mysql-password>';
299+        mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>';
300+        mysql> quit;
301+
302+
303+3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_proxy.conf (rename & omit .sample)
304+
305+   Modify these variables at the very least:
306
307+        DBName=zabbix
308+        DBUser=zabbix
309+        DBPassword=<zabbix-mysql-password>
310
311-2) Set zabbix_agentd to run at system boot
312
313-       sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist
314+4) Set zabbix_proxy to run at system boot, then start it
315
316-   To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_agentd.init start (stop|status)
317+        sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix_proxy.plist
318
319+   To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_proxy.init start (stop|status)
320
321-3) A Win32 agent is in ${prefix}/share/zabbix/zabbix_agent_win32 for
322-   installation on Windows NT 4.0, Windows 2000, and Windows XP.
323+        Note: Eventually your shared memory has to be increased (see http://www.zabbix.org/forum/showthread.php?p=64232)!
324
325
326-#### End ZABBIX agent installation section ####
327-####                                       ####
328+5)  Install zabbix_agent via MacPorts:
329
330+       sudo port install zabbix_agentd
331
332-####                                          ####
333+
334+6) Open http://localhost/zabbix/ in your browser and walk through the setup, then login with default user 'Admin' and password 'zabbix'.
335+
336+
337+7) Read the fine manual at http://www.zabbix.com/documentation/
338+#### End ZABBIX proxy installation section ####
339+####                                       ####"
340+
341+} else {
342+notes \
343+"####                                          ####
344 #### Begin ZABBIX server installation section ####
345
346
347 1) Setup MySQL, i.e. via MacPorts:
348
349-       sudo port install mysql5-server
350+        sudo port install mysql5-server
351
352
353 2) Setup the ZABBIX MySQL database
354
355 -Create the ZABBIX database
356-       mysql5 -u root -p (enter password at prompt)
357-       mysql> create database zabbix character set utf8;
358-       mysql> quit;
359+        mysql5 -u root -p (enter password at prompt)
360+        mysql> create database zabbix character set utf8;
361+        mysql> quit;
362
363 -Import the ZABBIX Schema
364-       cd ${prefix}/share/zabbix/schema
365-       cat mysql.sql | mysql5 -u root -p zabbix
366-       cd ${prefix}/share/zabbix/data
367-       cat data.sql | mysql5 -u root -p zabbix
368-       cat images_mysql.sql | mysql5 -u root -p zabbix
369+        cd ${prefix}/share/zabbix/schema
370+        cat mysql.sql | mysql5 -u root -p zabbix
371+        cd ${prefix}/share/zabbix/data
372+        cat data.sql | mysql5 -u root -p zabbix
373+        cat images_mysql.sql | mysql5 -u root -p zabbix
374
375 -Create a MySQL 'zabbix' user and password
376-       mysql5 -u root -p
377-       mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<zabbix-mysql-password>';
378-       mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>';
379-       mysql> quit;
380+        mysql5 -u root -p
381+        mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<zabbix-mysql-password>';
382+        mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>';
383+        mysql> quit;
384
385
386 3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_server.conf (rename & omit .sample)
387
388    Modify these variables at the very least:
389
390-       DBName=zabbix
391-       DBUser=zabbix
392-       DBPassword=<zabbix-mysql-password>
393+        DBName=zabbix
394+        DBUser=zabbix
395+        DBPassword=<zabbix-mysql-password>
396
397
398 4) Install PHP 5, i.e. via MacPorts:
399
400-       sudo port install php5 php5-gd php5-mbstring php5-mysql php5-sockets
401+        sudo port install php5 php5-gd php5-mbstring php5-mysql php5-sockets
402
403
404 5) Set a symbolic link in your Apache document root pointing to the PHP frontend files
405
406-       sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix
407+        sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix
408
409
410 6) Set zabbix_server to run at system boot, then start it
411
412-       sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix.plist
413+        sudo launchctl load -w /Library/LaunchDaemons/org.macports.zabbix_server.plist
414
415    To start Zabbix manually, use: ${prefix}/share/zabbix/zabbix_server.init start (stop|status)
416
417-       Note: Eventually your shared memory has to be increased (see http://www.zabbix.org/forum/showthread.php?p=64232)!
418+        Note: Eventually your shared memory has to be increased (see http://www.zabbix.org/forum/showthread.php?p=64232)!
419+
420
421+7) Install zabbix_agent via MacPorts:
422
423-7) A Win32 agent is in ${prefix}/share/zabbix/zabbix_agent_win32 for
424-   installation on Windows NT 4.0, Windows 2000, and Windows XP.  See
425-   the ReadMe.txt for instructions.
426+       sudo port install zabbix_agentd
427
428
429 8) Open http://localhost/zabbix/ in your browser and walk through the setup, then login with default user 'Admin' and password 'zabbix'.
430
431
432-9) Read the fine manual at http://www.zabbix.com/documentation/"
433+9) Read the fine manual at http://www.zabbix.com/documentation/
434+
435+
436+#### End ZABBIX server installation section ####
437+####                                        ####"
438+}