-
Notifications
You must be signed in to change notification settings - Fork 0
/
dogecoin.spec
342 lines (291 loc) · 12.4 KB
/
dogecoin.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# Dogecoin RPM spec for Fedora
# Use the other spec file for Enterprise Linux
%define _hardened_build 1
%global selinux_variants mls strict targeted
Name: dogecoin
Version: 1.6
Release: 2%{?dist}
Summary: Peer-to-peer digital currency
Group: Applications/System
License: MIT
URL: http://dogecoin.com/
Source0: https://github.com/dogecoin/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source3: dogecoin.service
Source4: dogecoin.te
Source5: dogecoin.fc
Source6: dogecoin.if
Patch1: dogecoin-1.4.1-boostmt.patch
Patch3: dogecoin-1.5.0-fhs-paths.patch
BuildRequires: qt-devel >= 1:4.6
BuildRequires: qrencode-devel
BuildRequires: openssl-compat-bitcoin-devel
BuildRequires: miniupnpc-devel
BuildRequires: boost-devel >= 1.47.0
BuildRequires: db4-devel
BuildRequires: checkpolicy
BuildRequires: selinux-policy-devel
BuildRequires: /usr/share/selinux/devel/policyhelp
BuildRequires: desktop-file-utils
BuildRequires: libdb4-cxx-devel
Requires: qt >= 4.6
Requires: miniupnpc
Requires: qrencode
Requires: boost >= 1.47.0
Requires: openssl-compat-bitcoin-libs >= 1.0.0j
%package server
Summary: Peer-to-peer digital currency
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires(pre): shadow-utils
Requires(post): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles
Requires(postun): /usr/sbin/semodule, /sbin/restorecon, /sbin/fixfiles
Requires: selinux-policy
Requires: policycoreutils-python
Requires: boost >= 1.47.0
Requires: openssl-compat-bitcoin-libs >= 1.0.0j
%description
Dogecoin is an experimental new digital currency that enables instant
payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer
technology to operate with no central authority: managing transactions
and issuing money are carried out collectively by the network.
Dogecoin is also the name of the open source software which enables the
use of this currency.
This package provides Dogecoin, a user-friendly wallet manager for
personal use.
%description server
Dogecoin is an experimental new digital currency that enables instant
payments to anyone, anywhere in the world. Dogecoin uses peer-to-peer
technology to operate with no central authority: managing transactions
and issuing money are carried out collectively by the network.
This package provides dogecoind, a wallet server and command line tool
for manipulating a remote dogecoind server.
%prep
%setup -q -n %{name}-%{version}
%if 0%{?fedora} <= 19
%patch1 -p1
%endif
%patch3 -p1
# Prep SELinux policy
mkdir SELinux
cp -p %{SOURCE4} %{SOURCE5} %{SOURCE6} SELinux
%build
# Build dogecoin GUI
test -d /usr/lib64/qt4/bin && \
QMAKE=/usr/lib64/qt4/bin/qmake || \
QMAKE=/usr/lib/qt4/bin/qmake
%if 0%{?fedora} >= 20
$QMAKE BOOST_LIB_SUFFIX= \
OPENSSL_INCLUDE_PATH=/opt/openssl-compat-bitcoin/include \
OPENSSL_LIB_PATH=/opt/openssl-compat-bitcoin/lib \
BDB_INCLUDE_PATH=/usr/include/libdb4 \
BDB_LIB_PATH=%{_libdir}/libdb4 \
USE_UPNP=1 \
USE_DBUS=1 \
USE_QRCODE=1 \
LIBS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib
%else
%if 0%{?fedora} >= 18
$QMAKE BOOST_LIB_SUFFIX=-mt \
OPENSSL_INCLUDE_PATH=/opt/openssl-compat-bitcoin/include \
OPENSSL_LIB_PATH=/opt/openssl-compat-bitcoin/lib \
BDB_INCLUDE_PATH=/usr/include/libdb4 \
BDB_LIB_PATH=%{_libdir}/libdb4 \
USE_UPNP=1 \
USE_DBUS=1 \
USE_QRCODE=1 \
LIBS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib
%else
$QMAKE BOOST_LIB_SUFFIX=-mt \
OPENSSL_INCLUDE_PATH=/opt/openssl-compat-bitcoin/include \
OPENSSL_LIB_PATH=/opt/openssl-compat-bitcoin/lib \
USE_UPNP=1 \
USE_DBUS=1 \
USE_QRCODE=1 \
LIBS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib
%endif
%endif
make %{?_smp_mflags} CFLAGS="%{optflags}"
# Build dogecoind
pushd src
%if 0%{?fedora} >= 18
make -f makefile.unix \
%{?_smp_mflags} \
CFLAGS="%{optflags}" \
OPENSSL_INCLUDE_PATH=/opt/openssl-compat-bitcoin/include \
OPENSSL_LIB_PATH=/opt/openssl-compat-bitcoin/lib \
BDB_INCLUDE_PATH=/usr/include/libdb4 \
BDB_LIB_PATH=%{_libdir}/libdb4 \
LDFLAGS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib
%else
make -f makefile.unix \
%{?_smp_mflags} \
CFLAGS="%{optflags}" \
OPENSSL_INCLUDE_PATH=/opt/openssl-compat-bitcoin/include \
OPENSSL_LIB_PATH=/opt/openssl-compat-bitcoin/lib \
LDFLAGS=-Wl,-rpath,/opt/openssl-compat-bitcoin/lib
%endif
popd
# Build SELinux policy
pushd SELinux
for selinuxvariant in %{selinux_variants}
do
# FIXME: Create and debug SELinux policy
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
mv dogecoin.pp dogecoin.pp.${selinuxvariant}
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
done
popd
# Bitcoin doesn't include a "make install" so we have to do it ourselves.
# This is just as well since everything is going into standard locations.
%install
rm -rf %{buildroot}
mkdir %{buildroot}
cp contrib/debian/examples/dogecoin.conf dogecoin.conf.example
# Install dogecoin GUI
install -D -m755 -p dogecoin-qt %{buildroot}%{_bindir}/dogecoin-qt
mkdir -p -m 755 %{buildroot}%{_datadir}/pixmaps
#install -D -m644 -p share/pixmaps/*.{png,xpm,ico} %{buildroot}%{_datadir}/pixmaps/
install -D -m644 -p share/pixmaps/bitcoin.ico %{buildroot}%{_datadir}/pixmaps/dogecoin.ico
install -D -m644 -p share/pixmaps/bitcoin64.png %{buildroot}%{_datadir}/pixmaps/dogecoin64.png
install -D -m644 -p share/pixmaps/bitcoin128.png %{buildroot}%{_datadir}/pixmaps/dogecoin128.png
install -D -m644 -p share/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/dogecoin256.png
sed -i 's/bitcoin/dogecoin/g' contrib/debian/dogecoin-qt.desktop
install -D -m644 -p contrib/debian/dogecoin-qt.desktop %{buildroot}%{_datadir}/applications/dogecoin-qt.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/dogecoin-qt.desktop
install -D -m644 -p contrib/debian/dogecoin-qt.protocol %{buildroot}%{_datadir}/kde4/services/dogecoin-qt.protocol
# Install dogecoind
install -D -m755 -p src/dogecoind %{buildroot}%{_sbindir}/dogecoind
install -D -m644 -p %{SOURCE3} %{buildroot}%{_unitdir}/dogecoin.service
install -d -m750 -p %{buildroot}%{_localstatedir}/lib/dogecoin
install -d -m750 -p %{buildroot}%{_sysconfdir}/dogecoin
install -D -m644 -p contrib/debian/examples/dogecoin.conf %{buildroot}%{_sysconfdir}/dogecoin/dogecoin.conf
install -D -m644 -p contrib/debian/manpages/dogecoind.1 %{buildroot}%{_mandir}/man1/dogecoind.1
install -D -m644 -p contrib/debian/manpages/dogecoin.conf.5 %{buildroot}%{_mandir}/man5/dogecoin.conf.5
gzip %{buildroot}%{_mandir}/man1/dogecoind.1
gzip %{buildroot}%{_mandir}/man5/dogecoin.conf.5
# Install SELinux policy
for selinuxvariant in %{selinux_variants}
do
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
install -p -m 644 SELinux/dogecoin.pp.${selinuxvariant} \
%{buildroot}%{_datadir}/selinux/${selinuxvariant}/dogecoin.pp
done
%pre server
getent group dogecoin >/dev/null || groupadd -r dogecoin
getent passwd dogecoin >/dev/null ||
useradd -r -g dogecoin -d /var/lib/dogecoin -s /sbin/nologin \
-c "Dogecoin wallet server" dogecoin
exit 0
%post server
%systemd_post dogecoin.service
for selinuxvariant in %{selinux_variants}
do
/usr/sbin/semodule -s ${selinuxvariant} -i \
%{_datadir}/selinux/${selinuxvariant}/dogecoin.pp \
&> /dev/null || :
done
# FIXME This is less than ideal, but until dwalsh gives me a better way...
/usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 22555 # RPC
/usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 22556 # P2P
/usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 44555 # Test RPC
/usr/sbin/semanage port -a -t dogecoin_port_t -p tcp 44556 # Test P2P
/sbin/fixfiles -R dogecoin-server restore &> /dev/null || :
/sbin/restorecon -R %{_localstatedir}/lib/dogecoin || :
# this is a terrible way to get around some sort of bad state condition where
# systemctl keeps trying to wrap the old init script
systemctl is-enabled dogecoin.service || systemctl disable dogecoin.service
%preun server
%systemd_preun dogecoin.service
%postun server
%systemd_postun dogecoin.service
if [ $1 -eq 0 ] ; then
# FIXME This is less than ideal, but until dwalsh gives me a better way...
/usr/sbin/semanage port -d -p tcp 22555 # RPC
/usr/sbin/semanage port -d -p tcp 22556 # P2P
/usr/sbin/semanage port -d -p tcp 44555 # Test RPC
/usr/sbin/semanage port -d -p tcp 44556 # Test P2P
for selinuxvariant in %{selinux_variants}
do
/usr/sbin/semodule -s ${selinuxvariant} -r dogecoin \
&> /dev/null || :
done
/sbin/fixfiles -R dogecoin-server restore &> /dev/null || :
[ -d %{_localstatedir}/lib/dogecoin ] && \
/sbin/restorecon -R %{_localstatedir}/lib/dogecoin \
&> /dev/null || :
fi
%files
%defattr(-,root,root,-)
%doc COPYING README.md dogecoin.conf.example
%{_bindir}/dogecoin-qt
%{_datadir}/applications/dogecoin-qt.desktop
%{_datadir}/kde4/services/dogecoin-qt.protocol
%{_datadir}/pixmaps/*
%files server
%defattr(-,root,root,-)
%doc COPYING README.md
%dir %attr(750,dogecoin,dogecoin) %{_localstatedir}/lib/dogecoin
%dir %attr(750,dogecoin,dogecoin) %{_sysconfdir}/dogecoin
%doc SELinux/*
%{_sbindir}/dogecoind
%{_unitdir}/dogecoin.service
%config(noreplace) %{_sysconfdir}/dogecoin/dogecoin.conf
%{_mandir}/man1/dogecoind.1.gz
%{_mandir}/man5/dogecoin.conf.5.gz
%{_datadir}/selinux/*/dogecoin.pp
%changelog
* Sat Mar 8 2014 Graham Forest <[email protected]> 1.5.2-2
- Cleaned up old spec features
- Replaced tabs with spaces
- Updated source0 url to actually function with spectool
- Added some vertical whitespace
- Move to systemd
- Cherry-pick valid icons, rename to avoid conflicting with bitcoin RPM
* Thu Feb 20 2014 Graham Forest <[email protected]> 1.5.2-1
- Version bump
* Sat Feb 8 2014 Graham Forest <[email protected]> 1.5.1-1
- Version bump
* Sun Jan 26 2014 Graham Forest <[email protected]> 1.4.1-1
- Port specfile to dogecoin
- Fix date error in changelog preventing rpmlint
- Remove references to toplevel src dir
- Backport in needed contrib/ files from dogecoin 1.5 alpha
- Port patches to dogecoin paths
- Update ports for RPC/P2P (with testnet) and IRC
* Wed Jan 8 2014 Michael Hampton <[email protected]> 0.8.6-3
- Fix typo causing a nonexistent dependency to be pulled, fixes #9
* Thu Dec 12 2013 Michael Hampton <[email protected]> 0.8.6-2
- Boost no longer requires -mt on Fedora 20+ so omit this option and patch
* Wed Oct 16 2013 Michael Hampton <[email protected]> 0.8.5-2
- Remove bitcoind and bitcoin-qt launcher scripts no longer used upstream
- Ship upstream example config file
* Sat Oct 05 2013 Michael Hampton <[email protected]> 0.8.5-1
- Update for Bitcoin 0.8.5.
* Wed Sep 04 2013 Michael Hampton <[email protected]> 0.8.4-1
- Update for Bitcoin 0.8.4.
- Strip OS X resource forks from upstream tarball.
- Use default SELinux context for /etc/bitcoin directory itself;
fixes SELinux denial against updatedb.
* Fri Jul 05 2013 Michael Hampton <[email protected]> 0.8.3-1
- Update for Bitcoin 0.8.3.
* Sun Jun 02 2013 Michael Hampton <[email protected]> 0.8.2-2
- Fixed bitcoin-server dependency for new openssl packages
* Sun Jun 02 2013 Michael Hampton <[email protected]> 0.8.2-1
- Update for Bitcoin 0.8.2.
* Fri Mar 29 2013 Michael Hampton <[email protected]> 0.8.1-3
- Added missing openssl and boost Requires for bitcoin-server
* Sun Mar 24 2013 Michael Hampton <[email protected]> 0.8.1-2
- Added missing SELinux dependencies
- Updated for RHEL: Now build against a private copy of Boost
* Thu Mar 21 2013 Michael Hampton <[email protected]> 0.8.1-1
- Update for Bitcoin 0.8.1.
- Removed Patch2 (qt 4.6 compatibility) as it has been accepted upstream
* Tue Jan 29 2013 Michael Hampton <[email protected]> 0.7.2-3
- Mass rebuild for corrected package signing key
* Mon Dec 17 2012 Michael Hampton <[email protected]> 0.7.2-1
- Update for Bitcoin 0.7.2.
- Update for separate OpenSSL package openssl-compat-bitcoin.
* Wed Aug 22 2012 Michael Hampton <[email protected]> 0.6.3-1
- Initial package.