]> git.pld-linux.org Git - packages/python-webcolors.git/blob - python-webcolors.spec
- release 3 (by relup.sh)
[packages/python-webcolors.git] / python-webcolors.spec
1 # NOTE: for versions >= 1.11 (for python 3.5+) see python3-webcolors.spec
2 #
3 # Conditional build:
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
8
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
14 Version:        1.10
15 Release:        3
16 License:        BSD
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
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 %if %{with tests}
25 BuildRequires:  python-six
26 %endif
27 %endif
28 %if %{with python3}
29 Requires:       python3-modules >= 1:3.5
30 %if %{with tests}
31 BuildRequires:  python3-six
32 %endif
33 %endif
34 BuildRequires:  rpm-pythonprov
35 BuildRequires:  rpmbuild(macros) >= 1.714
36 %if %{with doc}
37 BuildRequires:  python3-sphinx_rtd_theme
38 BuildRequires:  sphinx-pdg
39 %endif
40 Requires:       python-modules >= 1:2.7
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
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.
47
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
56
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
75 Requires:       python3-modules >= 1:3.5
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
115 %prep
116 %setup -q -n %{module}-%{version}
117
118 %build
119 %if %{with python2}
120 %py_build
121
122 %if %{with tests}
123 PYTHONPATH=$(pwd)/build-2/lib \
124 %{__python} -m unittest discover -s tests
125 %endif
126 %endif
127
128 %if %{with python3}
129 %py3_build
130
131 %if %{with tests}
132 PYTHONPATH=$(pwd)/build-3/lib \
133 %{__python3} -m unittest discover -s tests
134 %endif
135 %endif
136
137 %if %{with doc}
138 %{__make} -C docs html \
139         SPHINXBUILD=sphinx-build-3
140 %endif
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144
145 %if %{with python2}
146 %py_install
147
148 %py_postclean
149 %endif
150
151 %if %{with python3}
152 %py3_install
153 %endif
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %if %{with python2}
159 %files
160 %defattr(644,root,root,755)
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}
179 %endif
This page took 0.073589 seconds and 4 git commands to generate.