make python2 subpackage optional

f38
Zdenek Dohnal 7 years ago
parent 86b1c7a22d
commit 702bb367ac

@ -6,7 +6,7 @@
Summary: Python bindings for libsmbclient API from Samba Summary: Python bindings for libsmbclient API from Samba
Name: python-smbc Name: python-smbc
Version: 1.0.15.4 Version: 1.0.15.4
Release: 14%{?dist} Release: 15%{?dist}
URL: https://github.com/hamano/pysmbc URL: https://github.com/hamano/pysmbc
Source: http://pypi.python.org/packages/source/p/pysmbc/pysmbc-%{version}.tar.bz2 Source: http://pypi.python.org/packages/source/p/pysmbc/pysmbc-%{version}.tar.bz2
License: GPLv2+ License: GPLv2+
@ -14,16 +14,18 @@ License: GPLv2+
# gcc is no longer in buildroot by default # gcc is no longer in buildroot by default
BuildRequires: gcc BuildRequires: gcc
%if 0%{?rhel} <= 7
BuildRequires: python2-devel BuildRequires: python2-devel
%endif
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: libsmbclient-devel >= 3.2 BuildRequires: libsmbclient-devel >= 3.2
BuildRequires: epydoc
%description %description
This package provides Python bindings for the libsmbclient API This package provides Python bindings for the libsmbclient API
from Samba, known as pysmbc. It was written for use with from Samba, known as pysmbc. It was written for use with
system-config-printer, but can be put to other uses as well. system-config-printer, but can be put to other uses as well.
%if 0%{?rhel} <= 7
%package -n python2-smbc %package -n python2-smbc
Summary: Python2 bindings for libsmbclient API from Samba Summary: Python2 bindings for libsmbclient API from Samba
# defined in /usr/lib/rpm/macros.d/macros.python # defined in /usr/lib/rpm/macros.d/macros.python
@ -35,6 +37,7 @@ Summary: Python2 bindings for libsmbclient API from Samba
This package provides Python 2 bindings for the libsmbclient API This package provides Python 2 bindings for the libsmbclient API
from Samba, known as pysmbc. It was written for use with from Samba, known as pysmbc. It was written for use with
system-config-printer, but can be put to other uses as well. system-config-printer, but can be put to other uses as well.
%endif
%package -n python3-smbc %package -n python3-smbc
Summary: Python3 bindings for libsmbclient API from Samba Summary: Python3 bindings for libsmbclient API from Samba
@ -55,19 +58,27 @@ Documentation for python-smbc.
%setup -n pysmbc-%{version} %setup -n pysmbc-%{version}
%build %build
%if 0%{?rhel} <= 7
%py2_build %py2_build
%endif
%py3_build %py3_build
rm -rf html export PYTHONPATH=build/lib.linux-x86_64-3.6
epydoc -o html --html build/lib*/_smbc.so %{_bindir}/pydoc3 -w smbc
%{_bindir}/mkdir html
%{_bindir}/mv smbc.html html
%install %install
%if 0%{?rhel} <= 7
%py2_install %py2_install
%endif
%py3_install %py3_install
%if 0%{?rhel} <= 7
%files -n python2-smbc %files -n python2-smbc
%doc README NEWS %doc README NEWS
%license COPYING %license COPYING
%{python2_sitearch}/* %{python2_sitearch}/*
%endif
%files -n python3-smbc %files -n python3-smbc
%doc README NEWS %doc README NEWS
@ -79,6 +90,9 @@ epydoc -o html --html build/lib*/_smbc.so
%changelog %changelog
* Thu Apr 19 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.0.15.4-15
- make python2 subpackage optional
* Mon Feb 19 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.0.15.4-14 * Mon Feb 19 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.0.15.4-14
- gcc is no longer in buildroot by default - gcc is no longer in buildroot by default

Loading…
Cancel
Save