3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without doc # Sphinx documentation
6 %bcond_without tests # unit tests
8 %define module webcolors
9 Summary: Library for working with sRGB color specifications as used in HTML and CSS
10 Summary(pl.UTF-8): Biblioteka do pracy z definicjami kolorów sRGB używanymi w formatach HTML i CSS
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://github.com/ubernostrum/webcolors/archive/%{version}.tar.gz
17 # Source0-md5: 990e54860ca7aee2be7aec52b1726d2e
18 URL: https://github.com/ubernostrum/webcolors
20 BuildRequires: python-modules >= 1:2.7
23 Requires: python3-modules >= 1:3.3
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.714
28 BuildRequires: python3-sphinx_rtd_theme
29 BuildRequires: sphinx-pdg
31 Requires: python-modules >= 1:2.7
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 A library for working with color names and color value formats defined
37 by the HTML and CSS specifications for use in documents on the Web.
39 Support is included for the following formats (RGB colorspace only;
40 conversion to/from HSL can be handled by the colorsys module in the
41 Python standard library):
42 - Specification-defined color names
43 - Six-digit hexadecimal
44 - Three-digit hexadecimal
45 - Integer rgb() triplet
46 - Percentage rgb() triple
48 %description -l pl.UTF-8
49 Biblioteka do pracy z nazwami kolorów oraz formatami wartości kolorów
50 określonymi w specyfikacjach HTML i CSS, przeznaczonych do użycia w
53 Obsługiwane są następujące formaty (tylko przestrzeń nazw RGB;
54 konwersję do/z HSL można uzyskać korzystając z modułu colorsys
55 biblioteki standardowej Pythona):
56 - nazwy kolorów określone w specyfikacji
57 - sześciocyfrowe wartości szesnastkowe
58 - trzycyfrowe wartości szesnastkowe
59 - trójki całkowite rgb()
60 - trójki procentowe rgb()
62 %package -n python3-%{module}
63 Summary: Library for working with sRGB color specifications as used in HTML and CSS
64 Summary(pl.UTF-8): Biblioteka do pracy z definicjami kolorów sRGB używanymi w formatach HTML i CSS
65 Group: Libraries/Python
66 Requires: python3-modules >= 1:3.3
68 %description -n python3-%{module}
69 A library for working with color names and color value formats defined
70 by the HTML and CSS specifications for use in documents on the Web.
72 Support is included for the following formats (RGB colorspace only;
73 conversion to/from HSL can be handled by the colorsys module in the
74 Python standard library):
75 - Specification-defined color names
76 - Six-digit hexadecimal
77 - Three-digit hexadecimal
78 - Integer rgb() triplet
79 - Percentage rgb() triple
81 %description -n python3-%{module} -l pl.UTF-8
82 Biblioteka do pracy z nazwami kolorów oraz formatami wartości kolorów
83 określonymi w specyfikacjach HTML i CSS, przeznaczonych do użycia w
86 Obsługiwane są następujące formaty (tylko przestrzeń nazw RGB;
87 konwersję do/z HSL można uzyskać korzystając z modułu colorsys
88 biblioteki standardowej Pythona):
89 - nazwy kolorów określone w specyfikacji
90 - sześciocyfrowe wartości szesnastkowe
91 - trzycyfrowe wartości szesnastkowe
92 - trójki całkowite rgb()
93 - trójki procentowe rgb()
96 Summary: Documentation for Python webcolors module
97 Summary(pl.UTF-8): Dokumentacja do modułu Pythona webcolors
101 Documentation for Python webcolors module.
103 %description apidocs -l pl.UTF-8
104 Dokumentacja do modułu Pythona webcolors.
107 %setup -q -n %{module}-%{version}
113 %{__python} -m unittest discover -s tests
119 %{__python3} -m unittest discover -s tests
123 %{__make} -C docs html
127 rm -rf $RPM_BUILD_ROOT
140 rm -rf $RPM_BUILD_ROOT
144 %defattr(644,root,root,755)
145 %doc LICENSE README.rst
146 %{py_sitescriptdir}/webcolors.py[co]
147 %{py_sitescriptdir}/webcolors-%{version}-*.egg-info
151 %files -n python3-%{module}
152 %defattr(644,root,root,755)
153 %doc LICENSE README.rst
154 %{py3_sitescriptdir}/webcolors.py
155 %{py3_sitescriptdir}/__pycache__/webcolors.cpython-*.py[co]
156 %{py3_sitescriptdir}/webcolors-%{version}-*.egg-info
161 %defattr(644,root,root,755)
162 %doc docs/_build/html/{_static,*.html,*.js}