Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Stop including dist (e.g. el6) in the names of our intermediate srpms #194

Open
euanh opened this issue Apr 8, 2015 · 2 comments
Open

Comments

@euanh
Copy link
Contributor

euanh commented Apr 8, 2015

Planex generates SRPMs, which it then feeds into mock. The SRPMs are intermediate files, built using rpmbuild on the host system; the final binaries are built in mock chroots. The mock build also builds new SRPMs.

If %{dist} is included in the package name - it is typically in the release - then the intermediate SRPM's name will not match the name of the binary RPM if the host system is not the same as the mock chroot. For instance, building foo-0.0.1-1.fc21.src.rpm will produce foo-0.0.1-1.el6.x86_64.rpm. This difference means that the target and source side patterns of a naive Make pattern rule won't match. To avoid this, when running rpmbuild we force %{dist} to the same value as it will have in mock, but this adds complexity when building packages for several different distributions on the same host.

The dependency generation and makefile have changed considerably since we made the %{dist} change. We should check whether it is still necessary to set it at all. One possibility is to unset it, producing intermediate SRPMs with names such as foo-0.0.1-1.src.rpm, and change the rule generation to match these to the appropriate binary RPMs.

@euanh
Copy link
Contributor Author

euanh commented Apr 8, 2015

We can remove dist from the names of the intermediate SRPMs. The following changes are needed:

  • pass --undefine dist to rpmbuild in Makefile.rules
  • modify planex.spec.Spec to generate source package names without dist (this is harder than it seems because %{dist} is interpolated into the source package release field when the spec file is loaded, rather than when we expand the filename macro.

We still need to define DIST in the Makefile and pass it to planex-depend. planex-depend passes this value into planex.spec.Spec, so that it can generate correct binary package names. The correct way to do this would seem to be to parse the spec file twice - once with dist set and once without. This is ugly, but any other approach, such as removing the value of dist from release after the fact, would be more error prone.

@euanh euanh removed the question label Apr 23, 2015
@euanh euanh added this to the 0.8.0 milestone Apr 23, 2015
@euanh euanh changed the title Do we still need to include dist (e.g. el6) in the names of our intermediate srpms? Stop including dist (e.g. el6) in the names of our intermediate srpms Apr 23, 2015
@euanh
Copy link
Contributor Author

euanh commented Apr 23, 2015

We should extract the correct value of dist from the mock configuration file.

$ cat /etc/mock/epel-7-x86_64.cfg 
config_opts['root'] = 'epel-7-x86_64'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'el7'  # only useful for --resultdir variable subst
...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant