]>
Commit | Line | Data |
---|---|---|
e299101d AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
0c9f4fb2 ER |
5 | |
6 | %define module pycoinnet | |
e299101d AM |
7 | Summary: Speaking the Bitcoin Protocol |
8 | Name: python-pycoinnet | |
9 | Version: 0.01 | |
10 | Release: 0.1 | |
11 | License: MIT | |
12 | Group: Development/Languages/Python | |
13 | Source0: https://github.com/richardkiss/pycoinnet/archive/%{version}.tar.gz | |
14 | # Source0-md5: 512f17827323eb1ba2bfe7952829575d | |
15 | URL: https://github.com/richardkiss/pycoinnet | |
05080eb1 | 16 | BuildRequires: rpmbuild(macros) >= 1.710 |
0c9f4fb2 | 17 | BuildRequires: rpm-pythonprov |
e299101d AM |
18 | %if %{with python2} |
19 | BuildRequires: python-devel | |
20 | BuildRequires: python-modules | |
e299101d AM |
21 | %endif |
22 | %if %{with python3} | |
23 | BuildRequires: python3-2to3 | |
a90a0b42 ER |
24 | BuildRequires: python3-devel >= 1:3.3 |
25 | BuildRequires: python3-modules >= 1:3.3 | |
e299101d | 26 | %endif |
0c9f4fb2 | 27 | Requires: python |
e299101d AM |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | It provides utilities and examples for writing tools in pure Python | |
33 | that speak the bitcoin protocol on the bitcoin network. | |
34 | ||
35 | %package -n python3-%{module} | |
36 | Summary: Speaking the Bitcoin Protocol | |
37 | Version: 0.01 | |
38 | Release: 1 | |
39 | Group: Libraries/Python | |
a90a0b42 | 40 | Requires: python3 >= 1:3.3 |
e299101d AM |
41 | |
42 | %description -n python3-%{module} | |
43 | It provides utilities and examples for writing tools in pure Python | |
44 | that speak the bitcoin protocol on the bitcoin network. | |
45 | ||
46 | %prep | |
47 | %setup -q -n pycoinnet-%{version} | |
48 | ||
49 | %build | |
50 | %if %{with python2} | |
d101da2a | 51 | %py_build --build-base py2 |
e299101d AM |
52 | %endif |
53 | %if %{with python3} | |
d101da2a | 54 | %py3_build --build-base py3 |
e299101d AM |
55 | %endif |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | %if %{with python2} | |
60 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
d101da2a | 61 | %py_build \ |
e299101d AM |
62 | --build-base py2 \ |
63 | install \ | |
64 | --optimize 2 \ | |
65 | --root=$RPM_BUILD_ROOT | |
66 | %endif | |
67 | ||
68 | %if %{with python3} | |
69 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
d101da2a | 70 | %py3_build \ |
e299101d AM |
71 | --build-base py3 \ |
72 | install \ | |
73 | --optimize 2 \ | |
74 | --root=$RPM_BUILD_ROOT | |
75 | %endif | |
76 | ||
77 | %clean | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
81 | %files | |
82 | %defattr(644,root,root,755) | |
83 | %doc CHANGES CREDITS README.md | |
e299101d AM |
84 | %{py_sitescriptdir}/%{module} |
85 | %{py_sitescriptdir}/*egg-info | |
0c9f4fb2 | 86 | %{_examplesdir}/python-%{module}-%{version} |
e299101d AM |
87 | %endif |
88 | ||
89 | %if %{with python3} | |
90 | %files -n python3-%{module} | |
91 | %defattr(644,root,root,755) | |
92 | %doc CHANGES CREDITS README.md | |
e299101d AM |
93 | %{py3_sitescriptdir}/%{module} |
94 | %{py3_sitescriptdir}/*egg-info | |
0c9f4fb2 | 95 | %{_examplesdir}/python3-%{module}-%{version} |
e299101d | 96 | %endif |