#3009 PR merged: More general RPM build

Labels: enhancement, fixed / solved / done

pcahyna opened issue at 2023-06-08 12:56:

Pull Request Details:
  • Type: Enhancement

  • Impact: Low

  • Reference to related issue (URL):

  • How was this pull request tested?
    'make srpm and 'make rpm' with the in-tree spec file and spec file from RHEL 7, RHEL 8 and RHEL 9 (after some adjustements: adding the rpmrelease definition and removing patches).

  • Brief description of the changes in this pull request:
    Make the RPM targets in Makefile work with a wider range of custom specs, the current RPM build works well with the spec in tree, but can fail if one uses a customized spec.

Changes:

  • Support additional sources in RPM spec (the additional sources will need to be placed in the same directory as the spec file - packaging/rpm).
  • Support %autosetup in rpm spec - some RPM specs use the new %autosetup macro instead of %setup. Support this when building the SRPM and RPM (in case we switch to %autosetup or one wants to use another spec file, e.g. from Fedora).
  • Respect the value of 'rpmrelease' whehn building the RPM manually from the generated SRPM. Not having the value in the spec file causes it to be lost when one builds the resulting SRPM manually, because rpmbuild is not invoked with the correct command line (unless one takes care to pass the same parameters to rpmbuild that "make rpm" would use). Having "make rpm" produce different RPMs (different NVR) than manually building the SRPM generated by "make srpm" is confusing, so restore the former behavior. This reverts commit f8c77f6831de09802038f60acd2ba2a0ba6fb864.
  • Allow Source0 instead of Source in spec

pcahyna commented at 2023-06-09 08:29:

CentOS 6 Docker build now fails with

RPM build errors:
error: Bad owner/group: /var/tmp/build-rear-2.7/rear.spec
    Bad owner/group: /var/tmp/build-rear-2.7/rear.spec
make: *** [srpm] Error 1

pcahyna commented at 2023-06-09 12:14:

tar preserves ownership even without -p and rpmbuild in CentOS 6 does not like it. It will be necessary to copy the files around to reset ownership. I will finish it shortly.

pcahyna commented at 2023-06-09 13:38:

should be fixed now.

pcahyna commented at 2023-06-12 14:09:

@schlomo can you please check if this does not break your use cases? I looked at the GH action results, the build seems OK.

The opensuse-leap-15.3 build failure is unrelated and a result of upgrade of COPR builders to Fedora 38 ( https://github.com/rpm-software-management/mock/issues/1062 )

pcahyna commented at 2023-06-13 09:42:

The opensuse-leap-15.3 build failure is unrelated and a result of upgrade of COPR builders to Fedora 38 ( rpm-software-management/mock#1062 )

A workaround is now in place, see the linked issue, so the opensuse-leap-15.3 Packit build is succeeding again.


[Export of Github issue for rear/rear.]