1 # NOTE: for versions >= 1.11 (for python 3.5+) see python3-webcolors.spec
4 %bcond_without python2 # CPython 2.x module
5 %bcond_with python3 # CPython 3.x module (built from python3-webcolors.spec)
6 %bcond_without doc # Sphinx documentation
7 %bcond_without tests # unit tests
9 %define module webcolors
10 Summary: Library for working with sRGB color specifications as used in HTML and CSS
11 Summary(pl.UTF-8): Biblioteka do pracy z definicjami kolorów sRGB używanymi w formatach HTML i CSS
12 Name: python-%{module}
13 # keep 1.10.x here for python2 support
17 Group: Libraries/Python
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
21 URL: https://github.com/ubernostrum/webcolors
23 BuildRequires: python-modules >= 1:2.7
25 BuildRequires: python-six
29 Requires: python3-modules >= 1:3.5
31 BuildRequires: python3-six
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.714
37 BuildRequires: python3-sphinx_rtd_theme
38 BuildRequires: sphinx-pdg
40 Requires: python-modules >= 1:2.7
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
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):
51 - Specification-defined color names
52 - Six-digit hexadecimal
53 - Three-digit hexadecimal
54 - Integer rgb() triplet
55 - Percentage rgb() triple
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
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()
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
75 Requires: python3-modules >= 1:3.5
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.
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
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
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()
105 Summary: Documentation for Python webcolors module
106 Summary(pl.UTF-8): Dokumentacja do modułu Pythona webcolors
110 Documentation for Python webcolors module.
112 %description apidocs -l pl.UTF-8
113 Dokumentacja do modułu Pythona webcolors.
116 %setup -q -n %{module}-%{version}
123 PYTHONPATH=$(pwd)/build-2/lib \
124 %{__python} -m unittest discover -s tests
132 PYTHONPATH=$(pwd)/build-3/lib \
133 %{__python3} -m unittest discover -s tests
138 %{__make} -C docs html \
139 SPHINXBUILD=sphinx-build-3
143 rm -rf $RPM_BUILD_ROOT
156 rm -rf $RPM_BUILD_ROOT
160 %defattr(644,root,root,755)
161 %doc LICENSE README.rst
162 %{py_sitescriptdir}/webcolors.py[co]
163 %{py_sitescriptdir}/webcolors-%{version}-*.egg-info
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
177 %defattr(644,root,root,755)
178 %doc docs/_build/html/{_static,*.html,*.js}