File browser-cookie3.spec of Package python3-browser-cookie3

#
# spec file for package browser-cookie3
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           python-browser-cookie3
Version:        0.20.1
Release:        0
Summary:        Loads cookies from your browser into a cookiejar object so can download with urllib and other libraries the same content you see in the web browser.
License:        LGPL-3.0-or-later
URL:            https://github.com/borisbabic/browser_cookie3
Source0:        browser_cookie3-%{version}.tar.gz


# Build requirements
BuildRequires:  python-rpm-macros
BuildRequires:  fdupes
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module build}

# Runtime requirements
Requires:       %{python_module lz4}
Requires:       %{python_module pycryptodomex}

# Conditional deps (OBS handles markers internally, setuptools too)
%if 0%{?sle_version} < 150000
Requires:       %{python_module dbus-python}
%endif

Requires:       %{python_module jeepney}
Requires(post): update-alternatives
Requires(postun): update-alternatives

BuildArch:      noarch
%python_subpackages

%description
browser_cookie3 loads cookies from your browser into a Python cookiejar
object so that you can use urllib or other HTTP clients with the same
authentication/session as your browser. Supports Chrome, Firefox, Brave,
Edge, Chromium, and more.

%prep
%autosetup -n browser_cookie3-%{version}

%build
%pyproject_wheel
# python3 -m build --wheel --no-isolation
# %pyproject_build

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/browser-cookie
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%post
%python_install_alternative browser-cookie

%postun
%python_uninstall_alternative browser-cookie

%check
# No upstream tests shipped


%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/browser-cookie
%{python_sitelib}/browser_cookie3
%{python_sitelib}/browser_cookie3-%{version}.dist-info

%changelog
* Thu Nov 15 2025 devloop <nicolas.surribas@gmail.com>
  - Initial package

openSUSE Build Service is sponsored by