add with_python3 conditionals

f38
David Malcolm 13 years ago
parent 825d4f0dd5
commit 7c7dba386f

@ -1,3 +1,7 @@
%if 0%{?fedora} > 12
%global with_python3 1
%endif
%{?filter_setup:
%filter_provides_in %{python_sitearch}/.*\.so$
%filter_setup
@ -6,13 +10,15 @@
Summary: Python bindings for libsmbclient API from Samba
Name: python-smbc
Version: 1.0.13
Release: 3%{?dist}
Release: 4%{?dist}
URL: http://cyberelk.net/tim/software/pysmbc/
Source: http://pypi.python.org/packages/source/p/pysmbc/pysmbc-%{version}.tar.bz2
License: GPLv2+
Group: Development/Languages
BuildRequires: python2-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
BuildRequires: libsmbclient-devel >= 3.2
BuildRequires: epydoc
@ -21,6 +27,7 @@ This package provides Python bindings for the libsmbclient API
from Samba, known as pysmbc. It was written for use with
system-config-printer, but can be put to other uses as well.
%if 0%{?with_python3}
%package -n python3-smbc
Summary: Python3 bindings for libsmbclient API from Samba
Group: Development/Languages
@ -30,7 +37,8 @@ This package provides Python bindings for the libsmbclient API
from Samba, known as pysmbc. It was written for use with
system-config-printer, but can be put to other uses as well.
This is a ported release for python 3.1
This is a ported release for python 3
%endif
%package doc
Summary: Documentation for python-smbc
@ -42,8 +50,10 @@ Documentation for python-smbc.
%prep
%setup -q -n pysmbc-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
@ -51,16 +61,20 @@ CFLAGS="%{optflags}" %{__python} setup.py build
rm -rf html
epydoc -o html --html build/lib*/smbc.so
%if 0%{?with_python3}
pushd %{py3dir}
CFLAGS="%{optflags}" %{__python3} setup.py build
popd
%endif
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
chmod 755 %{buildroot}%{python3_sitearch}/smbc*.so
popd
%endif
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
chmod 755 %{buildroot}%{python_sitearch}/smbc.so
@ -76,14 +90,19 @@ chmod 755 %{buildroot}%{python_sitearch}/smbc.so
%defattr(-,root,root,-)
%doc html
%if 0%{?with_python3}
%files -n python3-smbc
%defattr(-,root,root,-)
%doc COPYING README NEWS
%{python3_sitearch}/smbc.cpython-3*.so
%{python3_sitearch}/pysmbc*.egg-info
%endif
%changelog
* Fri Aug 3 2012 David Malcolm <dmalcolm@redhat.com> - 1.0.13-4
- add with_python3 conditionals
* Thu Jul 26 2012 David Malcolm <dmalcolm@redhat.com> - 1.0.13-3
- generalize file globbing to ease transition to Python 3.3

Loading…
Cancel
Save