]>
Commit | Line | Data |
---|---|---|
c295a98f JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # Sphinx documentation, TODO: fix this | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
0ca5a8a7 | 6 | |
c295a98f | 7 | %define module networkx |
2508e464 MK |
8 | Summary: High-productivity software for complex networks |
9 | Summary(pl.UTF-8): Efektywne operacje na skompliwkoanych grafach. | |
10 | Name: python-%{module} | |
eb4a0570 | 11 | Version: 1.8.1 |
2f746b1e | 12 | Release: 3 |
2508e464 MK |
13 | License: BSD |
14 | Group: Libraries/Python | |
23a38f7a | 15 | Source0: https://pypi.python.org/packages/source/n/networkx/%{module}-%{version}.tar.gz |
eb4a0570 | 16 | # Source0-md5: b4a9e68ecd1b0164446ee432d2e20bd0 |
2508e464 | 17 | URL: http://networkx.github.io/index.html |
2508e464 | 18 | BuildRequires: rpm-pythonprov |
39c3ebbc | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
c295a98f JR |
20 | %if %{with python2} |
21 | BuildRequires: python-distribute | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-modules | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | %{?with_doc:BuildRequires: python-matplotlib} | |
2508e464 MK |
28 | Requires: python-modules |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Python language software package for the creation, manipulation, and | |
34 | study of the structure, dynamics, and functions of complex networks. | |
35 | ||
2508e464 MK |
36 | %description -l pl.UTF-8 |
37 | Pakiet oprogramowania do tworzenia, manipulacji i badania struktury | |
38 | dynamiki i funkcji zlozonych sieci. | |
39 | ||
c295a98f JR |
40 | %package -n python3-%{module} |
41 | Summary: High-productivity software for complex networks | |
42 | Summary(pl.UTF-8): Efektywne operacje na skompliwkoanych grafach. | |
43 | Group: Libraries/Python | |
44 | Requires: python3-modules | |
45 | ||
46 | %description -n python3-%{module} | |
47 | Python language software package for the creation, manipulation, and | |
48 | study of the structure, dynamics, and functions of complex networks. | |
49 | ||
50 | %description -n python3-%{module} -l pl.UTF-8 | |
51 | Pakiet oprogramowania do tworzenia, manipulacji i badania struktury | |
52 | dynamiki i funkcji zlozonych sieci. | |
53 | ||
54 | %package apidocs | |
55 | Summary: API documentation for Python %{module} module | |
56 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
57 | Group: Documentation | |
58 | ||
59 | %description apidocs | |
60 | API documentation for Python %{module} module. | |
61 | ||
62 | %description apidocs -l pl.UTF-8 | |
63 | Dokumentacja API modułu Pythona %{module}. | |
64 | ||
2508e464 MK |
65 | %prep |
66 | %setup -q -n %{module}-%{version} | |
67 | ||
68 | %build | |
c295a98f | 69 | %if %{with python2} |
66850fb0 | 70 | %py_build |
c295a98f JR |
71 | %endif |
72 | ||
73 | %if %{with python3} | |
74 | %py3_build | |
75 | %endif | |
76 | ||
77 | %if %{with doc} | |
78 | cd doc | |
79 | %{__make} -j1 html | |
80 | rm -rf _build/html/_sources | |
81 | %endif | |
2508e464 | 82 | |
2508e464 MK |
83 | %install |
84 | rm -rf $RPM_BUILD_ROOT | |
2508e464 | 85 | |
c295a98f JR |
86 | %if %{with python2} |
87 | %py_install | |
2508e464 MK |
88 | |
89 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
90 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
91 | %py_postclean | |
92 | ||
c295a98f JR |
93 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} |
94 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} | |
95 | find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \ | |
96 | | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
100 | %py3_install | |
101 | ||
102 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
103 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
104 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
105 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
106 | %endif | |
107 | ||
108 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{module}-%{version} | |
109 | ||
2508e464 MK |
110 | %clean |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
c295a98f | 113 | %if %{with python2} |
2508e464 MK |
114 | %files |
115 | %defattr(644,root,root,755) | |
c295a98f | 116 | %doc README.txt |
2508e464 | 117 | %{py_sitescriptdir}/%{module} |
2508e464 | 118 | %{py_sitescriptdir}/%{module}-*.egg-info |
c295a98f JR |
119 | %{_examplesdir}/python-%{module}-%{version} |
120 | %endif | |
121 | ||
122 | %if %{with python3} | |
123 | %files -n python3-%{module} | |
124 | %defattr(644,root,root,755) | |
125 | %doc README.txt | |
126 | %{py3_sitescriptdir}/%{module} | |
127 | %{py3_sitescriptdir}/%{module}-*.egg-info | |
128 | %{_examplesdir}/python3-%{module}-%{version} | |
129 | %endif | |
130 | ||
131 | %if %{with doc} | |
132 | %files apidocs | |
133 | %defattr(644,root,root,755) | |
134 | %doc docs/_build/html/* | |
2508e464 | 135 | %endif |