]>
Commit | Line | Data |
---|---|---|
4bdc2559 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
eb8b39fb | 5 | %bcond_with tests # unit tests (display required) |
4bdc2559 JR |
6 | |
7 | %define module pyglet | |
770077cd | 8 | Summary: A cross-platform windowing and multimedia library for Python |
9 | Summary(pl.UTF-8): Międzyplatformowa biblioteka Pythona do obsługi okien i multimediów | |
10 | Name: python-%{module} | |
eb8b39fb | 11 | Version: 1.4.4 |
4120a779 | 12 | Release: 2 |
fad7263f | 13 | License: BSD |
770077cd | 14 | Group: Development/Languages/Python |
eb8b39fb JB |
15 | #Source0Download: https://pypi.org/simple/pyglet/ |
16 | Source0: https://files.pythonhosted.org/packages/source/p/pyglet/%{module}-%{version}.zip | |
17 | # Source0-md5: ebd53b60f55b5d50e63f86e7df121e7a | |
770077cd | 18 | URL: http://www.pyglet.org/ |
4bdc2559 | 19 | %if %{with python2} |
eb8b39fb JB |
20 | BuildRequires: python-devel >= 1:2.7 |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: OpenGL >= 3 | |
24 | BuildRequires: python-mock | |
25 | BuildRequires: python-pytest | |
26 | %endif | |
4bdc2559 JR |
27 | %endif |
28 | %if %{with python3} | |
eb8b39fb JB |
29 | BuildRequires: python3-devel >= 1:3.4 |
30 | BuildRequires: python3-setuptools | |
31 | %if %{with tests} | |
32 | BuildRequires: OpenGL >= 3 | |
33 | BuildRequires: python3-pytest | |
34 | %endif | |
4bdc2559 | 35 | %endif |
770077cd | 36 | BuildRequires: rpm-pythonprov |
eb8b39fb JB |
37 | BuildRequires: rpmbuild(macros) >= 1.714 |
38 | Requires: python-modules >= 1:2.7 | |
770077cd | 39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | pyglet provides an object-oriented programming interface for | |
44 | developing games and other visually-rich applications. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | pyglet dostarcza interfejs do programowania zorientowanego obiektowo | |
48 | dla rozwoju gier i innych aplikacji wizualnych. | |
49 | ||
4bdc2559 JR |
50 | %package -n python3-%{module} |
51 | Summary: A cross-platform windowing and multimedia library for Python | |
52 | Summary(pl.UTF-8): Międzyplatformowa biblioteka Pythona do obsługi okien i multimediów | |
53 | Group: Libraries/Python | |
eb8b39fb | 54 | Requires: python3-modules >= 1:3.4 |
4bdc2559 JR |
55 | |
56 | %description -n python3-%{module} | |
57 | pyglet provides an object-oriented programming interface for | |
58 | developing games and other visually-rich applications. | |
59 | ||
60 | %description -n python3-%{module} -l pl.UTF-8 | |
61 | pyglet dostarcza interfejs do programowania zorientowanego obiektowo | |
62 | dla rozwoju gier i innych aplikacji wizualnych. | |
63 | ||
770077cd | 64 | %prep |
65 | %setup -q -n %{module}-%{version} | |
66 | ||
67 | %build | |
4bdc2559 | 68 | %if %{with python2} |
9b4ed0a6 | 69 | %py_build |
eb8b39fb JB |
70 | |
71 | %if %{with tests} | |
72 | %{__python} -m pytest tests | |
73 | %endif | |
4bdc2559 JR |
74 | %endif |
75 | ||
76 | %if %{with python3} | |
9b4ed0a6 | 77 | %py3_build |
eb8b39fb JB |
78 | |
79 | %if %{with tests} | |
80 | %{__python3} -m pytest tests | |
81 | %endif | |
4bdc2559 | 82 | %endif |
770077cd | 83 | |
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
4bdc2559 JR |
86 | |
87 | %if %{with python2} | |
9b4ed0a6 | 88 | %py_install |
770077cd | 89 | |
770077cd | 90 | %py_postclean |
4bdc2559 JR |
91 | %endif |
92 | ||
93 | %if %{with python3} | |
9b4ed0a6 | 94 | %py3_install |
4bdc2559 | 95 | %endif |
770077cd | 96 | |
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
4bdc2559 | 100 | %if %{with python2} |
770077cd | 101 | %files |
102 | %defattr(644,root,root,755) | |
eb8b39fb JB |
103 | %doc LICENSE NOTICE README.rst RELEASE_NOTES |
104 | %{py_sitescriptdir}/pyglet | |
105 | %{py_sitescriptdir}/pyglet-%{version}-py*.egg-info | |
4bdc2559 JR |
106 | %endif |
107 | ||
108 | %if %{with python3} | |
109 | %files -n python3-%{module} | |
110 | %defattr(644,root,root,755) | |
eb8b39fb JB |
111 | %doc LICENSE NOTICE README.rst RELEASE_NOTES |
112 | %{py3_sitescriptdir}/pyglet | |
113 | %{py3_sitescriptdir}/pyglet-%{version}-py*.egg-info | |
4bdc2559 | 114 | %endif |