0

The subpackage "yum-plugin-post-transaction-action" from yum-utils appeared with RHEL6.

Now I have an heterogeneous infrastructure, and I needed this yum plugin for RHEL/Centos 5. So I made a spec file, built the RPM, tested it, it works. But I want to make sure no one builds it for RHEL6 or 7 on the packaging machine by mistake one day, and overriding the vendor-provided one.

I have first thought to look for RPM specific tags like excludeOS but they're too wide. We are using mock, but I didn't find a way to configure it for this purpose.

All I did for now is to make the built RPM depend on centos-release-5 which seems very dirty and doesn't prevent build, only install...

  • You'll want to look at a Build-Requires entry. That's the only way I can think of to get where you want to go. – John Dec 4 '15 at 15:37
  • That might be a problem since I'm building everything using mock from a CentOS 7 system, but that may be the only solution =/ – mveroone Dec 4 '15 at 15:40
1
%build
%if 0%{rhel} > 5
  echo "This package should be build only for RHEL5"
  exit 1
%endif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.