]> git.pld-linux.org Git - packages/python-webcolors.git/blob - python-webcolors.spec
1065dc7614894ec165945ee83ce789e49a1c2743
[packages/python-webcolors.git] / python-webcolors.spec
1 #
2 # Conditional build:
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
7
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}
12 Version:        1.10
13 Release:        2
14 License:        BSD
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
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 %if %{with tests}
23 BuildRequires:  python-six
24 %endif
25 %endif
26 %if %{with python3}
27 Requires:       python3-modules >= 1:3.5
28 %if %{with tests}
29 BuildRequires:  python3-six
30 %endif
31 %endif
32 BuildRequires:  rpm-pythonprov
33 BuildRequires:  rpmbuild(macros) >= 1.714
34 %if %{with doc}
35 BuildRequires:  python3-sphinx_rtd_theme
36 BuildRequires:  sphinx-pdg
37 %endif
38 Requires:       python-modules >= 1:2.7
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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.
45
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
54
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
58 dokumentach WWW.
59
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()
68
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
74
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.
78
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
87
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
91 dokumentach WWW.
92
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()
101
102 %package apidocs
103 Summary:        Documentation for Python webcolors module
104 Summary(pl.UTF-8):      Dokumentacja do modułu Pythona webcolors
105 Group:          Documentation
106
107 %description apidocs
108 Documentation for Python webcolors module.
109
110 %description apidocs -l pl.UTF-8
111 Dokumentacja do modułu Pythona webcolors.
112
113 %prep
114 %setup -q -n %{module}-%{version}
115
116 %build
117 %if %{with python2}
118 %py_build
119
120 %if %{with tests}
121 PYTHONPATH=$(pwd)/build-2/lib \
122 %{__python} -m unittest discover -s tests
123 %endif
124 %endif
125
126 %if %{with python3}
127 %py3_build
128
129 %if %{with tests}
130 PYTHONPATH=$(pwd)/build-3/lib \
131 %{__python3} -m unittest discover -s tests
132 %endif
133 %endif
134
135 %if %{with doc}
136 %{__make} -C docs html \
137         SPHINXBUILD=sphinx-build-3
138 %endif
139
140 %install
141 rm -rf $RPM_BUILD_ROOT
142
143 %if %{with python2}
144 %py_install
145
146 %py_postclean
147 %endif
148
149 %if %{with python3}
150 %py3_install
151 %endif
152
153 %clean
154 rm -rf $RPM_BUILD_ROOT
155
156 %if %{with python2}
157 %files
158 %defattr(644,root,root,755)
159 %doc LICENSE README.rst
160 %{py_sitescriptdir}/webcolors.py[co]
161 %{py_sitescriptdir}/webcolors-%{version}-*.egg-info
162 %endif
163
164 %if %{with python3}
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
171 %endif
172
173 %if %{with doc}
174 %files apidocs
175 %defattr(644,root,root,755)
176 %doc docs/_build/html/{_static,*.html,*.js}
177 %endif
This page took 0.080237 seconds and 2 git commands to generate.