]>
Commit | Line | Data |
---|---|---|
e081423e JK |
1 | # |
2 | # Conditional build: | |
c68ac941 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_with tests # unit tests | |
e081423e JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module zope.exceptions | |
9 | Summary: Zope Exceptions | |
c68ac941 | 10 | Summary(pl.UTF-8): Zope Exceptions - wyjątki Zope |
e081423e | 11 | Name: python-%{module} |
c68ac941 JB |
12 | Version: 4.3 |
13 | Release: 1 | |
14 | License: ZPL v2.1 | |
e081423e | 15 | Group: Libraries/Python |
c68ac941 JB |
16 | #Source0Download: https://pypi.org/simple/zope-exceptions/ |
17 | Source0: https://files.pythonhosted.org/packages/source/z/zope.exceptions/zope.exceptions-%{version}.tar.gz | |
18 | # Source0-md5: fac94f92c787cf9870e9e3fdfe247aa4 | |
19 | URL: https://www.zope.org/ | |
8ba5e1db | 20 | %if %{with python2} |
c68ac941 | 21 | BuildRequires: python >= 1:2.7 |
e081423e | 22 | BuildRequires: python-setuptools |
c68ac941 JB |
23 | %if %{with tests} |
24 | BuildRequires: python-zope.interface | |
25 | BuildRequires: python-zope.testrunner | |
26 | %endif | |
e081423e JK |
27 | %endif |
28 | %if %{with python3} | |
c68ac941 | 29 | BuildRequires: python3 >= 1:3.4 |
e081423e | 30 | BuildRequires: python3-setuptools |
c68ac941 JB |
31 | %if %{with tests} |
32 | BuildRequires: python3-zope.interface | |
33 | BuildRequires: python3-zope.testrunner | |
e081423e | 34 | %endif |
c68ac941 JB |
35 | %endif |
36 | BuildRequires: rpm-pythonprov | |
37 | BuildRequires: rpmbuild(macros) >= 1.714 | |
38 | %if %{with doc} | |
39 | BuildRequires: sphinx-pdg-3 | |
40 | BuildRequires: python3-repoze.sphinx.autointerface | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.7 | |
43 | Requires: python-zope-base | |
e081423e JK |
44 | Obsoletes: Zope-Exceptions |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
c68ac941 JB |
48 | This package contains exception exceptions and implementations which |
49 | are so general purpose that they don't belong in Zope | |
50 | application-specific packages. | |
51 | ||
52 | %description -l pl.UTF-8 | |
53 | Ten pakiet zawiera wyjątki oraz implementacje wyjątków, mających na | |
54 | tyle ogólne zastosowanie, że nie należą do żadnego z pakietów Zope | |
55 | specyficznych dla aplikacji. | |
e081423e JK |
56 | |
57 | %package -n python3-%{module} | |
58 | Summary: Zope Exceptions | |
c68ac941 | 59 | Summary(pl.UTF-8): Zope Exceptions - wyjątki Zope |
e081423e | 60 | Group: Libraries/Python |
c68ac941 JB |
61 | Requires: python3-modules >= 1:3.4 |
62 | Requires: python3-zope-base | |
e081423e JK |
63 | |
64 | %description -n python3-%{module} | |
c68ac941 JB |
65 | This package contains exception exceptions and implementations which |
66 | are so general purpose that they don't belong in Zope | |
67 | application-specific packages. | |
68 | ||
69 | %description -n python3-%{module} -l pl.UTF-8 | |
70 | Ten pakiet zawiera wyjątki oraz implementacje wyjątków, mających na | |
71 | tyle ogólne zastosowanie, że nie należą do żadnego z pakietów Zope | |
72 | specyficznych dla aplikacji. | |
e081423e JK |
73 | |
74 | %prep | |
75 | %setup -q -n zope.exceptions-%{version} | |
76 | ||
77 | %build | |
78 | %if %{with python2} | |
79 | %py_build | |
c68ac941 JB |
80 | |
81 | %if %{with tests} | |
82 | %{__python} -m zope.testrunner --test-path=src | |
83 | %endif | |
e081423e JK |
84 | %endif |
85 | ||
86 | %if %{with python3} | |
87 | %py3_build | |
c68ac941 JB |
88 | |
89 | %if %{with tests} | |
90 | %{__python3} -m zope.testrunner --test-path=src | |
91 | %endif | |
92 | %endif | |
93 | ||
94 | %if %{with doc} | |
95 | %{__make} -C docs html \ | |
96 | SPHINXBUILD=sphinx-build-2 | |
e081423e JK |
97 | %endif |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %py_install \ | |
104 | --install-purelib=%{py_sitedir} | |
105 | %py_postclean | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
109 | %py3_install \ | |
110 | --install-purelib=%{py3_sitedir} | |
111 | %endif | |
112 | ||
113 | %clean | |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
8ba5e1db | 116 | %if %{with python2} |
e081423e JK |
117 | %files |
118 | %defattr(644,root,root,755) | |
c68ac941 | 119 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
e081423e | 120 | %{py_sitedir}/zope/exceptions |
c68ac941 JB |
121 | %{py_sitedir}/zope.exceptions-%{version}-py*.egg-info |
122 | %{py_sitedir}/zope.exceptions-%{version}-py*-nspkg.pth | |
8ba5e1db | 123 | %endif |
e081423e | 124 | |
8ba5e1db | 125 | %if %{with python3} |
e081423e JK |
126 | %files -n python3-%{module} |
127 | %defattr(644,root,root,755) | |
c68ac941 | 128 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
e081423e | 129 | %{py3_sitedir}/zope/exceptions |
c68ac941 JB |
130 | %{py3_sitedir}/zope.exceptions-%{version}-py*.egg-info |
131 | %{py3_sitedir}/zope.exceptions-%{version}-py*-nspkg.pth | |
8ba5e1db | 132 | %endif |