]> git.pld-linux.org Git - packages/python-pep8.git/blob - python-pep8.spec
c8553efc5f64a7bc27cc5b549e1fc30824a1689b
[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 Requires:       python-modules
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-Sphinx
27 BuildRequires:  python3-distribute
28 %endif
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
77 %if %{with python2}
78 %{__python} setup.py \
79                 build --build-base build-2 \
80                 install --skip-build \
81                 --optimize=2 \
82                 --root=$RPM_BUILD_ROOT
83
84 %py_postclean
85 %endif
86
87 %if %{with python3}
88 %{__python3} setup.py \
89                 build --build-base build-3 \
90                 install --skip-build \
91                 --optimize=2 \
92                 --root=$RPM_BUILD_ROOT
93 %endif
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python2}
99 %files
100 %defattr(644,root,root,755)
101 %doc CHANGES.txt README.rst
102 %attr(755,root,root) %{_bindir}/pep8
103 %{py_sitescriptdir}/*.py[co]
104 %if "%{py_ver}" > "2.4"
105 %{py_sitescriptdir}/pep8-*.egg-info
106 %endif
107 %endif
108
109 %if %{with python3}
110 %files -n python3-%{module}
111 %defattr(644,root,root,755)
112 %doc CHANGES.txt README.rst
113 %{py3_sitescriptdir}/%{module}.py
114 %{py3_sitescriptdir}/__pycache__/%{module}.cpython-*.py[co]
115 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
116 %endif
117
118 %if %{with doc}
119 %files apidocs
120 %defattr(644,root,root,755)
121 %doc docs/_build/html/*
122 %endif
This page took 0.043301 seconds and 2 git commands to generate.