-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFE] Add option to exclude subpackages from building #2555
Comments
During almost +20 years of using rpm I've never had such needs. 👎 |
But I don't really want to rely on this bug in %exclude - see #994 which is acknowledged as a bug (but appearently hard to fix because of Fedora relying on this). |
This sounds like a problem of package distribution, not package building. As I understand it, your actual goal here is to avoid shipping a subpackage in the repositories. The current "workaround" as you described it therefore is the proper solution to this. The contents of the buildroot is supposed to reflect what's being packaged one way or another. What follows from that is, any SPEC construct that would allow for excluding an already installed file would make no sense. The existence of the If you wish to avoid packaging certain files, then don't install them in the first place. Similarly, if you wish to avoid shipping a built package, then don't ship it. Theoretically, if RPM supported this, treating an empty filelist as "don't build this subpackage" would be better as one could then reuse the existing |
After discussing this with the team, we agreed that the idea behind this (to exclude certain (sub)packages from the build) is actually quite reasonable. It's just that the proposed way of abusing I've moved this to our backlog so that somebody can actually pick this up later and have a closer look at how it could be implemented. |
Please add a way to mark a %files list as listing files to be ignored, aka not complained about not belonging to any package.
This should be a convenient way to exclude sub-packages from packaging without the need to explicitly rm the not packaged
files. Example
%if ...
%define without_foo -i
%endif
%package foo
...
%files foo %{?without_foo}
%dir /baz
/baz/bar
Implementation-wise the easiest thing is to treat -i as overriding the sub-package name the %files list belongs to,
assigning a special (empty?) name and later make sure to not emit the "empty" package. Otherwise full processing
of the files should happen, so they are all expected to exist.
The actual use case is packaging of the GNU GCC compiler in openSUSE where shared library sub-packages are
provided from the newest compiler version but multiple actual compilers are co-installable. For technical reasons
having multiple source packages building same named sub-packages such as libstdc++6 isn't possible. The current
workaround suffixes those so we have libstdc++6-gccN in addition to the main libstdc++6 package, but those suffixed
packages have to be manually "removed" (or hidden) through special casing.
Explicitely rm-ing the files in those packages and not packaging the sub-packages would be an option but would
also make the spec file even more difficult to follow, so a less intrusive way to make rpmbuild not build a sub-package
is required.
The text was updated successfully, but these errors were encountered: