Ticket #44824: Portfile

File Portfile, 2.9 KB (added by jul_bsd@…, 10 years ago)
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$
3
4PortSystem 1.0
5
6name              logstash
7version           1.4.2
8categories        java sysutils
9maintainers       yahoo.fr:jul_bsd openmaintainer
10platforms         darwin
11
12description       open source log management
13long_description  logstash is a tool for managing events and logs. You \
14                  can use it to collect logs, parse them, and store \
15                  them for later use (like, for searching). Speaking \
16                  of searching, logstash comes with a web interface \
17                  for searching and drilling into all of your logs.
18license           APL-2
19
20homepage          http://logstash.net/
21master_sites      https://download.elasticsearch.org/logstash/logstash/
22# OR https://github.com/elasticsearch/logstash/releases
23
24depends_lib       bin:java:kaffe
25depends_run       port:elasticsearch
26
27use_configure     no
28
29set es_parent     ${prefix}/share/java
30set es_home       ${es_parent}/${name}
31set pidfile       ${prefix}/var/run/${name}/pid
32
33add_users logstash shell=/bin/sh group=logstash \
34    home=${es_home} \
35    realname=Logstash\ Server
36
37build {}
38
39destroot {
40  xinstall -m 755 -d ${destroot}${es_parent}
41  file copy ${worksrcpath} ${destroot}${es_home}
42}
43
44test.run            yes
45test.cmd            "/bin/echo 'hello world' | ${es_home}/bin/logstash agent -e 'input { stdin { type => stdin } } output { stdout { codec => rubydebug } }'"
46
47destroot.keepdirs \
48                  ${destroot}${prefix}/var/run/${name} \
49                  ${destroot}${prefix}/var/log/${name}
50
51startupitem.create yes
52startupitem.logfile ${prefix}/var/log/logstash.log
53startupitem.logevents yes
54startupitem.pidfile auto ${pidfile}
55#startupitem.start "su ${dbuser} -c \"java -jar ${es_home}/logstash-1.1.0-monolithic.jar agent -f ${prefix}/etc/${name}/logstash.conf -- web --backend elasticsearch:///?local\""
56#startupitem.stop "su ${dbuser} -c \"kill `cat ${pidfile}`\""
57
58if {${subport} eq ${name}} {
59    checksums           rmd160  04894204b9cdd4e7a59df7b9b1e52e0a95bebc36 \
60                        sha256  d5be171af8d4ca966a0c731fc34f5deeee9d7631319e3660d1df99e43c5f8069
61
62    conflicts  ${name}-devel
63
64    livecheck.type      regex
65    livecheck.url       https://github.com/elasticsearch/logstash/releases
66    livecheck.regex     "<a href=\"/elasticsearch/logstash/releases/tag/v(.*)\">"
67}
68
69subport ${name}-devel {
70    fetch.type git
71    git.url    https://github.com/elasticsearch/logstash.git
72    version    20140821
73    git.branch dbe6b33d100e240a9a5cc09510e81048189186ef
74
75    depends_lib-append port:jruby
76
77#    pre-configure {
78#    }
79
80    conflicts  ${name}
81    livecheck.type      none
82}
83
84notes "
85   To enable ${name} as background daemon:
86       $ sudo ln -s ${prefix}/Library/LaunchDaemons/org.macports.${name}.plist /Library/LaunchDaemons/
87       $ sudo launchctl load -w /Library/LaunchDaemons/org.macports.${name}.plist
88"