]> git.pld-linux.org Git - packages/python-compreffor.git/blob - python-compreffor.spec
- new
[packages/python-compreffor.git] / python-compreffor.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_with     python3 # CPython 3.x module (built from python3-compreffor.spec)
6
7 Summary:        CFF table subroutinizer for FontTools
8 Summary(pl.UTF-8):      Generator podprocedur tablic CFF dla FontTools
9 Name:           python-compreffor
10 # keep 0.4.x here for python2 support
11 Version:        0.4.6.post1
12 Release:        1
13 License:        Apache v2.0
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/compreffor/
16 Source0:        https://files.pythonhosted.org/packages/source/c/compreffor/compreffor-%{version}.zip
17 # Source0-md5:  202273efacb23031fc87352527ace317
18 URL:            https://pypi.org/project/compreffor/
19 BuildRequires:  libstdc++-devel >= 6:4.3
20 %if %{with python2}
21 BuildRequires:  python-Cython >= 0.28.4
22 BuildRequires:  python-devel >= 1:2.5
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-fonttools >= 3.1
26 BuildRequires:  python-pytest >= 2.8
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-Cython >= 0.28.4
31 BuildRequires:  python3-devel >= 1:3.2
32 BuildRequires:  python3-setuptools
33 %if %{with tests}
34 BuildRequires:  python3-fonttools >= 3.1
35 BuildRequires:  python3-pytest >= 2.8
36 %endif
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.714
40 BuildRequires:  sed >= 4.0
41 BuildRequires:  unzip
42 Requires:       python-modules >= 1:2.5
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 CFF table subroutinizer for FontTools.
47
48 %description -l pl.UTF-8
49 Generator podprocedur tablic CFF dla FontTools.
50
51 %package -n python3-compreffor
52 Summary:        CFF table subroutinizer for FontTools
53 Summary(pl.UTF-8):      Generator podprocedur tablic CFF dla FontTools
54 Group:          Libraries/Python
55 Requires:       python3-modules >= 1:3.2
56
57 %description -n python3-compreffor
58 CFF table subroutinizer for FontTools.
59
60 %description -n python3-compreffor -l pl.UTF-8
61 Generator podprocedur tablic CFF dla FontTools.
62
63 %prep
64 %setup -q -n compreffor-%{version}
65
66 # move out of compreffor dir, so that:
67 # - `import compreffor` can search built-* dirs with binary modules instead of src
68 # - we don't package tests
69 %{__mv} src/python/compreffor/test tests
70 %{__sed} -i -e 's/compreffor\.test\.dummy/.dummy/' tests/pyCompressor_test.py
71
72 %build
73 %if %{with python2}
74 %py_build
75
76 %if %{with tests}
77 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
78 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
79 %{__python} -m pytest tests
80 %endif
81 %endif
82
83 %if %{with python3}
84 %py3_build
85
86 %if %{with tests}
87 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
88 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
89 %{__python3} -m pytest tests
90 %endif
91 %endif
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95
96 %if %{with python2}
97 %py_install
98
99 %{__mv} $RPM_BUILD_ROOT%{_bindir}/compreffor{,-2}
100
101 %py_postclean
102 %endif
103
104 %if %{with python3}
105 %py3_install
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %files
113 %defattr(644,root,root,755)
114 %doc README.rst
115 %attr(755,root,root) %{_bindir}/compreffor-2
116 %dir %{py_sitedir}/compreffor
117 %attr(755,root,root) %{py_sitedir}/compreffor/_compreffor.so
118 %{py_sitedir}/compreffor/*.py[co]
119 %{py_sitedir}/compreffor-%{version}-py*.egg-info
120 %endif
121
122 %if %{with python3}
123 %files -n python3-compreffor
124 %defattr(644,root,root,755)
125 %doc README.rst
126 %attr(755,root,root) %{_bindir}/compreffor
127 %dir %{py3_sitedir}/compreffor
128 %attr(755,root,root) %{py3_sitedir}/compreffor/_compreffor.cpython-*.so
129 %{py3_sitedir}/compreffor/*.py
130 %{py3_sitedir}/compreffor/__pycache__
131 %{py3_sitedir}/compreffor-%{version}-py*.egg-info
132 %endif
This page took 0.037974 seconds and 3 git commands to generate.