Ticket #30834: Portfile

File Portfile, 1.8 KB (added by me@…, 11 years ago)

Portfile for Elasticsearch 0.90.5

Line 
1# $Id$
2# vim: set fileencoding=utf-8 tabstop=8 shiftwidth=4 softtabstop=4 noexpandtab filetype=tcl :
3
4PortSystem 1.0
5
6name              elasticsearch
7version           0.90.5
8revision          0
9categories        java databases
10maintainers       semenov.co:ilya
11platforms         darwin
12
13description       ElasticSearch is a flexible and powerful open source, distributed real-time \
14        search and analytics engine for the cloud
15
16homepage          http://elasticsearch.org
17master_sites      https://download.elasticsearch.org/elasticsearch/elasticsearch
18checksums         sha256 f14ff217039b5c398a9256b68f46a90093e0a1e54e89f94ee6a2ee7de557bd6d
19
20depends_lib       bin:java:kaffe
21conflicts         ${name}
22use_configure     no
23
24set dbuser        elasticsearch
25set dbgrp         elasticsearch
26set es_parent     ${prefix}/share/java
27set es_home       ${es_parent}/${name}
28set pidfile       ${prefix}/var/run/${name}/pid
29
30add_users ${dbuser} shell=/bin/sh group=${dbgrp} \
31    home=${es_home} \
32    realname=Elasticsearch Server
33
34build {}
35
36destroot {
37  xinstall -m 755 -d ${destroot}${es_parent}
38  file copy ${worksrcpath} ${destroot}${es_home}
39  xinstall -m 700 -o ${dbuser} -g ${dbgrp} -d ${destroot}${es_home}/data
40  xinstall -m 755 -o ${dbuser} -g ${dbgrp} -d ${destroot}${es_home}/logs
41  xinstall -m 755 -o ${dbuser} -g ${dbgrp} -d ${destroot}${prefix}/var/run/${name}
42}
43
44destroot.keepdirs ${destroot}${es_home}/data \
45                  ${destroot}${es_home}/logs \
46                  ${destroot}${prefix}/var/run/${name}
47
48startupitem.create yes
49startupitem.logfile ${prefix}/var/log/elasticsearch.log
50startupitem.logevents yes
51startupitem.pidfile auto ${pidfile}
52startupitem.start "su ${dbuser} -c \"${es_home}/bin/elasticsearch -p ${pidfile}\""
53startupitem.stop "su ${dbuser} -c \"kill `cat ${pidfile}`\""