Skip to content
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

Introduce a switch to select yum or dnf to be used for yum-based distros #6

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

ThatStasGuy
Copy link
Contributor

Currently, smart-restart is only available for al2023 which uses dnf. This version adds a switch to use yum as well so we can ship smart-restart for al2 in a future release.

The makefile already can handle both, dnf and yum. This change adds a proper switch to the smart-restart.spec file so either the spec file automatically decides on the OS based on the amzn2 macro, or can be overwritten using --without yum. Using this switch only changes the package manager, not the distro. The distro can still be overwritten using -D "dist .amzn2023" or -D "dist .amzn2".

Example usage:

rpmbuild -bb --target noarch -D "dist .amzn2023" --with yum --nodeps smart-restart.spec

This will generate an RPM for the al2023 distro using yum (This will NOT WORK. No yum on al2023).

ThatStasGuy and others added 4 commits November 18, 2024 13:58
so the build system can actually build RPMs
Removing the %{dist} dependency from the spec file and adding
a proper package manager switch now allows to use the rpmbuild
internal functionality `--with` and `--without` to switch
the package manager used.

The usage is:

rpmbuild -bb --with yum smart-restart.spec

to build for YUM based distros

or:

rpmbuild -vv -bb --without yum smart-restart.spec

for DNF based.

Since I am reworking the pkg manger switches anyways, I also
slightly modified the resulting tarball creation. The
`make sources` output now doesn't contain the release anymore.
@ThatStasGuy ThatStasGuy marked this pull request as ready for review November 18, 2024 14:28
Copy link
Collaborator

@bjoernd bjoernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bjoernd bjoernd merged commit e8f6a0c into main Nov 19, 2024
3 checks passed
@bjoernd bjoernd deleted the dev branch November 19, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants