2

The developer provided the source with the spec file. Is it possible to build a RPM that works across all CentOS 7.x builds and is that a good idea?

4

From a package developer's perspective CentOS == Red Hat Enterprise Linux (without licensed / copyrighted Red Hat content & logo's and without the enterprise support tiers)

So you can use the extensive Red Hat documentation (a nice overview here)

Compatibility Within A Major Release
One of the core goals of the Red Hat Enterprise Linux family of products is to provide a stable, consistent runtime environment for thirdparty applications. To support this goal, Red Hat seeks to preserve application binary compatibility, configuration file compatibility, and data file compatibility for all package updates issued within a major release. For example, a package update from Red Hat Enterprise Linux 6.1 to Red Hat Enterprise Linux 6.2, or a package update that fixes an identified security vulnerability, should not break the functionality of deployed applications as long as they adhere to standard Application Binary Interfaces (ABIs).
source

If the package developer followed the instructions in the Developer Guide and application compatibiliteit guide then it should be possible to build a single binary RPM package that works on all patch / minor release levels of a major CentOS / RHEL release.

And that is certainly a good idea.

2

Unless the package depends another library update or something that was introduced in a point release, a single build for all of CentOS 7 will suffice.

You can see examples of this in the updates repositories. Many packages will use a %dist tag that is el7, but you can also see some that are tagged el7_4.

See: http://vault.centos.org/7.4.1708/updates/x86_64/Packages/

You can use conditionals in your spec file to set certain dependencies based on the value of the %dist tag. This is generally done to handle dependency differences between major releases, but you could adapt it to point release.

%if "%{dist}" == "el7"
Require: package-versionA
%end
%if "%{dist}" == "el7_4"
Require: package-versionB
%end

Note: This is untested pseudo-code. You may need to make modifications, but it should be close.

You would then need to ensure your build environment provided the correct dist tag value to the build process. There's a number of ways this can be done and we would need to know more about your build environment.

  • I did the rpmbuild on a 7.6 host. When I install the rpm on a 7.3 host, it complains that it requires Requires: libsz.so.2()(64bit). If I do the rpmbuild on the 7.3 host that does not have libsz, then the rpm works on both 7.3 and 7.6. Any ideas? – lbanz Oct 15 at 16:41
  • Looking at the package that provides libsz, I think this has less to do with 7.3 vs. 7.6 and more to do with a missing library on one system. The configure script is probably disabling whatever optional component needs that library when it is not found. Since the application was built without libsz, the RPM does not require it. (RPM tries to populate your packages dependencies with auto-requires.) – Aaron Copley Oct 15 at 17:24
  • Also, the package is provided by the EPEL repository. Make sure you have that repository on the 7.3 system where it fails to install. – Aaron Copley Oct 15 at 17:28
  • Yeah I'm puzzled on what is providing libsz.so. I try running whatprovides but nothing come up. I'm wondering if it is part of the base install. For now, I'll build it on a 7.3 host. Thanks! – lbanz Oct 15 at 17:43
  • The package is libaec-devel from EPEL. If you don't have EPEL configured, you won't find it with whatprovides. Before you consider that a solution, you should ask the developers if it is a requirement. – Aaron Copley Oct 15 at 17:50
0

All Centos 7.x are juste minor upgrades, so I don't think you need to make the difference in your rpms. All centos packages are suffixed with el7, not with el7.6 or similar so I think you can do that safely (we are doing it for at least two years already).

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.