]> git.pld-linux.org Git - packages/python-testtools.git/blob - python-testtools.spec
automatic change: use py_build/py_install macros
[packages/python-testtools.git] / python-testtools.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # HTML (sphinx-based) documentation
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 %bcond_without  tests   # do not perform tests
7
8 Summary:        Extensions to the Python unit testing framework
9 Summary(pl.UTF-8):      Rozszerzenie szkieletu testów jednostkowych Pythona
10 Name:           python-testtools
11 Version:        0.9.34
12 Release:        3
13 License:        MIT
14 Group:          Development/Tools
15 Source0:        https://pypi.python.org/packages/source/t/testtools/testtools-%{version}.tar.gz
16 # Source0-md5:  51d37e7376a70cee40cf17b44889fc88
17 URL:            https://launchpad.net/testtools
18 %if %{with python2}
19 BuildRequires:  python-devel >= 1:2.6
20 %if %{with tests}
21 BuildRequires:  python-devel-tools
22 BuildRequires:  python-extras
23 BuildRequires:  python-mimeparse
24 %endif
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel
28 %if %{with tests}
29 BuildRequires:  python3-devel-tools
30 BuildRequires:  python3-extras
31 BuildRequires:  python3-mimeparse
32 %endif
33 %endif
34 BuildRequires:  rpmbuild(macros) >= 1.219
35 %{?with_doc:BuildRequires:      sphinx-pdg}
36 Requires:       python-extras
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 testtools is a set of extensions to the Python standard library's unit
42 testing framework.
43
44 %description -l pl.UTF-8
45 testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
46 biblioteki standardowej Pythona.
47
48 %package -n python3-testtools
49 Summary:        Extensions to the Python unit testing framework
50 Summary(pl.UTF-8):      Rozszerzenie szkieletu testów jednostkowych Pythona
51 Group:          Development/Tools
52 Requires:       python3-extras
53
54 %description -n python3-testtools
55 testtools is a set of extensions to the Python standard library's unit
56 testing framework.
57
58 %description -n python3-testtools -l pl.UTF-8
59 testtools to zestaw rozszerzeń szkieletu testów jednostkowych z
60 biblioteki standardowej Pythona.
61
62 %package doc
63 Summary:        Documentation for %{name}
64 Summary(pl.UTF-8):      Dokumentacja do pakietu %{name}
65 Group:          Documentation
66 Requires:       %{name} = %{version}-%{release}
67
68 %description doc
69 This package contains HTML documentation for %{name}.
70
71 %description doc -l pl.UTF-8
72 Dokumentacja HTML do pakietu %{name}.
73
74 %prep
75 %setup -q -n testtools-%{version}
76
77 %build
78 %if %{with python2}
79 %{__python} setup.py \
80         build --build-base build-2 \
81         %{?with_tests:test}
82 %endif
83
84 %if %{with python3}
85 %{__python3} setup.py \
86         build --build-base build-3 \
87         %{?with_tests:test}
88 %endif
89
90 %if %{with doc}
91 %{__make} -C doc html
92 %endif
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with python2}
98 %py_install
99
100 %py_postclean
101 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/testtools/tests
102 %endif
103
104 %if %{with python3}
105 %py3_install
106
107 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/testtools/tests
108 %endif
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %files
115 %defattr(644,root,root,755)
116 %doc LICENSE NEWS README.rst
117 %dir %{py_sitescriptdir}/testtools
118 %{py_sitescriptdir}/testtools/*.py[co]
119 %dir %{py_sitescriptdir}/testtools/matchers
120 %{py_sitescriptdir}/testtools/matchers/*.py[co]
121 %dir %{py_sitescriptdir}/testtools/testresult
122 %{py_sitescriptdir}/testtools/testresult/*.py[co]
123 %{py_sitescriptdir}/testtools-%{version}-py*.egg-info
124 %endif
125
126 %if %{with python3}
127 %files -n python3-testtools
128 %defattr(644,root,root,755)
129 %doc LICENSE NEWS README.rst
130 %dir %{py3_sitescriptdir}/testtools
131 %{py3_sitescriptdir}/testtools/*.py
132 %{py3_sitescriptdir}/testtools/__pycache__
133 %dir %{py3_sitescriptdir}/testtools/matchers
134 %{py3_sitescriptdir}/testtools/matchers/*.py
135 %{py3_sitescriptdir}/testtools/matchers/__pycache__
136 %dir %{py3_sitescriptdir}/testtools/testresult
137 %{py3_sitescriptdir}/testtools/testresult/*.py
138 %{py3_sitescriptdir}/testtools/testresult/__pycache__
139 %{py3_sitescriptdir}/testtools-%{version}-py*.egg-info
140 %endif
141
142 %if %{with doc}
143 %files doc
144 %defattr(644,root,root,755)
145 %doc doc/_build/html/*
146 %endif
This page took 0.088134 seconds and 4 git commands to generate.