Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-p2p/bitcoind/files: bitcoin.conf bitcoin.confd 0.4.2-Makefile.gentoo bitcoin.initd
Date: Fri, 23 Dec 2011 19:19:53
Message-Id: 20111223191938.757A82004C@flycatcher.gentoo.org
1 blueness 11/12/23 19:19:38
2
3 Added: bitcoin.conf bitcoin.confd 0.4.2-Makefile.gentoo
4 bitcoin.initd
5 Log:
6 Initial commit, proxy maintaining for Luke Dashjr, bug #328391
7
8 (Portage version: 2.1.10.41/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.1 net-p2p/bitcoind/files/bitcoin.conf
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/bitcoin.conf?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/bitcoin.conf?rev=1.1&content-type=text/plain
15
16 Index: bitcoin.conf
17 ===================================================================
18 # http://www.bitcoin.org/smf/index.php?topic=644.0
19 #rpcuser=
20 #rpcpassword=
21
22
23
24
25
26
27
28
29 1.1 net-p2p/bitcoind/files/bitcoin.confd
30
31 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/bitcoin.confd?rev=1.1&view=markup
32 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/bitcoin.confd?rev=1.1&content-type=text/plain
33
34 Index: bitcoin.confd
35 ===================================================================
36 # Config file for /etc/init.d/bitcoin
37
38 # owner of bitcoind process (don't change, must be existing)
39 BITCOIN_USER="bitcoin"
40
41 # See http://www.bitcoin.org/smf/index.php?topic=1063
42 BITCOIN_OPTS="${BITCOIN_OPTS}"
43
44 # nice level
45 NICELEVEL="19"
46
47
48
49 1.1 net-p2p/bitcoind/files/0.4.2-Makefile.gentoo
50
51 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.4.2-Makefile.gentoo?rev=1.1&view=markup
52 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/0.4.2-Makefile.gentoo?rev=1.1&content-type=text/plain
53
54 Index: 0.4.2-Makefile.gentoo
55 ===================================================================
56 # Copyright (c) 2009-2010 Satoshi Nakamoto, 2010 Myckel Habets, 2011 Luke Dashjr
57 # Distributed under the MIT/X11 software license, see the accompanying
58 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
59
60 USE_SSL :=
61 USE_UPNP :=
62
63 WXINCLUDEPATHS=$(shell wx-config --cxxflags)
64 WXLIBS=$(shell wx-config --libs)
65
66 CXXFLAGS := -g -O2
67 LDFLAGS :=
68
69 xLDFLAGS += \
70 -Wl,-Bdynamic \
71 -l boost_system$(BOOST_LIB_SUFFIX) \
72 -l boost_filesystem$(BOOST_LIB_SUFFIX) \
73 -l boost_program_options$(BOOST_LIB_SUFFIX) \
74 -l boost_thread$(BOOST_LIB_SUFFIX) \
75 -l ssl \
76 -l crypto \
77 -l crypto++ \
78 -l z \
79 -l dl
80
81 xCXXFLAGS += -pthread
82 xLDFLAGS += -pthread
83
84 xCXXFLAGS += $(BOOST_CXXFLAGS)
85 xLDFLAGS += $(BOOST_LDFLAGS)
86
87 xCXXFLAGS += $(DB_CXXFLAGS)
88 xLDFLAGS += $(DB_LDFLAGS)
89
90 ifneq ($(USE_SSL),)
91 xCXXFLAGS += -DUSE_SSL
92 endif
93
94 ifneq ($(USE_UPNP),)
95 xLDFLAGS += -l miniupnpc
96 xCXXFLAGS += -DUSE_UPNP=$(USE_UPNP)
97 endif
98
99 xCXXFLAGS += -D__WXDEBUG__
100 xCXXFLAGS += -DNOPCH
101 xCXXFLAGS += -Wno-invalid-offsetof -Wformat
102
103 xCXXFLAGS += $(CXXFLAGS)
104 xLDFLAGS += $(LDFLAGS)
105
106 HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
107 checkpoints.h crypter.h keystore.h wallet.h protocol.h \
108 script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
109
110 OBJS= \
111 obj/checkpoints.o \
112 obj/crypter.o \
113 obj/util.o \
114 obj/script.o \
115 obj/db.o \
116 obj/net.o \
117 obj/protocol.o \
118 obj/irc.o \
119 obj/keystore.o \
120 obj/main.o \
121 obj/wallet.o \
122 obj/rpc.o \
123 obj/init.o
124
125
126 all: bitcoin
127
128
129 obj/%.o: %.cpp $(HEADERS)
130 $(CXX) -c $(xCXXFLAGS) $(WXINCLUDEPATHS) -DGUI -o $@ $<
131
132 bitcoin: $(OBJS) obj/ui.o obj/uibase.o
133 $(CXX) -o $@ $^ $(WXLIBS) $(xLDFLAGS)
134
135
136 obj/nogui/%.o: %.cpp $(HEADERS)
137 $(CXX) -c $(xCXXFLAGS) -o $@ $<
138
139 bitcoind: $(OBJS:obj/%=obj/nogui/%)
140 $(CXX) -o $@ $^ $(xLDFLAGS)
141
142
143
144 1.1 net-p2p/bitcoind/files/bitcoin.initd
145
146 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/bitcoin.initd?rev=1.1&view=markup
147 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/files/bitcoin.initd?rev=1.1&content-type=text/plain
148
149 Index: bitcoin.initd
150 ===================================================================
151 #!/sbin/runscript
152 # Distributed under the terms of the GNU General Public License, v2 or later
153
154 VARDIR="/var/lib/bitcoin"
155 CONFFILE="${VARDIR}/.bitcoin/bitcoin.conf"
156
157 depend() {
158 need net
159 }
160
161 checkconfig() {
162 if [[ "${BITCOIN_USER}" == "" ]] ; then
163 eerror "Please edit /etc/conf.d/bitcoind"
164 eerror "A user must be specified to run bitcoind as that user."
165 eerror "Modify USER to your needs (you may also add a group after a colon)"
166 return 1
167 fi
168 if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${BITCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then
169 eerror "Please edit /etc/conf.d/bitcoind"
170 eerror "Specified user must exist!"
171 return 1
172 fi
173 if `echo "${BITCOIN_USER}" | grep ':' -sq` ; then
174 if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${BITCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then
175 eerror "Please edit /etc/conf.d/bitcoind"
176 eerror "Specified group must exist!"
177 return 1
178 fi
179 fi
180 if ! grep -q '^rpcpassword=' "${CONFFILE}"; then
181 eerror "Please edit `readlink -f ${CONFFILE}`"
182 eerror "There must be at least a line assigning rpcpassword=something-secure"
183 return 1
184 fi
185 if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then
186 eerror "`readlink -f ${CONFFILE}` should not be readable by other users"
187 return 1
188 fi
189 return 0
190 }
191
192 start() {
193 checkconfig || return 1
194 ebegin "Starting Bitcoind daemon"
195
196 pkg-config openrc
197 if [ $? = 0 ]; then
198 start_openrc
199 else
200 start_baselayout
201 fi
202 }
203
204 stop() {
205 ebegin "Stopping Bitcoin daemon"
206
207 pkg-config openrc
208 if [ $? = 0 ]; then
209 stop_openrc
210 else
211 stop_baselayout
212 fi
213 }
214
215 start_openrc() {
216 start-stop-daemon \
217 --start --user "${BITCOIN_USER}" --name bitcoind \
218 --pidfile /var/run/bitcoind.pid --make-pidfile \
219 --env HOME="${VARDIR}" --exec /usr/bin/bitcoind \
220 --nicelevel "${NICELEVEL}" \
221 --background \
222 --wait 2000 \
223 -- ${BITCOIN_OPTS}
224 eend $?
225 }
226
227 stop_openrc() {
228 start-stop-daemon --stop --user "${BITCOIN_USER}" \
229 --name bitcoind --pidfile /var/run/bitcoind.pid \
230 --wait 30000 \
231 --progress
232 eend $?
233 }
234
235 start_baselayout() {
236 start-stop-daemon \
237 --start --user "${BITCOIN_USER}" --name bitcoind \
238 --pidfile /var/run/bitcoind.pid --make-pidfile \
239 --env HOME="${VARDIR}" --exec /usr/bin/bitcoind \
240 --chuid "${BITCOIN_USER}" \
241 --nicelevel "${NICELEVEL}" \
242 --background \
243 -- ${BITCOIN_OPTS}
244 eend $?
245 }
246
247 stop_baselayout() {
248 start-stop-daemon \
249 --stop \
250 --user "${BITCOIN_USER}" \
251 --name bitcoind \
252 --pidfile /var/run/bitcoind.pid
253 eend $?
254 }