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/litecoind/, net-p2p/litecoind/files/
Date: Sat, 30 Nov 2013 00:24:52
Message-Id: 1385771125.c3634896574b95cb3b23ecc0640fce419f246128.blueness@gentoo
1 commit: c3634896574b95cb3b23ecc0640fce419f246128
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Sat Nov 30 00:25:25 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 30 00:25:25 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/blueness.git;a=commit;h=c3634896
7
8 net-p2p/litecoind: initial commit
9
10 Package-Manager: portage-2.2.7
11 Manifest-Sign-Key: 0xF52D4BBA
12
13 ---
14 net-p2p/litecoind/Manifest | 9 +
15 net-p2p/litecoind/files/litecoin-sys_leveldb.patch | 193 +++++++++++++++++++++
16 net-p2p/litecoind/files/litecoin.conf | 8 +
17 net-p2p/litecoind/files/litecoin.confd | 10 ++
18 net-p2p/litecoind/files/litecoin.initd | 104 +++++++++++
19 net-p2p/litecoind/files/litecoin.logrotate | 7 +
20 net-p2p/litecoind/files/litecoin.service | 30 ++++
21 net-p2p/litecoind/litecoind-0.8.5.3_rc3.ebuild | 123 +++++++++++++
22 net-p2p/litecoind/metadata.xml | 11 ++
23 9 files changed, 495 insertions(+)
24
25 diff --git a/net-p2p/litecoind/Manifest b/net-p2p/litecoind/Manifest
26 new file mode 100644
27 index 0000000..9e7ff43
28 --- /dev/null
29 +++ b/net-p2p/litecoind/Manifest
30 @@ -0,0 +1,9 @@
31 +AUX litecoin-sys_leveldb.patch 7264 SHA256 61e2f69923572903fe7a7f23b38eb6b4c71f19f09ca7881da085174688d3d684 SHA512 96030e7ce3062facf9231b9ae99945c5eb5f5989cb274e9249ebe444b07970d17ed46ec721ad89cf9c607ca8bb86c0a41024e25ab6859df80029b3f03fad0038 WHIRLPOOL 742c70b2a55b3f45862b09717737415f8ff69c5b2700153fb9df810e3a4665df82112e01d30d089403ff5cc21c7b3c25fb13b0ba6f718bfb82c364a546615124
32 +AUX litecoin.conf 80 SHA256 541ae10cc2246b620de3e7efa97eee59efacf83d28ea5f1297a121d0708226d2 SHA512 43bef890505a1fac88887bb39e9fdd4ec673ae8838a40279b33711e970551f5a75ac25171c41f8c83de2c953b157f7a3f57171e868fd9f626007d9909331a19f WHIRLPOOL 728e38b62da2c7c3a1149ac511b92d156f7b3c51dacfadd7ce74d9e6f915a6547c4cc8d34159243f50eee333c63b35949b311ea5a7f48a6c3bf17a5d4d47c123
33 +AUX litecoin.confd 245 SHA256 32f96a43c8c2aa049151a0fbc27b290e863d1b1a3c78eef5cb054fe5bad21011 SHA512 57de4657db4f0a3873b6aac700bc78fe8ecdfacdc0acb3fee13866389fc02b7100f4e7252ceb19f76e03d1ca9353008a9ccf40fc48a1a612c6b8fa4a35bae150 WHIRLPOOL 9c54b91df1225d812011af2fe27059262a70754e8a396f91a598479a76193d36203f8825af2a8e30f21d8b91c6df5ba734217f32f33c23bf6ca7a16498f43f28
34 +AUX litecoin.initd 2511 SHA256 0c7e6671312e43d3f0373489ee93ee4dab379d53f38f724b38a3727d2f1480c8 SHA512 3ae65555aba11d8e4d292021e5b4b45ebb4b65a1fda81ed3836c5528319e5268391732f44be1e2b80a1f3d189729c29b40c1705fbd52b8588021cdac1f36f5d0 WHIRLPOOL e81d79e24f53c4d0ae1b5d9da9ee8e4726fe15d76f992c5cf6a9816d70675177934f8b00937e777c037f3d496c2af923f15292faea765f7d5d5f4c261de860a1
35 +AUX litecoin.logrotate 113 SHA256 dce250c9f27ed9b36fa9376d92fedf89bf6f7f523360dc5baaa65179fd1d504b SHA512 eaa9f462be8dc755b675e4d5cb3ad271e3b1053edfa06df7862fa887160c849c768d2a268a7c8b52d1cfc834c186780b71435ee65475ea6c6692c18bded48dec WHIRLPOOL 3e771d6c2dfddd291386a1ed98009f1778e561a1b8ac43507f3ca709d1c389c3b8d6db5128ade485a0b92ba56b2388727935149af391fe3ef6f9e18ec432c04e
36 +AUX litecoin.service 879 SHA256 be344624575e7e69203bd7e17abc930847e27d95217b65b74ebfcf2e59a4bbca SHA512 f05009fdf4c38d78867588d84a6031d6bed81ad74c08d97a8fae16706f04ce61926dbde775183e0219a33e3a84e5fdad92acaab62e15156f3d07c15677e0f148 WHIRLPOOL def62eeef8c032a372c0624860369a32ff27b4099fa3ff720ac908139fb2c23e1aab4f4b4e623d890d309a5114352f2feb59ae105563b462e82667a52804c17f
37 +DIST litecoin-0.8.5.3-rc3.tar.gz 4804918 SHA256 67d2f14ab654825bf21abbb4d2c4681a6af4c3b074a2a1813d6da63fea3a8afc SHA512 640cd8a60122cc26889c81bddd20057c20557ae9a9eea431b68421f5ee37f7938ca2776196649b553b05977278242c4d1bab520671cae549227c1f69835a72b5 WHIRLPOOL f327423e13a1d8e092c54f6201362a8c32acff87a71fd17a737c22e57e09472f579dfdbedcd398fabab75e8f5f7a5559ff566df737fec410baf8dfe80fb3bb6d
38 +EBUILD litecoind-0.8.5.3_rc3.ebuild 2960 SHA256 5472161a54f7fd6d5f6dfa6360e5a075b76c8e9a1c2a781238dfcbb4f14ca740 SHA512 1a36e6e76a6b7b7bd896beeef7d059b9bce77190f6f050cb29b4200c4de892023aa58c7ca5854582078c0e5641d64c461f8962dcfaa800163edfa5fda8be374b WHIRLPOOL 77995af42dd494c8423c5265417f0728dd0da9cb1251ff5f60da11407bd64c3654998cc6f32f85735e78b5c26c90172f1d9345a61ff56c7c6a3f610e3e69913f
39 +MISC metadata.xml 327 SHA256 2009a65ac31a6a928926715ab212766020927524623581b18ee1f5026a6a689c SHA512 4d68f30b7c29aa5b6c3f7fd5c657ffbbe12706ce5d8d332cd8848906a27ae852e39d48219f6137a65c31db9c7693c2218edf8b6b1511cb1098d86bdb394cd0f9 WHIRLPOOL f7ad1bdb29423c9a88a721e77168aa35372a3411f77c775e2ac518eefc7ee39def4a307a66b4da02f80a6e9d8cdcff8fafa20da1792b7909e84bcad67598c4d9
40
41 diff --git a/net-p2p/litecoind/files/litecoin-sys_leveldb.patch b/net-p2p/litecoind/files/litecoin-sys_leveldb.patch
42 new file mode 100644
43 index 0000000..a4ae56a
44 --- /dev/null
45 +++ b/net-p2p/litecoind/files/litecoin-sys_leveldb.patch
46 @@ -0,0 +1,193 @@
47 +diff -Naur litecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro litecoin-0.8.5.3-rc3/bitcoin-qt.pro
48 +--- litecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro 2013-11-28 21:17:05.000000000 -0500
49 ++++ litecoin-0.8.5.3-rc3/bitcoin-qt.pro 2013-11-29 14:53:00.960537685 -0500
50 +@@ -5,7 +5,7 @@
51 + INCLUDEPATH += src src/json src/qt
52 + QT += core gui network
53 + greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
54 +-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
55 ++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV
56 + CONFIG += no_include_pwd
57 + CONFIG += thread
58 +
59 +@@ -101,25 +101,30 @@
60 + QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
61 + }
62 +
63 ++contains(USE_SYSTEM_LEVELDB, 1) {
64 ++ LIBS += -lleveldb
65 ++} else {
66 + INCLUDEPATH += src/leveldb/include src/leveldb/helpers
67 +-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
68 ++LIBS += $$PWD/src/leveldb/libleveldb.a
69 + !win32 {
70 + # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
71 +- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
72 ++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a
73 + } else {
74 + # make an educated guess about what the ranlib command is called
75 + isEmpty(QMAKE_RANLIB) {
76 + QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
77 + }
78 + LIBS += -lshlwapi
79 +- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
80 ++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
81 + }
82 + genleveldb.target = $$PWD/src/leveldb/libleveldb.a
83 + genleveldb.depends = FORCE
84 + PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
85 + QMAKE_EXTRA_TARGETS += genleveldb
86 ++}
87 + # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
88 +-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
89 ++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true
90 ++
91 +
92 + # regenerate src/build.h
93 + !win32|contains(USE_BUILD_INFO, 1) {
94 +diff -Naur litecoin-0.8.5.3-rc3.orig/src/leveldb.cpp litecoin-0.8.5.3-rc3/src/leveldb.cpp
95 +--- litecoin-0.8.5.3-rc3.orig/src/leveldb.cpp 2013-11-28 21:17:05.000000000 -0500
96 ++++ litecoin-0.8.5.3-rc3/src/leveldb.cpp 2013-11-29 14:55:33.760543008 -0500
97 +@@ -8,7 +8,9 @@
98 + #include <leveldb/env.h>
99 + #include <leveldb/cache.h>
100 + #include <leveldb/filter_policy.h>
101 +-#include <memenv/memenv.h>
102 ++#ifndef LEVELDB_WITHOUT_MEMENV
103 ++#include <memenv.h>
104 ++#endif
105 +
106 + #include <boost/filesystem.hpp>
107 +
108 +@@ -43,8 +45,12 @@
109 + options = GetOptions(nCacheSize);
110 + options.create_if_missing = true;
111 + if (fMemory) {
112 ++#ifndef LEVELDB_WITHOUT_MEMENV
113 + penv = leveldb::NewMemEnv(leveldb::Env::Default());
114 + options.env = penv;
115 ++#else
116 ++ throw std::runtime_error("CLevelDB(): compiled without memenv support");
117 ++#endif
118 + } else {
119 + if (fWipe) {
120 + printf("Wiping LevelDB in %s\n", path.string().c_str());
121 +diff -Naur litecoin-0.8.5.3-rc3.orig/src/makefile.unix litecoin-0.8.5.3-rc3/src/makefile.unix
122 +--- litecoin-0.8.5.3-rc3.orig/src/makefile.unix 2013-11-28 21:17:05.000000000 -0500
123 ++++ litecoin-0.8.5.3-rc3/src/makefile.unix 2013-11-29 15:08:58.337571033 -0500
124 +@@ -110,8 +110,7 @@
125 + # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work.
126 + xLDFLAGS=$(LDHARDENING) $(LDFLAGS)
127 +
128 +-OBJS= \
129 +- leveldb/libleveldb.a \
130 ++BASEOBJS := \
131 + obj/alert.o \
132 + obj/version.o \
133 + obj/checkpoints.o \
134 +@@ -120,7 +119,6 @@
135 + obj/crypter.o \
136 + obj/key.o \
137 + obj/db.o \
138 +- obj/init.o \
139 + obj/keystore.o \
140 + obj/main.o \
141 + obj/net.o \
142 +@@ -141,9 +139,17 @@
143 + obj/hash.o \
144 + obj/bloom.o \
145 + obj/noui.o \
146 +- obj/leveldb.o \
147 + obj/txdb.o
148 +
149 ++OBJS := \
150 ++ obj/leveldb.o \
151 ++ obj/init.o \
152 ++ $(BASEOBJS)
153 ++
154 ++TESTOBJS := \
155 ++ obj-test/leveldb.o \
156 ++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \
157 ++ $(BASEOBJS)
158 +
159 + ifdef USE_SSE2
160 + DEFS += -DUSE_SSE2
161 +@@ -156,15 +162,25 @@
162 + test check: test_litecoin FORCE
163 + ./test_litecoin
164 +
165 ++ifdef USE_SYSTEM_LEVELDB
166 ++ LIBS += -lleveldb
167 ++ TESTLIBS += -lmemenv
168 ++else
169 + #
170 + # LevelDB support
171 + #
172 + MAKEOVERRIDES =
173 +-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a
174 ++LIBS += $(CURDIR)/leveldb/libleveldb.a
175 ++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a
176 + DEFS += $(addprefix -I,$(CURDIR)/leveldb/include)
177 + DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers)
178 + leveldb/libleveldb.a:
179 +- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd ..
180 ++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd ..
181 ++leveldb/libmemenv.a:
182 ++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd ..
183 ++OBJS += leveldb/libleveldb.a
184 ++TESTOBJS += leveldb/libmemenv.a
185 ++endif
186 +
187 + # auto-generated dependencies:
188 + -include obj/*.P
189 +@@ -175,33 +191,34 @@
190 + version.cpp: obj/build.h
191 + DEFS += -DHAVE_BUILD_INFO
192 +
193 +-obj/%-sse2.o: %-sse2.cpp
194 +- $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
195 ++P_TO_D = \
196 + @cp $(@:%.o=%.d) $(@:%.o=%.P); \
197 +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
198 ++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
199 + -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
200 + rm -f $(@:%.o=%.d)
201 +
202 ++obj/%-sse2.o: %-sse2.cpp
203 ++ $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $<
204 ++ $(P_TO_D)
205 ++
206 + obj/%.o: %.cpp
207 +- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
208 +- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
209 +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
210 +- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
211 +- rm -f $(@:%.o=%.d)
212 ++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $<
213 ++ $(P_TO_D)
214 +
215 +-litecoind: $(OBJS:obj/%=obj/%)
216 ++litecoind: $(OBJS)
217 + $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS)
218 +
219 +-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
220 +-
221 + obj-test/%.o: test/%.cpp
222 + $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
223 +- @cp $(@:%.o=%.d) $(@:%.o=%.P); \
224 +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
225 +- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
226 +- rm -f $(@:%.o=%.d)
227 ++ $(P_TO_D)
228 ++
229 ++obj-test/leveldb.o: leveldb.cpp
230 ++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<
231 ++ $(P_TO_D)
232 ++
233 ++TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
234 +
235 +-test_litecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
236 ++test_litecoin: $(TESTOBJS)
237 + $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS)
238 +
239 + clean:
240
241 diff --git a/net-p2p/litecoind/files/litecoin.conf b/net-p2p/litecoind/files/litecoin.conf
242 new file mode 100644
243 index 0000000..c6a55f3
244 --- /dev/null
245 +++ b/net-p2p/litecoind/files/litecoin.conf
246 @@ -0,0 +1,8 @@
247 +# http://www.bitcoin.org/smf/index.php?topic=644.0
248 +#rpcuser=
249 +#rpcpassword=
250 +
251 +
252 +
253 +
254 +
255
256 diff --git a/net-p2p/litecoind/files/litecoin.confd b/net-p2p/litecoind/files/litecoin.confd
257 new file mode 100644
258 index 0000000..4261f6e
259 --- /dev/null
260 +++ b/net-p2p/litecoind/files/litecoin.confd
261 @@ -0,0 +1,10 @@
262 +# Config file for /etc/init.d/litecoind
263 +
264 +# owner of liteciond process (don't change, must be existing)
265 +LITECOIN_USER="litecoin"
266 +
267 +# See http://www.bitcoin.org/smf/index.php?topic=1063
268 +LITECOIN_OPTS="${LITECOIN_OPTS}"
269 +
270 +# nice level
271 +NICELEVEL="19"
272
273 diff --git a/net-p2p/litecoind/files/litecoin.initd b/net-p2p/litecoind/files/litecoin.initd
274 new file mode 100644
275 index 0000000..036ab8c
276 --- /dev/null
277 +++ b/net-p2p/litecoind/files/litecoin.initd
278 @@ -0,0 +1,104 @@
279 +#!/sbin/runscript
280 +# Distributed under the terms of the GNU General Public License, v2 or later
281 +
282 +VARDIR="/var/lib/litecoin"
283 +CONFFILE="${VARDIR}/.litecoin/litecoin.conf"
284 +
285 +depend() {
286 + need net
287 +}
288 +
289 +checkconfig() {
290 + if [[ "${LITECOIN_USER}" == "" ]] ; then
291 + eerror "Please edit /etc/conf.d/litecoind"
292 + eerror "A user must be specified to run litecoind as that user."
293 + eerror "Modify USER to your needs (you may also add a group after a colon)"
294 + return 1
295 + fi
296 + if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${LITECOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
297 + eerror "Please edit /etc/conf.d/litecoind"
298 + eerror "Specified user must exist!"
299 + return 1
300 + fi
301 + if `echo "${LITECOIN_USER}" | grep ':' -sq` ; then
302 + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${LITECOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
303 + eerror "Please edit /etc/conf.d/litecoind"
304 + eerror "Specified group must exist!"
305 + return 1
306 + fi
307 + fi
308 + if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
309 + eerror "Please edit `readlink -f ${CONFFILE}`"
310 + eerror "There must be at least a line assigning rpcpassword=something-secure"
311 + return 1
312 + fi
313 + if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
314 + eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
315 + return 1
316 + fi
317 + return 0
318 +}
319 +
320 +start() {
321 + checkconfig || return 1
322 + ebegin "Starting Litecoind daemon"
323 +
324 + pkg-config openrc
325 + if [ $? = 0 ]; then
326 + start_openrc
327 + else
328 + start_baselayout
329 + fi
330 +}
331 +
332 +stop() {
333 + ebegin "Stopping Litecoin daemon"
334 +
335 + pkg-config openrc
336 + if [ $? = 0 ]; then
337 + stop_openrc
338 + else
339 + stop_baselayout
340 + fi
341 +}
342 +
343 +start_openrc() {
344 + start-stop-daemon \
345 + --start --user "${LITECOIN_USER}" --name litecoind \
346 + --pidfile /var/run/litecoind.pid --make-pidfile \
347 + --env HOME="${VARDIR}" --exec /usr/bin/litecoind \
348 + --nicelevel "${NICELEVEL}" \
349 + --background \
350 + --wait 2000 \
351 + -- ${LITECOIN_OPTS}
352 + eend $?
353 +}
354 +
355 +stop_openrc() {
356 + start-stop-daemon --stop --user "${LITECOIN_USER}" \
357 + --name litecoind --pidfile /var/run/litecoind.pid \
358 + --wait 30000 \
359 + --progress
360 + eend $?
361 +}
362 +
363 +start_baselayout() {
364 + start-stop-daemon \
365 + --start --user "${LITECOIN_USER}" --name litecoind \
366 + --pidfile /var/run/litecoind.pid --make-pidfile \
367 + --env HOME="${VARDIR}" --exec /usr/bin/litecoind \
368 + --chuid "${LITECOIN_USER}" \
369 + --nicelevel "${NICELEVEL}" \
370 + --background \
371 + -- ${LITECOIN_OPTS}
372 + eend $?
373 +}
374 +
375 +stop_baselayout() {
376 + start-stop-daemon \
377 + --stop \
378 + --user "${LITECOIN_USER}" \
379 + --name litecoind \
380 + --pidfile /var/run/litecoind.pid
381 + eend $?
382 +}
383
384 diff --git a/net-p2p/litecoind/files/litecoin.logrotate b/net-p2p/litecoind/files/litecoin.logrotate
385 new file mode 100644
386 index 0000000..5b091aa
387 --- /dev/null
388 +++ b/net-p2p/litecoind/files/litecoin.logrotate
389 @@ -0,0 +1,7 @@
390 +/var/lib/litecoin/.litecoin/debug.log {
391 + weekly
392 + sharedscripts
393 + postrotate
394 + killall -HUP litecoind
395 + endscript
396 +}
397
398 diff --git a/net-p2p/litecoind/files/litecoin.service b/net-p2p/litecoind/files/litecoin.service
399 new file mode 100644
400 index 0000000..ae063ac
401 --- /dev/null
402 +++ b/net-p2p/litecoind/files/litecoin.service
403 @@ -0,0 +1,30 @@
404 +# It's not recommended to modify this file in-place, because it will be
405 +# overwritten during package upgrades. If you want to customize, the
406 +# best way is to create file
407 +# "/etc/systemd/system/litecoind.service.d/*.conf"
408 +# containing your changes
409 +
410 +# For example, if you want to change some daemon and/or unit options,
411 +# create a file named
412 +# "/etc/systemd/system/litecoind.service.d/myopts.conf"
413 +# containing:
414 +# [Service]
415 +# Environment="LITECOIN_OPTS=-debug -logtimestamps"
416 +# Nice=10
417 +# This will override the setting appearing below.
418 +
419 +# Note that almost all daemon options could be specified in
420 +# /etc/litecoin/litecoin.conf
421 +
422 +[Unit]
423 +Description=Litecoin Daemon
424 +After=network.target
425 +
426 +[Service]
427 +User=litecoin
428 +Environment=LITECOIN_OPTS=
429 +ExecStart=/usr/bin/litecoind -daemon=0 $LITECOIN_OPTS
430 +ExecReload=/bin/kill -HUP $MAINPID
431 +
432 +[Install]
433 +WantedBy=multi-user.target
434
435 diff --git a/net-p2p/litecoind/litecoind-0.8.5.3_rc3.ebuild b/net-p2p/litecoind/litecoind-0.8.5.3_rc3.ebuild
436 new file mode 100644
437 index 0000000..5ff2bc5
438 --- /dev/null
439 +++ b/net-p2p/litecoind/litecoind-0.8.5.3_rc3.ebuild
440 @@ -0,0 +1,123 @@
441 +# Copyright 1999-2013 Gentoo Foundation
442 +# Distributed under the terms of the GNU General Public License v2
443 +# $Header: $
444 +
445 +EAPI=5
446 +
447 +DB_VER="4.8"
448 +
449 +inherit bash-completion-r1 db-use eutils systemd toolchain-funcs
450 +
451 +MyPV="${PV/_/-}"
452 +MyPN="litecoin"
453 +MyP="${MyPN}-${MyPV}"
454 +
455 +DESCRIPTION="P2P Internet currency based on Bitcoin but easier to mine."
456 +HOMEPAGE="https://litecoin.org/"
457 +SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/v${MyPV}.tar.gz -> ${MyP}.tar.gz"
458 +
459 +LICENSE="MIT ISC GPL-2"
460 +SLOT="0"
461 +KEYWORDS="~amd64 ~x86"
462 +IUSE="bash-completion examples ipv6 logrotate upnp"
463 +
464 +RDEPEND="
465 + >=dev-libs/boost-1.41.0[threads(+)]
466 + dev-libs/openssl:0[-bindist]
467 + logrotate? (
468 + app-admin/logrotate
469 + )
470 + upnp? (
471 + net-libs/miniupnpc
472 + )
473 + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx]
474 + <=dev-libs/leveldb-1.12.0[-snappy]
475 +"
476 +DEPEND="${RDEPEND}
477 + >=app-shells/bash-4.1
478 + sys-apps/sed
479 +"
480 +
481 +S="${WORKDIR}/${MyP}"
482 +
483 +pkg_setup() {
484 + local UG='litecoin'
485 + enewgroup "${UG}"
486 + enewuser "${UG}" -1 -1 /var/lib/litecoin "${UG}"
487 +}
488 +
489 +src_prepare() {
490 + epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch
491 + rm -r src/leveldb
492 +
493 + if has_version '>=dev-libs/boost-1.52'; then
494 + sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix
495 + fi
496 +}
497 +
498 +src_configure() {
499 + OPTS=()
500 +
501 + OPTS+=("DEBUGFLAGS=")
502 + OPTS+=("CXXFLAGS=${CXXFLAGS}")
503 + OPTS+=("LDFLAGS=${LDFLAGS}")
504 +
505 + if use upnp; then
506 + OPTS+=("USE_UPNP=1")
507 + else
508 + OPTS+=("USE_UPNP=-")
509 + fi
510 +
511 + use ipv6 || OPTS+=("USE_IPV6=-")
512 +
513 + OPTS+=("USE_SYSTEM_LEVELDB=1")
514 + OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")")
515 + OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}")
516 +
517 + cd src || die
518 + emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN}
519 +}
520 +
521 +#Tests are broken with and without our litecoin-sys_leveldb.patch
522 +src_test() {
523 + cd src || die
524 + emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_litecoin
525 + ./test_litecoin || die 'Tests failed'
526 +}
527 +
528 +src_install() {
529 + dobin src/${PN}
530 +
531 + insinto /etc/litecoin
532 + doins "${FILESDIR}/litecoin.conf"
533 + fowners litecoin:litecoin /etc/litecoin/litecoin.conf
534 + fperms 600 /etc/litecoin/litecoin.conf
535 +
536 + newconfd "${FILESDIR}/litecoin.confd" ${PN}
537 + newinitd "${FILESDIR}/litecoin.initd" ${PN}
538 + systemd_dounit "${FILESDIR}/litecoin.service"
539 +
540 + keepdir /var/lib/litecoin/.litecoin
541 + fperms 700 /var/lib/litecoin
542 + fowners litecoin:litecoin /var/lib/litecoin/
543 + fowners litecoin:litecoin /var/lib/litecoin/.litecoin
544 + dosym /etc/litecoin/litecoin.conf /var/lib/litecoin/.litecoin/litecoin.conf
545 +
546 + dodoc doc/README.md doc/release-notes.md
547 + newman contrib/debian/manpages/bitcoind.1 litecoind.1
548 + newman contrib/debian/manpages/bitcoin.conf.5 litecoin.conf.5
549 +
550 + if use bash-completion; then
551 + newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion
552 + fi
553 +
554 + if use examples; then
555 + docinto examples
556 + dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools}
557 + fi
558 +
559 + if use logrotate; then
560 + insinto /etc/logrotate.d
561 + newins "${FILESDIR}/litecoind.logrotate" litecoind
562 + fi
563 +}
564
565 diff --git a/net-p2p/litecoind/metadata.xml b/net-p2p/litecoind/metadata.xml
566 new file mode 100644
567 index 0000000..5c226ba
568 --- /dev/null
569 +++ b/net-p2p/litecoind/metadata.xml
570 @@ -0,0 +1,11 @@
571 +<?xml version="1.0" encoding="UTF-8"?>
572 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
573 +<pkgmetadata>
574 + <maintainer>
575 + <email>blueness@g.o</email>
576 + <name>Anthony G. Basile</name>
577 + </maintainer>
578 + <use>
579 + <flag name='logrotate'>Use app-admin/logrotate for rotating logs</flag>
580 + </use>
581 +</pkgmetadata>