14
0

Accepting request 1142741 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1142741
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-onionshare?expand=0&rev=17
This commit is contained in:
2024-01-30 17:26:37 +00:00
committed by Git OBS Bridge
3 changed files with 108 additions and 70 deletions

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Jan 28 17:35:56 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Use (single flavor) python_subpackages for correct package prefix
- Obsolete incorrectly named packages, convince rpmlint that it is
fine
-------------------------------------------------------------------
Thu Nov 23 14:22:20 UTC 2023 - Ben Greiner <code@bnavigator.de>
@@ -149,7 +156,7 @@ Sun May 16 09:28:39 UTC 2021 - Axel Braun <axel.braun@gmx.de>
* Bugfix: Fix chat mode
* Bugfix: Fix persistent in onionshare-cli
* Bugfix: Fix checking for updates in Windows and macOS
* Major new feature: Multiple tabs, including better support for persistent services, faster Tor connections
* Major new feature: Multiple tabs, including better support for persistent services, faster Tor connections
* New feature: Chat anonymously mode
* New feature: All new design
* New feature: Ability to display QR codes of OnionShare addresses

View File

@@ -0,0 +1,8 @@
# it's packaged inline
addFilter("python-missing-require onionshare_cli")
# using cepa instead
addFilter("python-missing-require stem")
# the rpmplint python requirement checker is confused about two packages in one
addFilter("python-leftover-require python3[0-9]*-.*")
# obsoleting but not replacing old multiflavor packages
addFilter("obsolete-not-provided python3?[0-9]*-onionshare")

View File

@@ -1,8 +1,8 @@
#
# spec file
# spec file for package python-onionshare
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2018-2022 Dr. Axel Braun
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2018-2024 Dr. Axel Braun
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,25 @@
#
%define modname onionshare
Name: python-%{modname}
# Always only build one flavor
%if 0%{?suse_version} >= 1550
%define pythons python3
%else
%{?sle15_python_module_pythons}
%endif
%global mypython %pythons
%global mysitelib %{expand:%%{%{mypython}_sitelib}}
%define plainpython python
Name: python-onionshare
Version: 2.6
Release: 0
Summary: Self-hosting Tor Onion Service based file sharing
License: GPL-3.0-or-later
Group: Productivity/Networking/File-Sharing
URL: https://github.com/onionshare/onionshare
Source0: https://github.com/onionshare/onionshare/archive/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz
Source0: https://github.com/onionshare/onionshare/archive/v%{version}.tar.gz#/onionshare-%{version}.tar.gz
Source99: python-onionshare.rpmlintrc
# PATCH-FIX-OPENSUSE skip test_large_download in gui tests
Patch0: 0001-adjust_tests.diff
# PATCH-FIX-UPSTREAM fix-test-cli-web.patch -- https://github.com/onionshare/onionshare/issues/1534
@@ -36,69 +46,82 @@ Patch2: relax-async-mode.patch
Patch3: https://github.com/onionshare/onionshare/commit/a05d7af729585bdaa4f71437167339ac67bf3327.patch#/onionshare-poetry-core.patch
# PATCH-FIX-UPSTREAM onionshare-pr1677-fix-werkzeug3.patch gh#onionshare/onionshare#1677
Patch4: onionshare-pr1677-fix-werkzeug3.patch
BuildRequires: %{mypython}-devel
BuildRequires: %{mypython}-pip
BuildRequires: %{mypython}-setuptools
BuildRequires: %{mypython}-wheel
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: python-rpm-macros
BuildRequires: python3-pip
BuildRequires: python3-poetry-core
BuildRequires: %{mypython}-poetry-core
BuildRequires: update-desktop-files
# SECTION test
BuildRequires: python3-pytest
BuildRequires: python3-pytest-qt
BuildRequires: python3-pytest-xvfb
BuildRequires: %{mypython}-pytest
BuildRequires: %{mypython}-pytest-qt
BuildRequires: %{mypython}-pytest-xvfb
# /SECTION
# SECTION runtime test
BuildRequires: python3-Flask >= 2.3.2
BuildRequires: python3-Flask-Compress >= 1.13
BuildRequires: python3-Flask-SocketIO >= 5.3.1
BuildRequires: python3-PyNaCl
BuildRequires: python3-PySocks
BuildRequires: python3-Unidecode
BuildRequires: python3-Werkzeug >= 2.3.4
BuildRequires: python3-click
BuildRequires: python3-colorama
BuildRequires: python3-eventlet
BuildRequires: python3-gevent-websocket
BuildRequires: python3-psutil
BuildRequires: python3-pyside2 >= 5.15.2.1
BuildRequires: python3-python-gnupg
BuildRequires: python3-qrcode
BuildRequires: python3-requests
BuildRequires: python3-setuptools
BuildRequires: python3-stem >= 1.8.1
BuildRequires: python3-urllib3
BuildRequires: python3-waitress >= 2.1.2
BuildRequires: %{mypython}-Flask >= 2.3.2
BuildRequires: %{mypython}-Flask-Compress >= 1.13
BuildRequires: %{mypython}-Flask-SocketIO >= 5.3.1
BuildRequires: %{mypython}-PyNaCl
BuildRequires: %{mypython}-PySocks
BuildRequires: %{mypython}-Unidecode
BuildRequires: %{mypython}-Werkzeug >= 2.3.4
BuildRequires: %{mypython}-cepa
BuildRequires: %{mypython}-click
BuildRequires: %{mypython}-colorama
BuildRequires: %{mypython}-eventlet
BuildRequires: %{mypython}-gevent-websocket
BuildRequires: %{mypython}-psutil
BuildRequires: %{mypython}-pyside2 >= 5.15.2.1
BuildRequires: %{mypython}-python-gnupg
BuildRequires: %{mypython}-qrcode
BuildRequires: %{mypython}-requests
BuildRequires: %{mypython}-urllib3
BuildRequires: %{mypython}-waitress >= 2.1.2
BuildRequires: tor
# /SECTION
Requires: python3-Flask >= 2.3.2
Requires: python3-Flask-Compress >= 1.13
Requires: python3-Flask-SocketIO >= 5.3.1
Requires: python3-PyNaCl
Requires: python3-PySocks
Requires: python3-Unidecode
Requires: python3-Werkzeug >= 2.3.4
Requires: python3-click
Requires: python3-colorama
Requires: python3-eventlet
Requires: python3-gevent-websocket
Requires: python3-psutil
Requires: python3-pyside2 >= 5.15.2.1
Requires: python3-python-gnupg
Requires: python3-qrcode
Requires: python3-requests
Requires: python3-setuptools
Requires: python3-stem >= 1.8.1
Requires: python3-urllib3
Requires: python3-waitress >= 2.1.2
Requires: python-Flask >= 2.3.2
Requires: python-Flask-Compress >= 1.13
Requires: python-Flask-SocketIO >= 5.3.1
Requires: python-PyNaCl
Requires: python-PySocks
Requires: python-Unidecode
Requires: python-Werkzeug >= 2.3.4
Requires: python-cepa >= 1.8.1
Requires: python-click
Requires: python-colorama
Requires: python-eventlet
Requires: python-gevent-websocket
Requires: python-psutil
Requires: python-pyside2 >= 5.15.2.1
Requires: python-python-gnupg
Requires: python-qrcode
Requires: python-requests
Requires: python-setuptools
Requires: python-urllib3
Requires: python-waitress >= 2.1.2
Requires: tor
Provides: python3-onionshare = %{version}-%{release}
Provides: python3-onionshare_cli = %{version}-%{release}
Obsoletes: python-onionshare-data < 2.3.1
Provides: python-onionshare = %{version}-%{release}
Provides: python-onionshare_cli = %{version}-%{release}
# Obsolete old multiflavor packages
Obsoletes: %{plainpython}-onionshare-data < 2.3.1
Obsoletes: python310-onionshare < 2.3.1
Obsoletes: python36-onionshare < 2.3.1
Obsoletes: python38-onionshare < 2.3.1
Obsoletes: python39-onionshare < 2.3.1
%if %{suse_version} >= 1500
# incorrect package name was used until 2024-01-24
Obsoletes: %{plainpython}-onionshare <= 2.6
%endif
%if 0%{?sle_version} >= 150600 && "%pythons" != "python3"
# obsolete python 3.6 package
Obsoletes: python3-onionshare <= 2.6
%endif
BuildArch: noarch
%python_subpackages
%description
OnionShare lets the user share files securely and anonymously. It
@@ -110,21 +133,21 @@ program is run on. The receiving user just needs to open the URL in
Tor Browser to download the file.
%prep
%autosetup -p1 -n %{modname}-%{version}
%autosetup -p1 -n onionshare-%{version}
%build
pushd cli
%python3_pyproject_wheel
%pyproject_wheel
popd
pushd desktop
%python3_pyproject_wheel
%pyproject_wheel
%install
pushd cli
%python3_pyproject_install
%pyproject_install
popd
pushd desktop
%python3_pyproject_install
%pyproject_install
install -Dm 0644 org.onionshare.OnionShare.appdata.xml \
%{buildroot}%{_datadir}/metainfo/org.onionshare.OnionShare.metainfo.xml
@@ -132,14 +155,14 @@ install -Dm 0644 org.onionshare.OnionShare.svg \
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/org.onionshare.OnionShare.svg
%suse_update_desktop_file -i org.onionshare.OnionShare
%fdupes %{buildroot}%{python3_sitelib}
%fdupes %{buildroot}%{mysitelib}
%check
export PYTHONPATH=%{buildroot}%{python3_sitelib}
export PYTHONPATH=%{buildroot}%{mysitelib}
# we don't trust the update-alternatives priority: pytest could point to the wrong python3 flavor.
# (https://github.com/openSUSE/python-rpm-macros/issues/109)
mkdir testbin
ln -s %{_bindir}/pytest-%{python3_bin_suffix} testbin/pytest
ln -s %{_bindir}/pytest-%{%{mypython}_bin_suffix} testbin/pytest
export PATH=$PWD/testbin:$PATH
pushd cli
@@ -153,17 +176,17 @@ popd
# ./tests/run.sh
# popd
%files
%{_bindir}/%{modname}
%{_bindir}/%{modname}-cli
%files %python_files
%{_bindir}/onionshare
%{_bindir}/onionshare-cli
%license LICENSE
%doc README.md
%{_datadir}/applications/org.onionshare.OnionShare.desktop
%{_datadir}/metainfo/org.onionshare.OnionShare.metainfo.xml
%{_datadir}/icons/hicolor/scalable/apps/org.onionshare.OnionShare.svg
%{python3_sitelib}/onionshare
%{python3_sitelib}/onionshare-%{version}*-info
%{python3_sitelib}/onionshare_cli
%{python3_sitelib}/onionshare_cli-%{version}*-info
%{mysitelib}/onionshare
%{mysitelib}/onionshare-%{version}*-info
%{mysitelib}/onionshare_cli
%{mysitelib}/onionshare_cli-%{version}*-info
%changelog