Cleanup and update spec

This commit is contained in:
Orion Poplawski 2015-05-12 10:29:19 -06:00
parent 954dc1aa9a
commit 403fbf91ea

View File

@ -1,12 +1,17 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python3_sitearch: %define python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%{!?python3_sitearch: %global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%global modulename pyodbc
%if 0%{?fedora}
%bcond_without python3 1
%else
%bcond_with python3 1
%endif
Name: pyodbc
Version: 3.0.7
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Python DB API 2.0 Module for ODBC
Group: Development/Languages
License: MIT
@ -40,25 +45,29 @@ decimal.
%prep
%setup -q
%setup -qc
mv %{name}-%{version} python2
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
cp -a python2 python3
%endif
%build
%{__python} setup.py build
pushd python2
%{__python2} setup.py build
popd
%if 0%{?with_python3}
pushd %{py3dir}
pushd python3
%{__python3} setup.py build
popd
%endif
%install
%{__rm} -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
pushd python2
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
popd
%if 0%{?with_python3}
pushd %{py3dir}
pushd python3
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
@ -68,18 +77,23 @@ popd
%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%{python_sitearch}/*
%{!?_licensedir:%global license %%doc}
%license python2/LICENSE.txt
%doc python2/README.rst
%{python2_sitearch}/*
%if 0%{?with_python3}
%files -n python3-%{name}
%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%{!?_licensedir:%global license %%doc}
%license python3/LICENSE.txt
%doc python3/README.rst
%{python3_sitearch}/*
%endif
%changelog
* Tue May 12 2015 Orion Poplawski <orion@cora.wnra.com> - 3.0.7-4
- Cleanup and update spec
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.0.7-3
- Rebuilt for GCC 5 C++11 ABI change