From 9017b2f957c7c577293c9685cfa89e4dd161a7f0 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Tue, 31 Oct 2023 09:31:18 +0100 Subject: [PATCH 1/3] RPM spec: Update to 0.4.0 --- leo-cli.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/leo-cli.spec b/leo-cli.spec index 4f998d7..911d7e9 100644 --- a/leo-cli.spec +++ b/leo-cli.spec @@ -1,7 +1,7 @@ %define name leo-cli -%define version 0.3.4 -%define unmangled_version 0.3.4 -%define release 2 +%define version 0.4.0 +%define unmangled_version %{version} +%define release 1%{?dist} Summary: leo.org command line tool Name: %{name} From 5fc5ad777903aeb1130ebb4479c82240bebc6fa9 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Tue, 31 Oct 2023 09:34:27 +0100 Subject: [PATCH 2/3] RPM spec: Use macros (Fedora guidelines) and add patches to fix build Use macros as intended by Fedora packaging guidelines and add two upstream patches (from git) to fix the build for 0.4.0. The patches can be removed when a new version is released. --- leo-cli.spec | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/leo-cli.spec b/leo-cli.spec index 911d7e9..44c9a26 100644 --- a/leo-cli.spec +++ b/leo-cli.spec @@ -16,7 +16,21 @@ BuildArch: noarch Vendor: Johannes Degn Url: https://github.com/JoiDegn/leo-cli -BuildRequires: python3 +# Fix beautifulsoup4 dependency #29 +# https://github.com/joidegn/leo-cli/pull/29 +Patch0: leo-cli-git-fix-beautifulsoup4-dependency.patch +# Remove entrypoint main + egg_info from setup.cfg +# https://github.com/joidegn/leo-cli/issues/30 +Patch1: leo-cli-remove-main+egg_info.patch + + +BuildRequires: pyproject-rpm-macros + +%py_provides python3-leo-cli + +%generate_buildrequires +%pyproject_buildrequires -r + %description leo-cli is a command line tool which can be used to translate words or phrases @@ -25,17 +39,25 @@ wrote this because visiting their website, choosing the language, typing the word and clicking the submit button required several too many steps. I am a lazy person. + %prep %setup -n %{name}-%{unmangled_version} +%patch -P0 -p1 +%patch -P1 %build -python3 setup.py build +%pyproject_wheel %install -python3 setup.py install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES +%pyproject_install %clean rm -rf $RPM_BUILD_ROOT -%files -f INSTALLED_FILES + +%files %defattr(-,root,root) +%{_bindir}/leo +%{python3_sitelib}/leo_cli-%{unmangled_version}.dist-info/ +%doc README.md +%license LICENSE.txt From 58f763f94d4fbe543def539696f4fb56b12b575b Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Tue, 31 Oct 2023 09:38:05 +0100 Subject: [PATCH 3/3] RPM spec: Add a changelog --- leo-cli.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/leo-cli.spec b/leo-cli.spec index 44c9a26..4ec9cba 100644 --- a/leo-cli.spec +++ b/leo-cli.spec @@ -61,3 +61,11 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/leo_cli-%{unmangled_version}.dist-info/ %doc README.md %license LICENSE.txt + + +%changelog +* Tue Oct 31 2023 Mike Gerber - 0.4.0-1%{?dist} +- Update to 0.4.0 +- Fix beautifulsoup4 dependency +- Remove "main" entrypoint + egg_info via patch +- Use Python RPM macros for dependencies etc.