Blob Blame History Raw
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2:        %global __python2 /usr/bin/python2}
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

%if 0%{?fedora}
%global with_python3 1
%endif

%global modname txws
%global capname txWS

Name:             python-txws
Version:          0.9.1
Release:          8%{?dist}
Summary:          Twisted WebSockets wrapper

Group:            Development/Languages
License:          MIT
URL:              http://pypi.python.org/pypi/%{capname}
Source0:          http://pypi.python.org/packages/source/t/%{capname}/%{capname}-%{version}.tar.gz
Patch0:           python-txws-drop-vcversioner.patch

BuildArch:        noarch

BuildRequires:    python-devel
BuildRequires:    python-setuptools
BuildRequires:    python-twisted-core
BuildRequires:    python-twisted-web
BuildRequires:    python-six

%if 0%{?with_python3}
BuildRequires:    python3-devel
BuildRequires:    python3-setuptools
BuildRequires:    python3-twisted
BuildRequires:    python3-six
%endif

Requires:         python-twisted-core
Requires:         python-twisted-web
Requires:         python-six

%description
txWS (pronounced "Twisted WebSockets") is a small, short, simple library
for adding WebSockets server support to your favorite Twisted applications.

%if 0%{?with_python3}
%package -n python3-txws
Summary:          Twisted WebSockets wrapper
Group:            Development/Languages

Requires:         python3-twisted
Requires:         python3-six

%description -n python3-txws
txWS (pronounced "Twisted WebSockets") is a small, short, simple library
for adding WebSockets server support to your favorite Twisted applications.
%endif


%prep
%setup -q -n %{capname}-%{version}
%patch0 -p1

rm -rf *.egg*

%if 0%{?rhel}
%{__sed} -i -e 's/"Twisted",//' setup.py
%endif

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif


%build
%py2_build

%if 0%{?with_python3}
%py3_build
%endif

%install
%py2_install

%if 0%{?with_python3}
%py3_install
%endif


# We could run the tests when building, but txWS doesn't ship the tests.py with
# the distribution.  Leaving it commented out as a possibility for later.
#%check
#PYTHONPATH=$(pwd) trial tests.py
# XXX - also, python3 tests?

%files
%doc README.rst
%{python2_sitelib}/%{modname}.py*
%{python2_sitelib}/%{capname}-%{version}-*.egg-info

%if 0%{?with_python3}
%files -n python3-txws
%doc README.rst
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{modname}.py*
%{python3_sitelib}/%{capname}-%{version}-*.egg-info
%endif


%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.9.1-6
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Tue Jul 12 2016 Lumir Balhar <lbalhar@redhat.com> - 0.9.1-4
- Enabled Py3 support

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Aug 20 2014 Ralph Bean <rbean@redhat.com> - 0.9.1-1
- Latest upstream.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu May 08 2014 Ralph Bean <rbean@redhat.com> - 0.9-1
- Protocol fixes to help support users on chrome.
- Added a disabled python3 subpackage for the future.
- Modernized python2 macros.

* Tue Jan 28 2014 Ralph Bean <rbean@redhat.com> - 0.8-2
- Patch to drop vcversioner for building in koji.

* Tue Jan 28 2014 Ralph Bean <rbean@redhat.com> - 0.8-1
- Latest upstream.

* Tue Jan 14 2014 Ralph Bean <rbean@redhat.com> - 0.7.1-4
- Update deps to use more specific twisted subpackages.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Jul 27 2012 Ralph Bean <rbean@redhat.com> 0.7.1-1
- Upstream release.
- Use %%{capname} macro.

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue May 29 2012 Ralph Bean <rbean@redhat.com> 0.7-5
- Resolve merge conflict between rawhide and el6.

* Mon May 21 2012 Luke Macken <lmacken@redhat.com> 0.7-4
- Remove the Twisted dependency from the setup.py, since the RHEL package does
  not contain the necessary egg-info metadata.

* Mon Apr 09 2012 Ralph Bean <rbean@redhat.com> 0.7-3
- Removed defattr in %files section.

* Mon Apr 09 2012 Ralph Bean <rbean@redhat.com> 0.7-2
- Fixed spelling error in the specfile description.

* Thu Apr 05 2012 Ralph Bean <rbean@redhat.com>  0.7-1
- initial package for Fedora