-
Hello. I've just located #1087 in https://fedoraproject.org/wiki/Changes/RPM-4.20 and I've read https://rpm-software-management.github.io/rpm/manual/buildsystem.html I am trying to understand how to use this, so let's dive in. Suppose I currently have this specfile simplified from https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_example_spec_file Name: python-pello
Version: 1.0.4
Release: 1%{?dist}
Summary: Example Python library
License: MIT-0
URL: https://github.com/fedora-python/Pello
Source: %{url}/archive/v%{version}/Pello-%{version}.tar.gz
BuildArch: noarch
%description
...
%package -n python3-pello
Summary: %{summary}
Recommends: python3-pello+color
%description -n python3-pello
...
%pyproject_extras_subpkg -n python3-pello color
%prep
%autosetup -p1 -n Pello-%{version}
%generate_buildrequires
%pyproject_buildrequires -t
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l pello
%check
%pyproject_check_import
%tox
%files -n python3-pello -f %{pyproject_files}
%doc README.md
%{_bindir}/pello_greeting
%changelog If I defined the following macros (in any macro file?): %buildsystem_pyproject_generate_buildrequires(rRxtNwe:C:) %pyproject_buildrequires %**
%buildsystem_pyproject_build(C:) %pyproject_wheel %**
%buildsystem_pyproject_install(l) %pyproject_install %["%**" == "" ? "" : "\
%pyproject_save_files %**"]
%buildsystem_pyproject_check(e:t) %pyproject_check_import %** The spec could be simplified as such: Name: python-pello
Version: 1.0.4
Release: 1%{?dist}
Summary: Example Python library
License: MIT-0
URL: https://github.com/fedora-python/Pello
Source: %{url}/archive/v%{version}/Pello-%{version}.tar.gz
BuildArch: noarch
BuildSystem: pyproject
BuildOption(prep): -n Pello-%{version}
BuildOption(generate_buildrequires): -t
BuildOption(install): -l pello
%description
...
%package -n python3-pello
Summary: %{summary}
Recommends: python3-pello+color
%description -n python3-pello
...
%pyproject_extras_subpkg -n python3-pello color
%check -a
%tox
%files -n python3-pello -f %{pyproject_files}
%doc README.md
%{_bindir}/pello_greeting
%changelog Is that assumption correct? (And as a side question, with #2859 we would not even need to set |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 9 replies
-
That's the essence of it, yes. There might be something else in the details I missed, but one thing that did catch my eye: As for #2859, the new -C flag is not automatically enabled anywhere just now, it probably should be in %buildsystem_default_prep() though, that's a good point. |
Beta Was this translation helpful? Give feedback.
-
FWIW, I revived my rpm-snapshot repository where you can get Fedora compatible builds from rpm so if folks want to try this out before the soon-to-be-released 4.20 alpha, there goes: git: https://copr.fedorainfracloud.org/coprs/pmatilai/rpm-snapshot/ |
Beta Was this translation helpful? Give feedback.
-
FWIW, turns out this stuff is pretty crippled in the alpha release due to these two issues: They don't prevent one from developing buildsystems but pretty much prevent using them in real-world packages where local tweaks are needed 😞 |
Beta Was this translation helpful? Give feedback.
-
If you are interested, here is my first draft implementation of this: https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/455 |
Beta Was this translation helpful? Give feedback.
-
I just stumbled over this as five package already use this new "BuildSystem: pyproject" approach but I can't find any official documentation. If this is already in use and accepted for Fedora packaging it should be mentioned in the packaging guidelines imho. (Maybe I just need to be more patient? 🤔 ) Edit: It is actually 12 packages, I just stumbled over those 5 which don't have an |
Beta Was this translation helpful? Give feedback.
-
This is of course several months late, missed originally due to vacation, but most certainly have been looking forward to real-world uses, lab testing only gets you so far. From a quick look, my takeaways are:
Anything else that's not so immediately obvious? |
Beta Was this translation helpful? Give feedback.
That's the essence of it, yes.
There might be something else in the details I missed, but one thing that did catch my eye:
the %buildsystem_foo_install() and such macros do not take options currently because they'd be shared across all buildsystems. So eg
%buildsystem_pyproject_check(e:t)
will not do what you intend, there's no way to pass options to the buildsystem macro itself. What you pass to BuildOption(): will get passed as an argument (ie after--
) to this macro, which you just pass along to the thing actually implementing it - such as%pyproject_*
here.As for #2859, the new -C flag is not automatically enabled anywhere just now, it probably should be in %buildsystem_default_prep(…