Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/aerospike-server-community/files/, dev-db/aerospike-server-community/
Date: Wed, 30 Mar 2016 14:09:07
Message-Id: 1459346923.54033c543c56d58d326fea9c50e0d426d4f71714.patrick@gentoo
1 commit: 54033c543c56d58d326fea9c50e0d426d4f71714
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 30 14:07:49 2016 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 30 14:08:43 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54033c54
7
8 dev-db/aerospike-server-community: Initial import, borrowed and bumped from the adjust overlay
9
10 Package-Manager: portage-2.2.28
11
12 dev-db/aerospike-server-community/Manifest | 1 +
13 .../aerospike-server-community-3.7.5.ebuild | 69 +++++++++++++++++
14 .../aerospike-server-community-9999.ebuild | 87 ++++++++++++++++++++++
15 .../files/3.5.8-use-system-libs.patch | 63 ++++++++++++++++
16 .../files/aerospike.conf | 70 +++++++++++++++++
17 .../files/aerospike.init | 53 +++++++++++++
18 .../files/aerospike.logrotate | 10 +++
19 .../files/aerospike_mesh.conf | 73 ++++++++++++++++++
20 .../files/aerospike_ssd.conf | 68 +++++++++++++++++
21 dev-db/aerospike-server-community/metadata.xml | 10 +++
22 10 files changed, 504 insertions(+)
23
24 diff --git a/dev-db/aerospike-server-community/Manifest b/dev-db/aerospike-server-community/Manifest
25 new file mode 100644
26 index 0000000..8aa5505
27 --- /dev/null
28 +++ b/dev-db/aerospike-server-community/Manifest
29 @@ -0,0 +1 @@
30 +DIST aerospike-server-community-3.7.5-debian7.tgz 10810815 SHA256 9177bc49b732534371a27544adafa6792504b90ecb2e1992de7882ed7b221c32 SHA512 55b78b1992fac52f85d0405ae78b590b8af60880da0fc307570e13c2468f7e83fc1b61c3425e4c98fdb955c3d19c96c3f8e557f803c6d8154ec9d3fd453b2ca9 WHIRLPOOL 5569dd54bf68ee68ebb4bc709d8a5d816115781dd3a05997685c1408dfc1129e83f251b973c4f5e736a728998cf8f54543f9800214c9efe6077f1a92c5f40cee
31
32 diff --git a/dev-db/aerospike-server-community/aerospike-server-community-3.7.5.ebuild b/dev-db/aerospike-server-community/aerospike-server-community-3.7.5.ebuild
33 new file mode 100644
34 index 0000000..b240552
35 --- /dev/null
36 +++ b/dev-db/aerospike-server-community/aerospike-server-community-3.7.5.ebuild
37 @@ -0,0 +1,69 @@
38 +# Copyright 1999-2015 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +# $Id$
41 +
42 +EAPI=5
43 +inherit eutils user
44 +
45 +DESCRIPTION="Flash-optimized, in-memory, nosql database"
46 +HOMEPAGE="http://www.aerospike.com"
47 +SRC_URI="http://www.aerospike.com/artifacts/${PN}/${PV}/${P}-debian7.tgz"
48 +
49 +LICENSE="Apache-2.0"
50 +SLOT="0"
51 +KEYWORDS="~amd64"
52 +IUSE=""
53 +
54 +RDEPEND="app-crypt/gcr"
55 +DEPEND="${RDEPEND}"
56 +
57 +S="${WORKDIR}/${P}-debian7"
58 +
59 +pkg_setup() {
60 + enewgroup aerospike
61 + enewuser aerospike -1 /bin/bash /opt/aerospike aerospike
62 +}
63 +
64 +src_prepare() {
65 + local server_deb="${P}.debian7.x86_64.deb"
66 + local tools_deb="aerospike-tools-${PV}.debian7.x86_64.deb"
67 +
68 + ar x "${server_deb}" || die
69 + tar xzf data.tar.gz && rm data.tar.gz || die
70 +
71 + ar x "${tools_deb}" || die
72 + tar xzf data.tar.gz && rm data.tar.gz || die
73 +
74 + rm *.deb asinstall control.tar.gz debian-binary LICENSE SHA256SUMS
75 + rm usr/bin/{asfixownership,asmigrate2to3}
76 +}
77 +
78 +src_install() {
79 + insinto /opt/
80 + doins -r opt/aerospike
81 +
82 + fperms +x -R /opt/aerospike/bin/
83 + fperms +x -R /opt/aerospike/lib/python/
84 +
85 + for dir in '/etc' '/var/log'; do
86 + keepdir "${dir}/aerospike"
87 + done
88 +
89 + insinto /etc/aerospike
90 + for conf in 'aerospike.conf' 'aerospike_mesh.conf' 'aerospike_ssd.conf'; do
91 + doins "${FILESDIR}/${conf}"
92 + done
93 +
94 + insinto /usr/bin
95 + doins usr/bin/*
96 + fperms +x -R /usr/bin/asd
97 +
98 + insinto /etc/logrotate.d
99 + newins "${FILESDIR}"/aerospike.logrotate aerospike
100 +
101 + newinitd "${FILESDIR}"/aerospike.init aerospike
102 +
103 + fowners -R aerospike:aerospike /opt/aerospike/
104 + fowners aerospike:aerospike /usr/bin/asd
105 + fowners -R aerospike:aerospike /var/log/aerospike
106 +}
107
108 diff --git a/dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild b/dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild
109 new file mode 100644
110 index 0000000..e595d22
111 --- /dev/null
112 +++ b/dev-db/aerospike-server-community/aerospike-server-community-9999.ebuild
113 @@ -0,0 +1,87 @@
114 +# Copyright 1999-2016 Gentoo Foundation
115 +# Distributed under the terms of the GNU General Public License v2
116 +# $Id$
117 +
118 +EAPI=5
119 +
120 +EGIT_REPO_URI="https://github.com/aerospike/aerospike-server.git"
121 +
122 +inherit git-2 systemd user
123 +
124 +DESCRIPTION="Flash-optimized, in-memory, nosql database"
125 +HOMEPAGE="http://www.aerospike.com"
126 +SRC_URI=""
127 +
128 +LICENSE="AGPL-3"
129 +SLOT="0"
130 +KEYWORDS=""
131 +IUSE="+tools"
132 +
133 +RDEPEND="app-crypt/gcr
134 + dev-libs/jansson
135 + dev-libs/jemalloc"
136 +DEPEND="${RDEPEND}"
137 +
138 +DOCS=(
139 + README.md
140 +)
141 +
142 +PATCHES=(
143 + "${FILESDIR}"/3.5.8-use-system-libs.patch
144 +)
145 +
146 +pkg_setup() {
147 + enewgroup aerospike
148 + enewuser aerospike -1 /bin/bash /opt/aerospike aerospike
149 +}
150 +
151 +src_prepare() {
152 + base_src_prepare
153 +
154 + git submodule update --init
155 +
156 + sed \
157 + -e 's/USE_SYSTEM_JEM = 0/USE_SYSTEM_JEM = 1/g' \
158 + -e 's/USE_SYSTEM_JANSSON = 0/USE_SYSTEM_JANSSON = 1/g' \
159 + -e 's/LD_CRYPTO = static/LD_CRYPTO = dynamic/g' \
160 + -e 's/LD_JANSSON = static/LD_JANSSON = dynamic/g' \
161 + -e 's/LD_JEM = static/LD_JEM = dynamic/g' \
162 + -i make_in/Makefile.vars || die
163 +
164 + rm -rf modules/jansson
165 + rm -rf modules/jemalloc
166 +}
167 +
168 +src_install() {
169 + base_src_install_docs
170 +
171 + dobin target/Linux-x86_64/bin/asd
172 +
173 + insinto /opt/aerospike/sys/udf/lua
174 + doins -r modules/lua-core/src/*
175 +
176 + if use tools; then
177 + insinto /opt/aerospike/bin
178 + doins tools/afterburner/afterburner.sh
179 + fperms +x /opt/aerospike/bin/afterburner.sh
180 + fi
181 +
182 + keepdir /opt/aerospike/usr/udf/lua
183 + keepdir /var/log/aerospike
184 +
185 + insinto /etc/aerospike
186 + for conf in aerospike.conf aerospike_mesh.conf aerospike_ssd.conf; do
187 + sed -e "s@/var/run/aerospike/asd.pid@/run/aerospike/aerospike.pid@g" -i as/etc/"${conf}" || die
188 + doins as/etc/"${conf}"
189 + done
190 +
191 + insinto /etc/logrotate.d
192 + newins as/etc/logrotate_asd aerospike
193 +
194 + newinitd "${FILESDIR}"/aerospike.init aerospike
195 + systemd_newunit as/etc/aerospike-server.service aerospike.service
196 +
197 + fowners -R aerospike:aerospike /opt/aerospike/
198 + fowners aerospike:aerospike /usr/bin/asd
199 + fowners -R aerospike:aerospike /var/log/aerospike
200 +}
201
202 diff --git a/dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch b/dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch
203 new file mode 100644
204 index 0000000..eb69f5f
205 --- /dev/null
206 +++ b/dev-db/aerospike-server-community/files/3.5.8-use-system-libs.patch
207 @@ -0,0 +1,63 @@
208 +diff --git a/Makefile b/Makefile
209 +index d4ce8ac..26271fd 100644
210 +--- a/Makefile
211 ++++ b/Makefile
212 +@@ -54,12 +54,16 @@ ifeq ($(USE_ASM),1)
213 + $(MAKE) -C $(ASMALLOC) jem SRCDIR=src
214 + endif
215 + ifeq ($(USE_JEM),1)
216 ++ifeq ($(USE_SYSTEM_JEM),0)
217 + $(MAKE) -C $(JEMALLOC)
218 + endif
219 ++endif
220 + ifeq ($(USE_LUAJIT),1)
221 + $(MAKE) -C $(LUAJIT) Q= TARGET_SONAME=libluajit.so CCDEBUG=-g
222 + endif
223 ++ifeq ($(USE_SYSTEM_JANSSON),0)
224 + $(MAKE) -C $(JANSSON)
225 ++endif
226 + $(MAKE) -C $(COMMON) CF=$(CF) EXT_CFLAGS="$(EXT_CFLAGS)"
227 + $(MAKE) -C $(CF)
228 + $(MAKE) -C $(MOD_LUA) CF=$(CF) COMMON=$(COMMON) LUA_CORE=$(LUA_CORE) EXT_CFLAGS="$(EXT_CFLAGS)" USE_LUAJIT=$(USE_LUAJIT) LUAJIT=$(LUAJIT)
229 +@@ -174,16 +178,24 @@ mexp2: mexp1
230 + $(MAKE) MEXP_PHASE=2 SRCDIR=$(realpath $(MEXP_DIR))/
231 +
232 + $(JANSSON)/configure:
233 ++ifeq ($(USE_SYSTEM_JANSSON),0)
234 + cd $(JANSSON) && autoreconf -i
235 ++endif
236 +
237 + $(JANSSON)/Makefile: $(JANSSON)/configure
238 ++ifeq ($(USE_SYSTEM_JANSSON),0)
239 + cd $(JANSSON) && ./configure $(JANSSON_CONFIG_OPT)
240 ++endif
241 +
242 + $(JEMALLOC)/configure:
243 ++ifeq ($(USE_SYSTEM_JEM),0)
244 + cd $(JEMALLOC) && autoconf
245 ++endif
246 +
247 + $(JEMALLOC)/Makefile: $(JEMALLOC)/configure
248 ++ifeq ($(USE_SYSTEM_JEM),0)
249 + cd $(JEMALLOC) && ./configure $(JEM_CONFIG_OPT)
250 ++endif
251 +
252 + $(LUAJIT)/src/luaconf.h: $(LUAJIT)/src/luaconf.h.orig
253 + ln -s $(notdir $<) $@
254 +diff --git a/make_in/Makefile.vars b/make_in/Makefile.vars
255 +index efe3226..0b54701 100644
256 +--- a/make_in/Makefile.vars
257 ++++ b/make_in/Makefile.vars
258 +@@ -31,6 +31,12 @@ ifeq ($(USE_ASM),1)
259 + EXT_CFLAGS += -DUSE_ASM
260 + endif
261 +
262 ++# Use the system provided JEMalloc memory allocator? [By default, no.]
263 ++USE_SYSTEM_JEM = 0
264 ++
265 ++# Use the system provided Jansson JSON API Library? [By default, no.]
266 ++USE_SYSTEM_JANSSON = 0
267 ++
268 + # Use the JEMalloc memory allocator? [By default, yes.]
269 + USE_JEM = 1
270 +
271
272 diff --git a/dev-db/aerospike-server-community/files/aerospike.conf b/dev-db/aerospike-server-community/files/aerospike.conf
273 new file mode 100644
274 index 0000000..842873b
275 --- /dev/null
276 +++ b/dev-db/aerospike-server-community/files/aerospike.conf
277 @@ -0,0 +1,70 @@
278 +# Aerospike database configuration file.
279 +
280 +service {
281 + user root
282 + group root
283 + paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
284 + pidfile /run/aerospike/aerospike.pid
285 + service-threads 4
286 + transaction-queues 4
287 + transaction-threads-per-queue 4
288 + proto-fd-max 15000
289 +}
290 +
291 +logging {
292 + # Log file must be an absolute path.
293 + file /var/log/aerospike/aerospike.log {
294 + context any info
295 + }
296 +}
297 +
298 +network {
299 + service {
300 + address any
301 + port 3000
302 + }
303 +
304 + heartbeat {
305 + mode multicast
306 + address 239.1.99.222
307 + port 9918
308 +
309 + # To use unicast-mesh heartbeats, remove the 3 lines above, and see
310 + # aerospike_mesh.conf for alternative.
311 +
312 + interval 150
313 + timeout 10
314 + }
315 +
316 + fabric {
317 + port 3001
318 + }
319 +
320 + info {
321 + port 3003
322 + }
323 +}
324 +
325 +namespace test {
326 + replication-factor 2
327 + memory-size 4G
328 + default-ttl 30d # 30 days, use 0 to never expire/evict.
329 +
330 + storage-engine memory
331 +}
332 +
333 +namespace bar {
334 + replication-factor 2
335 + memory-size 4G
336 + default-ttl 30d # 30 days, use 0 to never expire/evict.
337 +
338 + storage-engine memory
339 +
340 + # To use file storage backing, comment out the line above and use the
341 + # following lines instead.
342 +# storage-engine device {
343 +# file /opt/aerospike/data/bar.dat
344 +# filesize 16G
345 +# data-in-memory true # Store data in memory in addition to file.
346 +# }
347 +}
348
349 diff --git a/dev-db/aerospike-server-community/files/aerospike.init b/dev-db/aerospike-server-community/files/aerospike.init
350 new file mode 100644
351 index 0000000..1ded43a
352 --- /dev/null
353 +++ b/dev-db/aerospike-server-community/files/aerospike.init
354 @@ -0,0 +1,53 @@
355 +#!/sbin/runscript
356 +# Copyright 1999-2014 Gentoo Foundation
357 +# Distributed under the terms of the GNU General Public License v2
358 +
359 +config_file=${config_file:-/etc/aerospike/${SVCNAME}.conf}
360 +run_dir=${run_dir:-/run/aerospike}
361 +
362 +command="/usr/bin/asd"
363 +command_args="--config-file ${config_file}"
364 +command_background="false"
365 +pidfile=${run_dir}/${SVCNAME}.pid
366 +user=${user:-aerospike}
367 +group=${group:-aerospike}
368 +start_stop_daemon_args="--user ${user} --group ${group}"
369 +required_files="${config_file}"
370 +
371 +depend() {
372 + use net
373 +}
374 +
375 +set_shmall() {
376 + mem=`/sbin/sysctl -n kernel.shmall`
377 + min=4294967296
378 + if [ ${#mem} -le ${#min} ]; then
379 + if [ $mem -lt $min ]; then
380 + ewarn "kernel.shmall too low, setting to 4G pages = 16TB"
381 + /sbin/sysctl -w kernel.shmall=$min
382 + fi
383 + fi
384 +}
385 +
386 +set_shmmax() {
387 + mem=`/sbin/sysctl -n kernel.shmmax`
388 + min=1073741824
389 + if [ ${#mem} -le ${#min} ]; then
390 + if [ $mem -lt $min ]; then
391 + ewarn "kernel.shmmax too low, setting to 1GB"
392 + /sbin/sysctl -w kernel.shmmax=$min
393 + fi
394 + fi
395 +}
396 +
397 +start_pre() {
398 + checkpath -d -m 0755 -o "${user}":"${group}" "${run_dir}"
399 + set_shmall
400 + set_shmmax
401 + ulimit -n 100000
402 + if [ -n $LD_PRELOAD ]; then export LD_PRELOAD; fi
403 +}
404 +
405 +start_post() {
406 + ewaitfile 60 "${pidfile}"
407 +}
408
409 diff --git a/dev-db/aerospike-server-community/files/aerospike.logrotate b/dev-db/aerospike-server-community/files/aerospike.logrotate
410 new file mode 100644
411 index 0000000..04aabc4
412 --- /dev/null
413 +++ b/dev-db/aerospike-server-community/files/aerospike.logrotate
414 @@ -0,0 +1,10 @@
415 +/var/log/aerospike/aerospike.log {
416 + daily
417 + rotate 90
418 + dateext
419 + compress
420 + olddir /var/log/aerospike/
421 + postrotate
422 + kill -HUP `cat /var/run/aerospike/aerospike.pid`
423 + endscript
424 +}
425
426 diff --git a/dev-db/aerospike-server-community/files/aerospike_mesh.conf b/dev-db/aerospike-server-community/files/aerospike_mesh.conf
427 new file mode 100644
428 index 0000000..26274f3
429 --- /dev/null
430 +++ b/dev-db/aerospike-server-community/files/aerospike_mesh.conf
431 @@ -0,0 +1,73 @@
432 +# Aerospike database configuration file for deployments using mesh heartbeats.
433 +
434 +service {
435 + user root
436 + group root
437 + paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
438 + pidfile /run/aerospike/aerospike.pid
439 + service-threads 4
440 + transaction-queues 4
441 + transaction-threads-per-queue 4
442 + proto-fd-max 15000
443 +}
444 +
445 +logging {
446 + # Log file must be an absolute path.
447 + file /var/log/aerospike/aerospike.log {
448 + context any info
449 + }
450 +}
451 +
452 +network {
453 + service {
454 + address any
455 + port 3000
456 + }
457 +
458 + heartbeat {
459 + mode mesh
460 + port 3002 # Heartbeat port for this node.
461 +
462 + # List one or more other nodes, one ip-address & port per line:
463 + mesh-seed-address-port 10.10.10.10 3002
464 +# mesh-seed-address-port 10.10.10.11 3002
465 +# mesh-seed-address-port 10.10.10.12 3002
466 +# mesh-seed-address-port 10.10.10.13 3002
467 +# mesh-seed-address-port 10.10.10.14 3002
468 +
469 + interval 250
470 + timeout 10
471 + }
472 +
473 + fabric {
474 + port 3001
475 + }
476 +
477 + info {
478 + port 3003
479 + }
480 +}
481 +
482 +namespace test {
483 + replication-factor 2
484 + memory-size 4G
485 + default-ttl 30d # 30 days, use 0 to never expire/evict.
486 +
487 + storage-engine memory
488 +}
489 +
490 +namespace bar {
491 + replication-factor 2
492 + memory-size 4G
493 + default-ttl 30d # 30 days, use 0 to never expire/evict.
494 +
495 + storage-engine memory
496 +
497 + # To use file storage backing, comment out the line above and use the
498 + # following lines instead.
499 +# storage-engine device {
500 +# file /opt/aerospike/data/bar.dat
501 +# filesize 16G
502 +# data-in-memory true # Store data in memory in addition to file.
503 +# }
504 +}
505
506 diff --git a/dev-db/aerospike-server-community/files/aerospike_ssd.conf b/dev-db/aerospike-server-community/files/aerospike_ssd.conf
507 new file mode 100644
508 index 0000000..3d75bd6
509 --- /dev/null
510 +++ b/dev-db/aerospike-server-community/files/aerospike_ssd.conf
511 @@ -0,0 +1,68 @@
512 +# Aerospike database configuration file for deployments using raw storage.
513 +
514 +service {
515 + user root
516 + group root
517 + paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
518 + pidfile /run/aerospike/aerospike.pid
519 + service-threads 8
520 + transaction-queues 8
521 + transaction-threads-per-queue 8
522 + proto-fd-max 15000
523 +}
524 +
525 +logging {
526 + # Log file must be an absolute path.
527 + file /var/log/aerospike/aerospike.log {
528 + context any info
529 + }
530 +}
531 +
532 +network {
533 + service {
534 + address any
535 + port 3000
536 + }
537 +
538 + heartbeat {
539 + mode multicast
540 + address 239.1.99.222
541 + port 9918
542 +
543 + # To use unicast-mesh heartbeats, remove the 3 lines above, and see
544 + # aerospike_mesh.conf for alternative.
545 +
546 + interval 150
547 + timeout 10
548 + }
549 +
550 + fabric {
551 + port 3001
552 + }
553 +
554 + info {
555 + port 3003
556 + }
557 +}
558 +
559 +namespace test {
560 + replication-factor 2
561 + memory-size 4G
562 + default-ttl 30d # 30 days, use 0 to never expire/evict.
563 +
564 + # Warning - legacy data in defined raw partition devices will be erased.
565 + # These partitions must not be mounted by the file system.
566 + storage-engine device {
567 + # Use one or more lines like those below with actual device paths.
568 +# device /dev/sdb
569 +# device /dev/sdc
570 +
571 + # The 2 lines below optimize for SSD.
572 + scheduler-mode noop
573 + write-block-size 128K
574 +
575 + # Use the line below to store data in memory in addition to devices.
576 +# data-in-memory true
577 + }
578 +}
579 +
580
581 diff --git a/dev-db/aerospike-server-community/metadata.xml b/dev-db/aerospike-server-community/metadata.xml
582 new file mode 100644
583 index 0000000..1bb7f2a
584 --- /dev/null
585 +++ b/dev-db/aerospike-server-community/metadata.xml
586 @@ -0,0 +1,10 @@
587 +<?xml version="1.0" encoding="UTF-8"?>
588 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
589 +<pkgmetadata>
590 + <maintainer>
591 + <email>patrick@g.o</email>
592 + </maintainer>
593 + <use>
594 + <flag name="tools">Install extra tools</flag>
595 + </use>
596 +</pkgmetadata>