Issue
I am building an RPM package that includes some C++ API, and my package requires GCC version greater than 7.3.0 in the user environment in order for it to work properly.
So, is there a way to automatically check the version of GCC in the user's environment when the user performs an 'rpm -i' installation, and report an error directly at installation time if it doesn't meet the requirements?
Solution
Put in the spec file:
Requires: gcc > 7.3.0
See https://rpm-software-management.github.io/rpm/manual/dependencies.html
But I doubt that you really want to require gcc, because that is only needed when building packages and not in runtime.
For additional information see:
- https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/
- https://docs.fedoraproject.org/en-US/packaging-guidelines/#_dependency_types
Answered By - msuchy Answer Checked By - Terry (WPSolving Volunteer)