]> git.pld-linux.org Git - packages/python-imagesize.git/blob - python-imagesize.spec
rebuild with python 3.10
[packages/python-imagesize.git] / python-imagesize.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 Summary:        Python 2 module to get image size from PNG/JPEG/JPEG2000/GIF file
8 Summary(pl.UTF-8):      Moduł Pythona 2 do pobierania rozmiaru obrazu z pliku PNG/JPEG/JPEG2000/GIF
9 Name:           python-imagesize
10 Version:        1.3.0
11 Release:        3
12 License:        MIT
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/imagesize/
15 Source0:        https://files.pythonhosted.org/packages/source/i/imagesize/imagesize-%{version}.tar.gz
16 # Source0-md5:  27da6cc27370c69834723012f2eb203a
17 Patch0:         %{name}-py2.patch
18 URL:            https://pypi.org/project/imagesize/
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-modules >= 1:3.4
27 BuildRequires:  python3-setuptools
28 %endif
29 Requires:       python-modules >= 1:2.7
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 This module analyzes JPEG/JPEG2000/PNG/GIF image header and returns
35 image size.
36
37 %description -l pl.UTF-8
38 Ten moduł analizuje nagłówek pliku JPEG/JPEG2000/PNG/GIF i zwraca
39 rozmiary obrazka.
40
41 %package -n python3-imagesize
42 Summary:        Python 3 module to get image size from PNG/JPEG/JPEG2000/GIF file
43 Summary(pl.UTF-8):      Moduł Pythona 3 do pobierania rozmiaru obrazu z pliku PNG/JPEG/JPEG2000/GIF
44 Group:          Libraries/Python
45 Requires:       python3-modules >= 1:3.4
46
47 %description -n python3-imagesize
48 This module analyzes JPEG/JPEG2000/PNG/GIF image header and returns
49 image size.
50
51 %description -n python3-imagesize -l pl.UTF-8
52 Ten moduł analizuje nagłówek pliku JPEG/JPEG2000/PNG/GIF i zwraca
53 rozmiary obrazka.
54
55 %prep
56 %setup -q -n imagesize-%{version}
57 %patch0 -p1
58
59 %build
60 %if %{with python2}
61 %py_build
62
63 %if %{with tests}
64 %{__python} -m unittest discover -s test
65 %endif
66 %endif
67
68 %if %{with python3}
69 %py3_build
70
71 %if %{with tests}
72 %{__python3} -m unittest discover -s test
73 %endif
74 %endif
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78
79 %if %{with python2}
80 %py_install
81
82 %py_postclean
83 %endif
84
85 %if %{with python3}
86 %py3_install
87 %endif
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %if %{with python2}
93 %files
94 %defattr(644,root,root,755)
95 %doc LICENSE.rst README.rst
96 %{py_sitescriptdir}/imagesize.py[co]
97 %{py_sitescriptdir}/imagesize-%{version}-py*.egg-info
98 %endif
99
100 %if %{with python3}
101 %files -n python3-imagesize
102 %defattr(644,root,root,755)
103 %doc LICENSE.rst README.rst
104 %{py3_sitescriptdir}/imagesize.py
105 %{py3_sitescriptdir}/__pycache__/imagesize.cpython-*.py[co]
106 %{py3_sitescriptdir}/imagesize-%{version}-py*.egg-info
107 %endif
This page took 0.049929 seconds and 3 git commands to generate.