urlscan/urlscan.spec

90 lines
2.9 KiB
RPMSpec
Raw Normal View History

#
# spec file for package urlscan
#
# Copyright (c) 2023 SUSE LLC
#
# 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/
#
%define python_flavor python3
Name: urlscan
Version: 1.0.0
Release: 0
Summary: An other URL extractor/viewer
License: GPL-2.0-or-later
Group: Productivity/Networking/Web/Browsers
URL: https://github.com/firecat53/urlscan
Source0: https://github.com/firecat53/urlscan/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: muttrc
BuildRequires: %{python_module base}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module hatch_vcs}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: sed
Recommends: %{name}-doc = %{version}
Requires: %{python_module base}
Requires: %{python_module urwid >= 1.2.1}
BuildArch: noarch
%global myname %name
%python_subpackages
%description
The urlscan utility displays URLs found in an email message with
the respective context. Selecting an URL uses the Python webbrowser
module to determine which browser to open. It also supports
quoted-printable and base64 encoding.
%prep
%setup -q
install -m 0644 %{SOURCE1} muttrc
%build
SETUPTOOLS_SCM_PRETEND_VERSION="%{version}"
export SETUPTOOLS_SCM_PRETEND_VERSION
%pyproject_wheel
%install
%pyproject_install
%python_expand mkdir -p %{buildroot}%{_defaultdocdir}/%{$python_prefix}-%{myname}
if test -e %{buildroot}%{_datadir}/doc/%{myname}*
then
rm -f %{buildroot}%{_datadir}/doc/%{myname}*/LICENSE
fi
rm -rf %{buildroot}%{_datadir}/doc/%{name}*
%python_clone -a %{buildroot}%{_bindir}/%{myname}
%python_clone -a %{buildroot}%{_mandir}/man1/%{myname}.1
%python_expand chmod 755 %{buildroot}%{$python_sitelib}/%{myname}/__main__*
%python_expand sed -ri '1 { s@(/usr/bin/)env *@\1@ }' %{buildroot}%{$python_sitelib}/%{myname}/__main__*
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative %{myname}
%postun
%python_uninstall_alternative %{myname}
%files %{python_files}
%python_alternative %{_bindir}/%{myname}
%python_alternative %{_mandir}/man1/%{myname}.1%{?ext_man}
%{python_sitelib}/%{myname}
%{python_sitelib}/%{myname}-%{version}*-info
%license LICENSE
%doc README.md muttrc
%changelog