]> git.pld-linux.org Git - packages/python-pep8.git/blob - python-pep8.spec
restore tabs
[packages/python-pep8.git] / python-pep8.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # do not perform "make test"
4 %bcond_without  doc     # Build API documentation
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  pep8
9 Summary:        Python style guide checker
10 Name:           python-%{module}
11 Version:        1.5.7
12 Release:        1
13 License:        MIT
14 Group:          Libraries/Python
15 Source0:        https://pypi.python.org/packages/source/p/pep8/%{module}-%{version}.tar.gz
16 # Source0-md5:  f6adbdd69365ecca20513c709f9b7c93
17 URL:            https://pypi.python.org/pypi/pep8
18 BuildRequires:  rpm-pythonprov
19 BuildRequires:  rpmbuild(macros) >= 1.219
20 %if %{with python2}
21 BuildRequires:  python-Sphinx
22 BuildRequires:  python-distribute
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-Sphinx
26 BuildRequires:  python3-distribute
27 %endif
28 Requires:       python-modules
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 pep8 is a tool to check your Python code against some of the style
34 conventions in PEP 8.
35
36 %package -n python3-%{module}
37 Summary:        Python style guide checker
38 Group:          Libraries/Python
39 Requires:       python3-modules
40
41 %description -n python3-%{module}
42 pep8 is a tool to check your Python code against some of the style
43 conventions in PEP 8.
44
45 %package apidocs
46 Summary:        %{module} API documentation
47 Summary(pl.UTF-8):      Dokumentacja API %{module}
48 Group:          Documentation
49
50 %description apidocs
51 API documentation for %{module}.
52
53 %description apidocs -l pl.UTF-8
54 Dokumentacja API %{module}.
55
56 %prep
57 %setup -q -n %{module}-%{version}
58
59 %build
60 %if %{with python2}
61 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
62 %endif
63
64 %if %{with python3}
65 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
66 %endif
67
68 %if %{with doc}
69 cd docs
70 %{__make} -j1 html
71 rm -rf _build/html/_sources
72 %endif
73
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 %if %{with python2}
77 %{__python} setup.py \
78         build --build-base build-2 \
79         install --skip-build \
80         --optimize=2 \
81         --root=$RPM_BUILD_ROOT
82
83 %py_postclean
84 %endif
85
86 %if %{with python3}
87 %{__python3} setup.py \
88         build --build-base build-3 \
89         install --skip-build \
90         --optimize=2 \
91         --root=$RPM_BUILD_ROOT
92 %endif
93
94 %clean
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with python2}
98 %files
99 %defattr(644,root,root,755)
100 %doc CHANGES.txt README.rst
101 %attr(755,root,root) %{_bindir}/pep8
102 %{py_sitescriptdir}/*.py[co]
103 %if "%{py_ver}" > "2.4"
104 %{py_sitescriptdir}/pep8-*.egg-info
105 %endif
106 %endif
107
108 %if %{with python3}
109 %files -n python3-%{module}
110 %defattr(644,root,root,755)
111 %doc CHANGES.txt README.rst
112 %{py3_sitescriptdir}/%{module}.py
113 %{py3_sitescriptdir}/__pycache__/%{module}.cpython-*.py[co]
114 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
115 %endif
116
117 %if %{with doc}
118 %files apidocs
119 %defattr(644,root,root,755)
120 %doc docs/_build/html/*
121 %endif
This page took 0.039539 seconds and 3 git commands to generate.