@@ -106,6 +106,20 @@ code scan defect lists to find out added or fixed defects.
106
106
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
107
107
%endif
108
108
109
+ # build the python3-csdiff package on Fedora 23+
110
+ %global py3_support ((7 < 0%{?rhel}) || (22 < 0%{?fedora}))
111
+ %if %{py3_support}
112
+ %package -n python3-%{name}
113
+ Summary: Python interface to csdiff for Python 3
114
+ BuildRequires: boost-python3-devel
115
+ BuildRequires: python3-devel
116
+ %{?python_provide:%python_provide python3-%{name}}
117
+
118
+ %description -n python3-%{name}
119
+ This package contains the Python 3 binding for the csdiff tool for comparing
120
+ code scan defect lists to find out added or fixed defects.
121
+ %endif
122
+
109
123
%prep
110
124
%setup -q
111
125
@@ -116,7 +130,19 @@ cd csdiff_build
116
130
%cmake .. -DPYTHON_EXECUTABLE=%{__python2}
117
131
make %{?_smp_mflags} VERBOSE=yes
118
132
133
+ # build the python3-csdiff package on Fedora 23+
134
+ %if %{py3_support}
135
+ mkdir ../csdiff_build_py3
136
+ cd ../csdiff_build_py3
137
+ %cmake .. -DPYTHON_EXECUTABLE=%{__python3} -DBOOST_PYTHON_LIB_NAME=boost_python3
138
+ make %{?_smp_mflags} VERBOSE=yes pycsdiff
139
+ %endif
140
+
119
141
%install
142
+ %if %{py3_support}
143
+ mkdir -vp %{buildroot}%{python3_sitearch}
144
+ install -vm0644 csdiff_build_py3/pycsdiff.so %{buildroot}%{python3_sitearch}
145
+ %endif
120
146
cd csdiff_build
121
147
make install DESTDIR="\$ RPM_BUILD_ROOT"
122
148
@@ -140,6 +166,12 @@ ctest %{?_smp_mflags} --output-on-failure
140
166
%files -n python2-%{name}
141
167
%{python2_sitearch}/pycsdiff.so
142
168
%doc COPYING
169
+
170
+ %if %{py3_support}
171
+ %files -n python3-%{name}
172
+ %{python3_sitearch}/pycsdiff.so
173
+ %doc COPYING
174
+ %endif
143
175
EOF
144
176
145
177
set -v
0 commit comments