Ludwig Nussel wrote:
On Sunday 12 March 2006 16:40, Pascal Bleser wrote:
Following "issue": to set the %{DISTRIBUTION} header in my RPMs, I use the following trick in my spec files:
Distribution: %(head -1 /etc/SuSE-release)
That's nasty.
Nasty but works, except for 10.1 betas (because they have 10.0.42 instead of 10.1 in /etc/SuSE-release). I don't want to pass something from the "outside" (e.g. passing a variable through rpmbuild or adding a macro in an rpmrc/macros file) because it will break source rpm rebuilding, in the sense that if you don't have those settings in your rpmrc/macros, it won't work properly. That's a very evil thing to do IMO, I really care a lot about src.rpm's being rebuildable by users. And I don't want to end up with a non-standard build environment because I use macros that are only defined in my environment.
When one doesn't explicitely specify the Distribution: tag, the RPM ends up with "Distribution: (none)".
Now I wonder, has anyone a better solution for this ? How is this solved @SUSE ? Are you setting it using build/abuild/y2pmbuild ? spec-file postprocessing ?
/etc/y2pmbuild/files/*/etc/rpm/macros
Ok. Unfortunately y2pmbuild is no option for me, I have my own build scripts that better fit my environment (and that support any BuildRequires syntax). I'll probably use something like this: %if %{?distribution:1}0 Distribution: %{distribution} %endif to pass my own RPM macros but fall back more or less nicely if it isn't defined. It would be nice if RPM(build) did something like #include /etc/rpm.d/* when pulling macro definition files because that way, one could provide his macros as an RPM package and "BuildRequires" it in the spec file. Even more, that way we could use the RPM macros from the Build Service even without the Build Service in a very clean way, e.g.: BuildRequires: suse-build-service-macros Anyway, thanks for the information ;) cheers -- -o) Pascal Bleser http://linux01.gwdg.de/~pbleser/ /\\ <pascal.bleser@skynet.be> <guru@unixtech.be> _\_v FOSDEM 2006 -- 25+26 February 2006 in Brussels