From d598d4041489bde7a32d420fcb44b6d2f05bd176807fece591bdc4f54ad68dd8 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Fri, 25 Aug 2017 08:22:15 +0000 Subject: [PATCH] Accepting request 518667 from home:tbechtold:branches:devel:languages:python - convert to singlespec - split data files into -common package OBS-URL: https://build.opensuse.org/request/show/518667 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-websockify?expand=0&rev=23 --- python-websockify.changes | 6 +++++ python-websockify.spec | 49 ++++++++++++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/python-websockify.changes b/python-websockify.changes index 63d6a6a..3d40c79 100644 --- a/python-websockify.changes +++ b/python-websockify.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Aug 25 07:57:23 UTC 2017 - tbechtold@suse.com + +- convert to singlespec +- split data files into -common package + ------------------------------------------------------------------- Sat Jul 22 08:19:00 UTC 2017 - dmueller@suse.com diff --git a/python-websockify.spec b/python-websockify.spec index f31d5e4..5c6b1e6 100644 --- a/python-websockify.spec +++ b/python-websockify.spec @@ -16,6 +16,7 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-websockify Version: 0.8.0 Release: 0 @@ -23,17 +24,23 @@ Summary: Websockify License: LGPL-3.0 and MPL-2.0 and BSD-2-Clause and BSD-3-Clause Group: Development/Languages/Python Url: https://github.com/kanaka/websockify -Source: http://pypi.python.org/packages/source/w/websockify/websockify-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-setuptools +Source: http://files.pythonhosted.org/packages/source/w/websockify/websockify-%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: python-rpm-macros BuildRequires: unzip %if 0%{?suse_version} Recommends: python-numpy %endif Requires: python-setuptools +Requires: python-websockify-common = %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch +%python_subpackages + %description websockify was formerly named wsproxy and was part of the noVNC project. @@ -43,6 +50,22 @@ to normal socket traffic. Websockify accepts the WebSockets handshake, parses it, and then begins forwarding traffic between the client and the target in both directions. +%package -n python-websockify-common +Summary: Websockify +Group: Development/Languages/Python +Provides: %{python_module websockify-common = %{version}} + +%description -n python-websockify-common +websockify was formerly named wsproxy and was part of the +noVNC project. + +At the most basic level, websockify just translates WebSockets traffic +to normal socket traffic. Websockify accepts the WebSockets handshake, +parses it, and then begins forwarding traffic between the client and +the target in both directions. + +This package contains common files. + %prep %setup -q -n websockify-%{version} # remove unwanted shebang @@ -51,16 +74,26 @@ sed -i '1 { /^#!/ d }' websockify/websocket*.py chmod -x include/web-socket-js/web_socket.js %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_clone -a %{buildroot}%{_bindir}/websockify -%files +%post +%python_install_alternative websockify + +%postun +%python_uninstall_alternative websockify + +%files %{python_files} %defattr(-,root,root,-) %doc CHANGES.txt LICENSE.txt README.md -%{_bindir}/websockify -%{_datadir}/websockify +%python_alternative %{_bindir}/websockify %{python_sitelib}/* +%files -n python-websockify-common +%doc LICENSE.txt +%{_datadir}/websockify + %changelog