-
Notifications
You must be signed in to change notification settings - Fork 0
/
p2pool.spec
68 lines (54 loc) · 1.57 KB
/
p2pool.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
# SPDX-License-Identifier: GPL-3.0-or-later
%global debug_package %{nil}
# disable LTO to fix build problem
%global _lto_cflags %{nil}
Name: p2pool
Version: 4.1.1
Release: %autorelease
Summary: Decentralized pool for Monero mining
License: GPL-3.0-only
URL: https://p2pool.io
Source0: https://github.com/SChernykh/%{name}/releases/download/v%{version}/%{name}_source.tar.xz
Source1: https://github.com/SChernykh/%{name}/releases/download/v%{version}/sha256sums.txt.asc
Source2: SChernykh.asc
# for source tarball verification
BuildRequires: coreutils
BuildRequires: gnupg2
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libcurl-devel
BuildRequires: libsodium-devel
BuildRequires: libstdc++-static
BuildRequires: libuv-devel
BuildRequires: openpgm-devel
BuildRequires: zeromq-devel
%description
Decentralized pool for Monero mining
%prep
# check PGP signature
gpg --import %{SOURCE2}
gpg --output SChernykh-keyring.gpg --export [email protected]
gpgv --keyring ./SChernykh-keyring.gpg %{SOURCE1}
# calc hashes
trusted_hash=$(sed -n '/Name:\sp2pool_source.tar.xz/,/SHA256:\s/p' %{SOURCE1} | tail -c 65 | head -c 64)
archive_hash=$(sha256sum %{SOURCE0} | head -c 64 | tr '[:lower:]' '[:upper:]')
# check against correct hash
if ! [ $trusted_hash = $archive_hash ]; then
exit 1
fi
%autosetup -n %{name}
%{set_build_flags}
mkdir build && cd build
cmake ..
%build
cd build
%make_build
%install
mkdir -p %{buildroot}%{_bindir}
install -m 0755 build/p2pool %{buildroot}%{_bindir}/p2pool
%files
%license LICENSE
%{_bindir}/p2pool
%changelog
%autochangelog