]>
Commit | Line | Data |
---|---|---|
fe5065d6 | 1 | # NOTE: for versions >= 1.11 (for python 3.5+) see python3-webcolors.spec |
2b581be5 JB |
2 | # |
3 | # Conditional build: | |
4 | %bcond_without python2 # CPython 2.x module | |
fe5065d6 | 5 | %bcond_with python3 # CPython 3.x module (built from python3-webcolors.spec) |
2b581be5 JB |
6 | %bcond_without doc # Sphinx documentation |
7 | %bcond_without tests # unit tests | |
8 | ||
2fc397ca | 9 | %define module webcolors |
fdfbf7ac | 10 | Summary: Library for working with sRGB color specifications as used in HTML and CSS |
2b581be5 | 11 | Summary(pl.UTF-8): Biblioteka do pracy z definicjami kolorów sRGB używanymi w formatach HTML i CSS |
fdfbf7ac | 12 | Name: python-%{module} |
fe5065d6 | 13 | # keep 1.10.x here for python2 support |
ece3c2f0 | 14 | Version: 1.10 |
819e9df1 | 15 | Release: 3 |
2b581be5 JB |
16 | License: BSD |
17 | Group: Libraries/Python | |
ece3c2f0 JB |
18 | #Source0Download: https://github.com/ubernostrum/webcolors/releases |
19 | Source0: https://github.com/ubernostrum/webcolors/archive/%{version}/%{module}-%{version}.tar.gz | |
20 | # Source0-md5: 195e37e745a77609aca47ea22b01d8b1 | |
2b581be5 JB |
21 | URL: https://github.com/ubernostrum/webcolors |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.7 | |
ece3c2f0 JB |
24 | %if %{with tests} |
25 | BuildRequires: python-six | |
26 | %endif | |
2b581be5 JB |
27 | %endif |
28 | %if %{with python3} | |
ece3c2f0 JB |
29 | Requires: python3-modules >= 1:3.5 |
30 | %if %{with tests} | |
31 | BuildRequires: python3-six | |
32 | %endif | |
2b581be5 | 33 | %endif |
548575ad | 34 | BuildRequires: rpm-pythonprov |
2b581be5 JB |
35 | BuildRequires: rpmbuild(macros) >= 1.714 |
36 | %if %{with doc} | |
8b3dbc2e | 37 | BuildRequires: python3-sphinx_rtd_theme |
2b581be5 JB |
38 | BuildRequires: sphinx-pdg |
39 | %endif | |
2b581be5 | 40 | Requires: python-modules >= 1:2.7 |
2fc397ca | 41 | BuildArch: noarch |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
7cbd3e6a ER |
45 | A library for working with color names and color value formats defined |
46 | by the HTML and CSS specifications for use in documents on the Web. | |
2fc397ca | 47 | |
7cbd3e6a ER |
48 | Support is included for the following formats (RGB colorspace only; |
49 | conversion to/from HSL can be handled by the colorsys module in the | |
50 | Python standard library): | |
2fc397ca | 51 | - Specification-defined color names |
52 | - Six-digit hexadecimal | |
53 | - Three-digit hexadecimal | |
54 | - Integer rgb() triplet | |
55 | - Percentage rgb() triple | |
56 | ||
2b581be5 JB |
57 | %description -l pl.UTF-8 |
58 | Biblioteka do pracy z nazwami kolorów oraz formatami wartości kolorów | |
59 | określonymi w specyfikacjach HTML i CSS, przeznaczonych do użycia w | |
60 | dokumentach WWW. | |
61 | ||
62 | Obsługiwane są następujące formaty (tylko przestrzeń nazw RGB; | |
63 | konwersję do/z HSL można uzyskać korzystając z modułu colorsys | |
64 | biblioteki standardowej Pythona): | |
65 | - nazwy kolorów określone w specyfikacji | |
66 | - sześciocyfrowe wartości szesnastkowe | |
67 | - trzycyfrowe wartości szesnastkowe | |
68 | - trójki całkowite rgb() | |
69 | - trójki procentowe rgb() | |
70 | ||
71 | %package -n python3-%{module} | |
72 | Summary: Library for working with sRGB color specifications as used in HTML and CSS | |
73 | Summary(pl.UTF-8): Biblioteka do pracy z definicjami kolorów sRGB używanymi w formatach HTML i CSS | |
74 | Group: Libraries/Python | |
ece3c2f0 | 75 | Requires: python3-modules >= 1:3.5 |
2b581be5 JB |
76 | |
77 | %description -n python3-%{module} | |
78 | A library for working with color names and color value formats defined | |
79 | by the HTML and CSS specifications for use in documents on the Web. | |
80 | ||
81 | Support is included for the following formats (RGB colorspace only; | |
82 | conversion to/from HSL can be handled by the colorsys module in the | |
83 | Python standard library): | |
84 | - Specification-defined color names | |
85 | - Six-digit hexadecimal | |
86 | - Three-digit hexadecimal | |
87 | - Integer rgb() triplet | |
88 | - Percentage rgb() triple | |
89 | ||
90 | %description -n python3-%{module} -l pl.UTF-8 | |
91 | Biblioteka do pracy z nazwami kolorów oraz formatami wartości kolorów | |
92 | określonymi w specyfikacjach HTML i CSS, przeznaczonych do użycia w | |
93 | dokumentach WWW. | |
94 | ||
95 | Obsługiwane są następujące formaty (tylko przestrzeń nazw RGB; | |
96 | konwersję do/z HSL można uzyskać korzystając z modułu colorsys | |
97 | biblioteki standardowej Pythona): | |
98 | - nazwy kolorów określone w specyfikacji | |
99 | - sześciocyfrowe wartości szesnastkowe | |
100 | - trzycyfrowe wartości szesnastkowe | |
101 | - trójki całkowite rgb() | |
102 | - trójki procentowe rgb() | |
103 | ||
104 | %package apidocs | |
105 | Summary: Documentation for Python webcolors module | |
106 | Summary(pl.UTF-8): Dokumentacja do modułu Pythona webcolors | |
107 | Group: Documentation | |
108 | ||
109 | %description apidocs | |
110 | Documentation for Python webcolors module. | |
111 | ||
112 | %description apidocs -l pl.UTF-8 | |
113 | Dokumentacja do modułu Pythona webcolors. | |
114 | ||
2fc397ca | 115 | %prep |
116 | %setup -q -n %{module}-%{version} | |
2fc397ca | 117 | |
118 | %build | |
2b581be5 | 119 | %if %{with python2} |
55c563e4 | 120 | %py_build |
2fc397ca | 121 | |
ece3c2f0 JB |
122 | %if %{with tests} |
123 | PYTHONPATH=$(pwd)/build-2/lib \ | |
6aea0558 | 124 | %{__python} -m unittest discover -s tests |
2b581be5 | 125 | %endif |
ece3c2f0 | 126 | %endif |
2b581be5 JB |
127 | |
128 | %if %{with python3} | |
129 | %py3_build | |
130 | ||
ece3c2f0 JB |
131 | %if %{with tests} |
132 | PYTHONPATH=$(pwd)/build-3/lib \ | |
6aea0558 | 133 | %{__python3} -m unittest discover -s tests |
2b581be5 | 134 | %endif |
ece3c2f0 | 135 | %endif |
2b581be5 JB |
136 | |
137 | %if %{with doc} | |
ece3c2f0 JB |
138 | %{__make} -C docs html \ |
139 | SPHINXBUILD=sphinx-build-3 | |
2b581be5 JB |
140 | %endif |
141 | ||
2fc397ca | 142 | %install |
143 | rm -rf $RPM_BUILD_ROOT | |
2b581be5 JB |
144 | |
145 | %if %{with python2} | |
146 | %py_install | |
2fc397ca | 147 | |
7cbd3e6a | 148 | %py_postclean |
2b581be5 JB |
149 | %endif |
150 | ||
151 | %if %{with python3} | |
152 | %py3_install | |
153 | %endif | |
7cbd3e6a | 154 | |
2fc397ca | 155 | %clean |
156 | rm -rf $RPM_BUILD_ROOT | |
157 | ||
2b581be5 | 158 | %if %{with python2} |
2fc397ca | 159 | %files |
160 | %defattr(644,root,root,755) | |
2b581be5 JB |
161 | %doc LICENSE README.rst |
162 | %{py_sitescriptdir}/webcolors.py[co] | |
163 | %{py_sitescriptdir}/webcolors-%{version}-*.egg-info | |
164 | %endif | |
165 | ||
166 | %if %{with python3} | |
167 | %files -n python3-%{module} | |
168 | %defattr(644,root,root,755) | |
169 | %doc LICENSE README.rst | |
170 | %{py3_sitescriptdir}/webcolors.py | |
171 | %{py3_sitescriptdir}/__pycache__/webcolors.cpython-*.py[co] | |
172 | %{py3_sitescriptdir}/webcolors-%{version}-*.egg-info | |
173 | %endif | |
174 | ||
175 | %if %{with doc} | |
176 | %files apidocs | |
177 | %defattr(644,root,root,755) | |
178 | %doc docs/_build/html/{_static,*.html,*.js} | |
2fc397ca | 179 | %endif |