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 #Source0Download: https://github.com/ubernostrum/webcolors/releases
17 Source0: https://github.com/ubernostrum/webcolors/archive/%{version}/%{module}-%{version}.tar.gz
18 # Source0-md5: 195e37e745a77609aca47ea22b01d8b1
19 URL: https://github.com/ubernostrum/webcolors
21 BuildRequires: python-modules >= 1:2.7
23 BuildRequires: python-six
27 Requires: python3-modules >= 1:3.5
29 BuildRequires: python3-six
32 BuildRequires: rpm-pythonprov
33 BuildRequires: rpmbuild(macros) >= 1.714
35 BuildRequires: python3-sphinx_rtd_theme
36 BuildRequires: sphinx-pdg
38 Requires: python-modules >= 1:2.7
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 A library for working with color names and color value formats defined
44 by the HTML and CSS specifications for use in documents on the Web.
46 Support is included for the following formats (RGB colorspace only;
47 conversion to/from HSL can be handled by the colorsys module in the
48 Python standard library):
49 - Specification-defined color names
50 - Six-digit hexadecimal
51 - Three-digit hexadecimal
52 - Integer rgb() triplet
53 - Percentage rgb() triple
55 %description -l pl.UTF-8
56 Biblioteka do pracy z nazwami kolorów oraz formatami wartości kolorów
57 określonymi w specyfikacjach HTML i CSS, przeznaczonych do użycia w
60 Obsługiwane są następujące formaty (tylko przestrzeń nazw RGB;
61 konwersję do/z HSL można uzyskać korzystając z modułu colorsys
62 biblioteki standardowej Pythona):
63 - nazwy kolorów określone w specyfikacji
64 - sześciocyfrowe wartości szesnastkowe
65 - trzycyfrowe wartości szesnastkowe
66 - trójki całkowite rgb()
67 - trójki procentowe rgb()
69 %package -n python3-%{module}
70 Summary: Library for working with sRGB color specifications as used in HTML and CSS
71 Summary(pl.UTF-8): Biblioteka do pracy z definicjami kolorów sRGB używanymi w formatach HTML i CSS
72 Group: Libraries/Python
73 Requires: python3-modules >= 1:3.5
75 %description -n python3-%{module}
76 A library for working with color names and color value formats defined
77 by the HTML and CSS specifications for use in documents on the Web.
79 Support is included for the following formats (RGB colorspace only;
80 conversion to/from HSL can be handled by the colorsys module in the
81 Python standard library):
82 - Specification-defined color names
83 - Six-digit hexadecimal
84 - Three-digit hexadecimal
85 - Integer rgb() triplet
86 - Percentage rgb() triple
88 %description -n python3-%{module} -l pl.UTF-8
89 Biblioteka do pracy z nazwami kolorów oraz formatami wartości kolorów
90 określonymi w specyfikacjach HTML i CSS, przeznaczonych do użycia w
93 Obsługiwane są następujące formaty (tylko przestrzeń nazw RGB;
94 konwersję do/z HSL można uzyskać korzystając z modułu colorsys
95 biblioteki standardowej Pythona):
96 - nazwy kolorów określone w specyfikacji
97 - sześciocyfrowe wartości szesnastkowe
98 - trzycyfrowe wartości szesnastkowe
99 - trójki całkowite rgb()
100 - trójki procentowe rgb()
103 Summary: Documentation for Python webcolors module
104 Summary(pl.UTF-8): Dokumentacja do modułu Pythona webcolors
108 Documentation for Python webcolors module.
110 %description apidocs -l pl.UTF-8
111 Dokumentacja do modułu Pythona webcolors.
114 %setup -q -n %{module}-%{version}
121 PYTHONPATH=$(pwd)/build-2/lib \
122 %{__python} -m unittest discover -s tests
130 PYTHONPATH=$(pwd)/build-3/lib \
131 %{__python3} -m unittest discover -s tests
136 %{__make} -C docs html \
137 SPHINXBUILD=sphinx-build-3
141 rm -rf $RPM_BUILD_ROOT
154 rm -rf $RPM_BUILD_ROOT
158 %defattr(644,root,root,755)
159 %doc LICENSE README.rst
160 %{py_sitescriptdir}/webcolors.py[co]
161 %{py_sitescriptdir}/webcolors-%{version}-*.egg-info
165 %files -n python3-%{module}
166 %defattr(644,root,root,755)
167 %doc LICENSE README.rst
168 %{py3_sitescriptdir}/webcolors.py
169 %{py3_sitescriptdir}/__pycache__/webcolors.cpython-*.py[co]
170 %{py3_sitescriptdir}/webcolors-%{version}-*.egg-info
175 %defattr(644,root,root,755)
176 %doc docs/_build/html/{_static,*.html,*.js}