]>
Commit | Line | Data |
---|---|---|
9ef393d1 AM |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
51580594 | 5 | %define module dugong |
9ef393d1 AM |
6 | Summary: A HTTP 1.1 client module |
7 | # Name must match the python module/package name (as in 'import' statement) | |
8 | Name: python3-%{module} | |
51580594 | 9 | Version: 3.7.3 |
729bac12 | 10 | Release: 2 |
9ef393d1 AM |
11 | License: PSF |
12 | Group: Libraries/Python | |
ca271a9f | 13 | Source0: https://pypi.python.org/packages/source/d/dugong/dugong-%{version}.tar.bz2 |
51580594 | 14 | # Source0-md5: 7e1b12a36da16bd3502858893e9555be |
9ef393d1 | 15 | URL: https://bitbucket.org/nikratio/python-dugong |
e88ca811 | 16 | BuildRequires: rpmbuild(macros) >= 1.710 |
9ef393d1 AM |
17 | BuildRequires: python3-devel |
18 | BuildRequires: python3-distribute | |
19 | BuildRequires: python3-modules | |
20 | BuildRequires: rpm-pythonprov | |
cdc95f17 | 21 | BuildArch: noarch |
9ef393d1 AM |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23 | ||
24 | %description | |
25 | A HTTP 1.1 client module. | |
26 | ||
27 | %package apidocs | |
28 | Summary: %{module} API documentation | |
29 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
30 | Group: Documentation | |
31 | ||
32 | %description apidocs | |
33 | API documentation for %{module}. | |
34 | ||
35 | %description apidocs -l pl.UTF-8 | |
36 | Dokumentacja API %{module}. | |
37 | ||
38 | %prep | |
39 | %setup -q -n %{module}-%{version} | |
40 | ||
cdc95f17 JR |
41 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \ |
42 | examples/extract_links.py \ | |
43 | examples/httpcat.py \ | |
44 | examples/pipeline1.py | |
45 | ||
9ef393d1 | 46 | %build |
33f684fc | 47 | %py3_build %{?with_tests:test} |
9ef393d1 AM |
48 | |
49 | %if %{with doc} | |
50 | cd docs | |
51 | %{__make} -j1 html | |
52 | rm -rf _build/html/_sources | |
53 | %endif | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
33f684fc | 58 | %py3_install |
9ef393d1 AM |
59 | |
60 | # in case there are examples provided | |
61 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
62 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
63 | find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ | |
64 | | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' | |
65 | ||
66 | %clean | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | ||
69 | %files | |
70 | %defattr(644,root,root,755) | |
71 | %doc Changes.rst | |
72 | %{py3_sitescriptdir}/%{module} | |
73 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
74 | %{_examplesdir}/python3-%{module}-%{version} | |
75 | ||
76 | %if %{with doc} | |
77 | %files apidocs | |
78 | %defattr(644,root,root,755) | |
79 | %doc docs/_build/html/* | |
80 | %endif |