]> git.pld-linux.org Git - SPECS.git/blob - python-pycosat.spec
SPECS updated Sat 31 Jul 21:27:02 CEST 2021
[SPECS.git] / python-pycosat.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module          pycosat
8 %define         egg_name        pycosat
9 %define         pypi_name       pycosat
10 Summary:        Python bindings to picosat (a SAT solver)
11 Name:           python-%{pypi_name}
12 Version:        0.6.3
13 Release:        1
14 License:        MIT
15 Group:          Libraries/Python
16 Source0:        https://github.com/ContinuumIO/pycosat/archive/%{version}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5:  08e378db1c15dc1668bc62897bd325a5
18 URL:            https://github.com/ContinuumIO/pycosat
19 BuildRequires:  picosat-devel
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 %if %{with python2}
23 BuildRequires:  python-devel
24 BuildRequires:  python-modules
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-pytest
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3-devel
32 BuildRequires:  python3-modules
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  python3-pytest
36 %endif
37 %endif
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 PicoSAT is a popular SAT solver written by Armin Biere in pure C. This
42 package provides efficient Python bindings to picosat on the C level,
43 i.e. when importing pycosat, the picosat solver becomes part of the
44 Python process itself.
45
46 %package -n python3-%{pypi_name}
47 Summary:        Python bindings to picosat (a SAT solver)
48 Group:          Libraries/Python
49
50 %description -n python3-%{pypi_name}
51 PicoSAT is a popular SAT solver written by Armin Biere in pure C. This
52 package provides efficient Python bindings to picosat on the C level,
53 i.e. when importing pycosat, the picosat solver becomes part of the
54 Python process itself.
55
56 %prep
57 %setup -q -n %{pypi_name}-%{version}
58 sed -i -e s/distutils.core/setuptools/ setup.py
59 rm picosat.*
60
61 %build
62 %if %{with python2}
63 CFLAGS="%{rpmcflags}" %{__python} setup.py build_ext --inplace
64 %if %{with tests}
65 py.test-2 -vv
66 %endif
67 %endif
68
69 %if %{with python3}
70 CFLAGS="%{rpmcflags}" %{__python3} setup.py build_ext --inplace
71 %if %{with tests}
72 py.test-3 -vv
73 %endif
74 %endif
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78 %if %{with python2}
79 %{__python} setup.py \
80         install --skip-build \
81         --prefix=%{_prefix} \
82         --install-purelib=%{py_sitescriptdir} \
83         --install-platlib=%{py_sitedir} \
84         --optimize=2 \
85         --root=$RPM_BUILD_ROOT
86 %py_postclean
87 %endif
88
89 %if %{with python3}
90 %{__python3} setup.py \
91         install --skip-build \
92         --prefix=%{_prefix} \
93         --install-purelib=%{py3_sitescriptdir} \
94         --install-platlib=%{py3_sitedir} \
95         --optimize=2 \
96         --root=$RPM_BUILD_ROOT
97 %endif
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %files
103 %defattr(644,root,root,755)
104 %doc CHANGELOG README.rst LICENSE
105 %attr(755,root,root) %{py_sitedir}/pycosat.so
106 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
107
108 %files -n python3-%{pypi_name}
109 %defattr(644,root,root,755)
110 %doc CHANGELOG README.rst LICENSE
111 %attr(755,root,root) %{py3_sitedir}/%{module}.cpython-*.so
112 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info
This page took 0.574948 seconds and 3 git commands to generate.