Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/blueness:master commit in: net-p2p/ppcoind/files/, net-p2p/ppcoind/
Date: Sat, 30 Nov 2013 18:44:31
Message-Id: 1385837123.a783543c96ed52202f5e7d8b6e05c34ce3816854.blueness@gentoo
1 commit: a783543c96ed52202f5e7d8b6e05c34ce3816854
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Sat Nov 30 18:45:23 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 30 18:45:23 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/blueness.git;a=commit;h=a783543c
7
8 net-p2p/ppcoind: initial commit
9
10 Package-Manager: portage-2.2.7
11 Manifest-Sign-Key: 0xF52D4BBA
12
13 ---
14 net-p2p/ppcoind/Manifest | 28 ++++++++
15 net-p2p/ppcoind/files/ppcoin.conf | 8 +++
16 net-p2p/ppcoind/files/ppcoin.confd | 10 +++
17 net-p2p/ppcoind/files/ppcoin.initd | 104 ++++++++++++++++++++++++++++
18 net-p2p/ppcoind/files/ppcoin.service | 30 +++++++++
19 net-p2p/ppcoind/files/ppcoind.logrotate | 7 ++
20 net-p2p/ppcoind/metadata.xml | 11 +++
21 net-p2p/ppcoind/ppcoind-0.3.0.ebuild | 116 ++++++++++++++++++++++++++++++++
22 8 files changed, 314 insertions(+)
23
24 diff --git a/net-p2p/ppcoind/Manifest b/net-p2p/ppcoind/Manifest
25 new file mode 100644
26 index 0000000..9375613
27 --- /dev/null
28 +++ b/net-p2p/ppcoind/Manifest
29 @@ -0,0 +1,28 @@
30 +-----BEGIN PGP SIGNED MESSAGE-----
31 +Hash: SHA256
32 +
33 +AUX ppcoin.conf 80 SHA256 541ae10cc2246b620de3e7efa97eee59efacf83d28ea5f1297a121d0708226d2 SHA512 43bef890505a1fac88887bb39e9fdd4ec673ae8838a40279b33711e970551f5a75ac25171c41f8c83de2c953b157f7a3f57171e868fd9f626007d9909331a19f WHIRLPOOL 728e38b62da2c7c3a1149ac511b92d156f7b3c51dacfadd7ce74d9e6f915a6547c4cc8d34159243f50eee333c63b35949b311ea5a7f48a6c3bf17a5d4d47c123
34 +AUX ppcoin.confd 233 SHA256 fb877ae7608b5c2aaae29e522d8cfb42e51e064831c64b228b64da2b11aac64d SHA512 efb8f210143d993e922668e3daffc8bb74406be2f912729f68ebfcbcb3d44e10e0fed495963c4273a95099d37f3afc66b49616724bd827e6b4359b2e3a27d9c3 WHIRLPOOL 12e7a8e82d33b023be054c6c019cc61a5783e32e108e54358c76789e1e89ce441a095561e1a4750cb341350ef7da7a97b6ebfb06f8ec3a7fcd2809e27d5eb110
35 +AUX ppcoin.initd 2451 SHA256 36146630912dcf0468f0ec8311baa3eb5150e596c8a5963f293610804ba818dc SHA512 ed289b877653b42132a3c9b85832a7248da2c2956adffadfe71523b7d01feafd7738ebf050c0dee974237ea015b46610221ecb1d706ea4593e53ee6cb6c02448 WHIRLPOOL 5460640f1aed58cca4e1b3a45d0e93f8997a16df21c75beb1972dd4371bdf166a6d3b067acd1167a850e97794abd2943bebd12b8cac7cfd8ee9252cbdc0968e5
36 +AUX ppcoin.service 859 SHA256 df6e7f616816a07efb4d3d627d1ee80699f541bdcbafce7ba7aef2640291bce9 SHA512 8395ef4f5b026757f4202c78eb55b6978d2cdec49f6db801bb6daddea8d8a524afacf53368a78c3a7055ce5cc4ada53ac6c88567b02951fa7a722e5dd9ebd3c1 WHIRLPOOL bbd546e3d7043132f65117e567fe0f0b756f60093184e67316398cc8589f46a5029d9118431a4fa2d5e9e834c1f2beb180f0e5e20f8d7a8ae1fa96273b278076
37 +AUX ppcoind.logrotate 107 SHA256 5aefed737e73b6393e2f004318b34429616a35187131bade4743a1c8aa7e7d91 SHA512 bf36d07a6dcebcc50ac7e0b74433333902df6ef22396a876b96289cca90882720ed95ef0cc8fbf3abeea6800cbe2386e56b27bb798922f3be98134dee1caed69 WHIRLPOOL 68521503b26df24b66dd20a9ef3174ffc1427abf483185b709d46fc54d148250e4a85ee887e292398063205737640b7accd7365cd707ea5c3e80b72b503e3880
38 +DIST ppcoin-0.3.0.tar.gz 12233878 SHA256 919bb1c60eeebdd173ddcd4c83264f745bbf2af29410ded062f6c6bfce44f694 SHA512 c5f505a162e5044b3173c301d52b4851a6e3fbb4dbc2742c7204d583f534e235b1c8942b1afc5d9613d6a37009da83e1a9708fe4edfb68cb9717b76666bf029f WHIRLPOOL ab23d64672cfa9882d1dd23aad6a7448c9f4d7669557ddadabf80a1733682a46d4b5becc4605b40fbd2e943203897edfc4ba8904dee284bde055d81769404246
39 +EBUILD ppcoind-0.3.0.ebuild 2594 SHA256 d780ca7cccd02de0a5f98ed7dba31f11ee5a755e7e68f710ccf855d5de9f6eb6 SHA512 374e31345de23a6646d9d986c464cb7acfa85a3553e7276686a30dff71b5b5c251cb65b55b5687fa5f1519d5e9bdf0286bebb6d8156e5fb11cfa0f842de42931 WHIRLPOOL b1e7aa7c21ff651f8724078c46872c1ce46eb2842eb03fdcaa4a2f5890a7d3024ee707ced3268e56b0e051233e9b3fae27725c3b938adebb117dd6fac595a743
40 +MISC metadata.xml 327 SHA256 2009a65ac31a6a928926715ab212766020927524623581b18ee1f5026a6a689c SHA512 4d68f30b7c29aa5b6c3f7fd5c657ffbbe12706ce5d8d332cd8848906a27ae852e39d48219f6137a65c31db9c7693c2218edf8b6b1511cb1098d86bdb394cd0f9 WHIRLPOOL f7ad1bdb29423c9a88a721e77168aa35372a3411f77c775e2ac518eefc7ee39def4a307a66b4da02f80a6e9d8cdcff8fafa20da1792b7909e84bcad67598c4d9
41 +-----BEGIN PGP SIGNATURE-----
42 +Version: GnuPG v2.0.22 (GNU/Linux)
43 +
44 +iQIcBAEBCAAGBQJSmjJDAAoJEJOE+m71LUu61KwP/18OIC7AbiXAUxUunB+bRk87
45 +C5vW+VneqnltEVo/N6ts8BtNPp+PlwPiZ4smwN1h2+GSbkqyMK6mTFdKFqEbKh+U
46 +r3v7VWbY8EBSJ5Xh+xMGM8WZlqFjazAI7inj2q8YtIYPwz5UgYiqTorHVNQBg7c5
47 +1wvSZGbTNRcW3KTnjNZ1vaXK0EebkyL0jHOrFFUo0POHunQYz8vkq2ojgaYjEGuD
48 +o1kl8grsAsu2h6WSOlNkx51B98PYy3AV/AaZu4QzNF5lM67NntC4FCNu1NG5Gpbs
49 +GJ3UR0/rRjPIwbnuodBnMepMB+H3Q6/hIlHO4GumGpsdJyesK1MKB9jr1noYf90D
50 +DJW7Ae5WriVB5gHr9jfrEZ0uZA8bpc2zawIVnYzqwNv8SdKCKWRihdxEOOab3pWI
51 +01gAjEBtmKspB6UScXDBdw3tQbf9UD9rgrDleriw0NIQQRXMcsnj3rHbLLTUkjsY
52 +XkHJKzb+yEnKcvXhqV65MPFn5fnJvfmM4+FMPPKrzanU00LlsLHyuHuAiYPmWBUY
53 +8fvmvihUGjcn0h+96oH87yfWH47Ju5vLyeWhgPcJVI5YO7AIo7MMrRuF9Z34dQwg
54 +nI1YokOAqvc/WMicKpwCT8QB5dtJaGmirA7pes9kknD7fYXEoFk7RNkVWkHSZedz
55 +t6Ye6Vu+iSgR0hLIHrWD
56 +=wdKy
57 +-----END PGP SIGNATURE-----
58
59 diff --git a/net-p2p/ppcoind/files/ppcoin.conf b/net-p2p/ppcoind/files/ppcoin.conf
60 new file mode 100644
61 index 0000000..c6a55f3
62 --- /dev/null
63 +++ b/net-p2p/ppcoind/files/ppcoin.conf
64 @@ -0,0 +1,8 @@
65 +# http://www.bitcoin.org/smf/index.php?topic=644.0
66 +#rpcuser=
67 +#rpcpassword=
68 +
69 +
70 +
71 +
72 +
73
74 diff --git a/net-p2p/ppcoind/files/ppcoin.confd b/net-p2p/ppcoind/files/ppcoin.confd
75 new file mode 100644
76 index 0000000..81fbf49
77 --- /dev/null
78 +++ b/net-p2p/ppcoind/files/ppcoin.confd
79 @@ -0,0 +1,10 @@
80 +# Config file for /etc/init.d/ppcoind
81 +
82 +# owner of ppciond process (don't change, must be existing)
83 +PPCOIN_USER="ppcoin"
84 +
85 +# See http://www.bitcoin.org/smf/index.php?topic=1063
86 +PPCOIN_OPTS="${PPCOIN_OPTS}"
87 +
88 +# nice level
89 +NICELEVEL="19"
90
91 diff --git a/net-p2p/ppcoind/files/ppcoin.initd b/net-p2p/ppcoind/files/ppcoin.initd
92 new file mode 100644
93 index 0000000..1c73731
94 --- /dev/null
95 +++ b/net-p2p/ppcoind/files/ppcoin.initd
96 @@ -0,0 +1,104 @@
97 +#!/sbin/runscript
98 +# Distributed under the terms of the GNU General Public License, v2 or later
99 +
100 +VARDIR="/var/lib/ppcoin"
101 +CONFFILE="${VARDIR}/.ppcoin/ppcoin.conf"
102 +
103 +depend() {
104 + need net
105 +}
106 +
107 +checkconfig() {
108 + if [[ "${PPCOIN_USER}" == "" ]] ; then
109 + eerror "Please edit /etc/conf.d/ppcoind"
110 + eerror "A user must be specified to run ppcoind as that user."
111 + eerror "Modify USER to your needs (you may also add a group after a colon)"
112 + return 1
113 + fi
114 + if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
115 + eerror "Please edit /etc/conf.d/ppcoind"
116 + eerror "Specified user must exist!"
117 + return 1
118 + fi
119 + if `echo "${PPCOIN_USER}" | grep ':' -sq` ; then
120 + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${PPCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
121 + eerror "Please edit /etc/conf.d/ppcoind"
122 + eerror "Specified group must exist!"
123 + return 1
124 + fi
125 + fi
126 + if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
127 + eerror "Please edit `readlink -f ${CONFFILE}`"
128 + eerror "There must be at least a line assigning rpcpassword=something-secure"
129 + return 1
130 + fi
131 + if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
132 + eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
133 + return 1
134 + fi
135 + return 0
136 +}
137 +
138 +start() {
139 + checkconfig || return 1
140 + ebegin "Starting PPcoind daemon"
141 +
142 + pkg-config openrc
143 + if [ $? = 0 ]; then
144 + start_openrc
145 + else
146 + start_baselayout
147 + fi
148 +}
149 +
150 +stop() {
151 + ebegin "Stopping PPcoin daemon"
152 +
153 + pkg-config openrc
154 + if [ $? = 0 ]; then
155 + stop_openrc
156 + else
157 + stop_baselayout
158 + fi
159 +}
160 +
161 +start_openrc() {
162 + start-stop-daemon \
163 + --start --user "${PPCOIN_USER}" --name ppcoind \
164 + --pidfile /var/run/ppcoind.pid --make-pidfile \
165 + --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
166 + --nicelevel "${NICELEVEL}" \
167 + --background \
168 + --wait 2000 \
169 + -- ${PPCOIN_OPTS}
170 + eend $?
171 +}
172 +
173 +stop_openrc() {
174 + start-stop-daemon --stop --user "${PPCOIN_USER}" \
175 + --name ppcoind --pidfile /var/run/ppcoind.pid \
176 + --wait 30000 \
177 + --progress
178 + eend $?
179 +}
180 +
181 +start_baselayout() {
182 + start-stop-daemon \
183 + --start --user "${PPCOIN_USER}" --name ppcoind \
184 + --pidfile /var/run/ppcoind.pid --make-pidfile \
185 + --env HOME="${VARDIR}" --exec /usr/bin/ppcoind \
186 + --chuid "${PPCOIN_USER}" \
187 + --nicelevel "${NICELEVEL}" \
188 + --background \
189 + -- ${PPCOIN_OPTS}
190 + eend $?
191 +}
192 +
193 +stop_baselayout() {
194 + start-stop-daemon \
195 + --stop \
196 + --user "${PPCOIN_USER}" \
197 + --name ppcoind \
198 + --pidfile /var/run/ppcoind.pid
199 + eend $?
200 +}
201
202 diff --git a/net-p2p/ppcoind/files/ppcoin.service b/net-p2p/ppcoind/files/ppcoin.service
203 new file mode 100644
204 index 0000000..3a83178
205 --- /dev/null
206 +++ b/net-p2p/ppcoind/files/ppcoin.service
207 @@ -0,0 +1,30 @@
208 +# It's not recommended to modify this file in-place, because it will be
209 +# overwritten during package upgrades. If you want to customize, the
210 +# best way is to create file
211 +# "/etc/systemd/system/ppcoind.service.d/*.conf"
212 +# containing your changes
213 +
214 +# For example, if you want to change some daemon and/or unit options,
215 +# create a file named
216 +# "/etc/systemd/system/ppcoind.service.d/myopts.conf"
217 +# containing:
218 +# [Service]
219 +# Environment="PPCOIN_OPTS=-debug -logtimestamps"
220 +# Nice=10
221 +# This will override the setting appearing below.
222 +
223 +# Note that almost all daemon options could be specified in
224 +# /etc/ppcoin/ppcoin.conf
225 +
226 +[Unit]
227 +Description=PPcoin Daemon
228 +After=network.target
229 +
230 +[Service]
231 +User=ppcoin
232 +Environment=PPCOIN_OPTS=
233 +ExecStart=/usr/bin/ppcoind -daemon=0 $PPCOIN_OPTS
234 +ExecReload=/bin/kill -HUP $MAINPID
235 +
236 +[Install]
237 +WantedBy=multi-user.target
238
239 diff --git a/net-p2p/ppcoind/files/ppcoind.logrotate b/net-p2p/ppcoind/files/ppcoind.logrotate
240 new file mode 100644
241 index 0000000..4ea060b
242 --- /dev/null
243 +++ b/net-p2p/ppcoind/files/ppcoind.logrotate
244 @@ -0,0 +1,7 @@
245 +/var/lib/ppcoin/.ppcoin/debug.log {
246 + weekly
247 + sharedscripts
248 + postrotate
249 + killall -HUP ppcoind
250 + endscript
251 +}
252
253 diff --git a/net-p2p/ppcoind/metadata.xml b/net-p2p/ppcoind/metadata.xml
254 new file mode 100644
255 index 0000000..5c226ba
256 --- /dev/null
257 +++ b/net-p2p/ppcoind/metadata.xml
258 @@ -0,0 +1,11 @@
259 +<?xml version="1.0" encoding="UTF-8"?>
260 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
261 +<pkgmetadata>
262 + <maintainer>
263 + <email>blueness@g.o</email>
264 + <name>Anthony G. Basile</name>
265 + </maintainer>
266 + <use>
267 + <flag name='logrotate'>Use app-admin/logrotate for rotating logs</flag>
268 + </use>
269 +</pkgmetadata>
270
271 diff --git a/net-p2p/ppcoind/ppcoind-0.3.0.ebuild b/net-p2p/ppcoind/ppcoind-0.3.0.ebuild
272 new file mode 100644
273 index 0000000..993e061
274 --- /dev/null
275 +++ b/net-p2p/ppcoind/ppcoind-0.3.0.ebuild
276 @@ -0,0 +1,116 @@
277 +# Copyright 1999-2013 Gentoo Foundation
278 +# Distributed under the terms of the GNU General Public License v2
279 +# $Header: $
280 +
281 +EAPI=5
282 +
283 +DB_VER="4.8"
284 +
285 +inherit bash-completion-r1 db-use eutils systemd
286 +
287 +MyPV="${PV/_/-}"
288 +MyPN="ppcoin"
289 +MyP="${MyPN}-${MyPV}"
290 +
291 +DESCRIPTION="Cryptocurrency forked from Bitcoin which aims to be energy efficiency."
292 +HOMEPAGE="http://peercoin.net/"
293 +SRC_URI="mirror://sourceforge/${MyPN}/${MyP}-linux.tar.gz -> ${MyP}.tar.gz"
294 +
295 +LICENSE="MIT ISC GPL-2"
296 +SLOT="0"
297 +KEYWORDS="~amd64 ~x86"
298 +IUSE="examples ipv6 logrotate upnp"
299 +
300 +RDEPEND="
301 + >=dev-libs/boost-1.41.0[threads(+)]
302 + dev-libs/openssl:0[-bindist]
303 + logrotate? (
304 + app-admin/logrotate
305 + )
306 + upnp? (
307 + net-libs/miniupnpc
308 + )
309 + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
310 +"
311 +DEPEND="${RDEPEND}
312 + >=app-shells/bash-4.1
313 + sys-apps/sed
314 +"
315 +
316 +S="${WORKDIR}/${MyP}-linux/src"
317 +
318 +pkg_setup() {
319 + local UG='ppcoin'
320 + enewgroup "${UG}"
321 + enewuser "${UG}" -1 -1 /var/lib/ppcoin "${UG}"
322 +}
323 +
324 +src_prepare() {
325 + if has_version '>=dev-libs/boost-1.52'; then
326 + sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
327 + fi
328 +}
329 +
330 +src_configure() {
331 + OPTS=()
332 +
333 + OPTS+=("DEBUGFLAGS=")
334 + OPTS+=("CXXFLAGS=${CXXFLAGS}")
335 + OPTS+=("LDFLAGS=${LDFLAGS}")
336 +
337 + if use upnp; then
338 + OPTS+=("USE_UPNP=1")
339 + else
340 + OPTS+=("USE_UPNP=-")
341 + fi
342 +
343 + use ipv6 || OPTS+=("USE_IPV6=-")
344 +
345 + OPTS+=("USE_SYSTEM_LEVELDB=1")
346 + OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
347 + OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
348 +
349 + cd src || die
350 + emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
351 +}
352 +
353 +#Tests are broken
354 +#src_test() {
355 +# cd src || die
356 +# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_ppcoin
357 +# ./test_ppcoin || die 'Tests failed'
358 +#}
359 +
360 +src_install() {
361 + dobin src/${PN}
362 +
363 + insinto /etc/ppcoin
364 + doins "${FILESDIR}/ppcoin.conf"
365 + fowners ppcoin:ppcoin /etc/ppcoin/ppcoin.conf
366 + fperms 600 /etc/ppcoin/ppcoin.conf
367 +
368 + newconfd "${FILESDIR}/ppcoin.confd" ${PN}
369 + newinitd "${FILESDIR}/ppcoin.initd" ${PN}
370 + systemd_dounit "${FILESDIR}/ppcoin.service"
371 +
372 + keepdir /var/lib/ppcoin/.ppcoin
373 + fperms 700 /var/lib/ppcoin
374 + fowners ppcoin:ppcoin /var/lib/ppcoin/
375 + fowners ppcoin:ppcoin /var/lib/ppcoin/.ppcoin
376 + dosym /etc/ppcoin/ppcoin.conf /var/lib/ppcoin/.ppcoin/ppcoin.conf
377 +
378 + dodoc README
379 + newman contrib/debian/manpages/bitcoind.1 ppcoind.1
380 + newman contrib/debian/manpages/bitcoin.conf.5 ppcoin.conf.5
381 +
382 + if use examples; then
383 + docinto examples
384 + dodoc -r contrib/{bitrpc,gitian-descriptors,gitian-downloader,pyminer,wallettools}
385 +
386 + fi
387 +
388 + if use logrotate; then
389 + insinto /etc/logrotate.d
390 + newins "${FILESDIR}/ppcoind.logrotate" ppcoind
391 + fi
392 +}