Ticket #30834: Portfile.2

File Portfile.2, 1.8 KB (added by swentz@…, 10 years ago)

Portfile for elasticsearch 1.0.1

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           1.0.1
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 6acdf3528b40d8aea93f1b8cfd9e3bdcc2e529f0bd5fe6a82269bec3293d9b5b
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}`\""