Is it kosher to use the %{dist} tag for conditional compilation? The shift from g77 to gfortran in FC3->FC4 has led to the need to compile packages differently for the two distributions.
On Fri, 2005-07-15 at 14:48 -0600, Orion Poplawski wrote:
Is it kosher to use the %{dist} tag for conditional compilation? The shift from g77 to gfortran in FC3->FC4 has led to the need to compile packages differently for the two distributions.
No. Use %{fedora}. It will have an integer value the same as the version of Fedora the package is built for. Even better, since there are separate branches per version it's easy enough to just have the differences in the spec files directly.
Ignacio Vazquez-Abrams wrote:
No. Use %{fedora}. It will have an integer value the same as the version of Fedora the package is built for. Even better, since there are separate branches per version it's easy enough to just have the differences in the spec files directly.
Could you give an example? I can't find docs on how to use %if in a spec file to compare values. Trying to do something like:
%if %{fedora} >= 4 BuildRequires: gcc-gfortran %else BuildRequires: gcc-g77 %endif
On Fri, 15 Jul 2005, Orion Poplawski wrote:
Could you give an example? I can't find docs on how to use %if in a spec file to compare values. Trying to do something like:
%if "%fedora" >= "4" BuildRequires: gcc-gfortran %else BuildRequires: gcc-g77 %endif
This should work.
bye, andreas
Andreas Thienemann wrote:
On Fri, 15 Jul 2005, Orion Poplawski wrote:
%if "%fedora" >= "4" BuildRequires: gcc-gfortran %else BuildRequires: gcc-g77 %endif
This should work.
bye, andreas
On my FC4 box I get:
$ rpmbuild -ba *spec error: Failed build dependencies: gcc-g77 is needed by hdf-4.2r1-2.i386
So looks like %fedora is not defined on user machins, only in the build system? This won't work.
Orion Poplawski wrote:
Andreas Thienemann wrote:
On Fri, 15 Jul 2005, Orion Poplawski wrote:
%if "%fedora" >= "4" BuildRequires: gcc-gfortran %else BuildRequires: gcc-g77 %endif
This should work.
On my FC4 box I get:
$ rpmbuild -ba *spec error: Failed build dependencies: gcc-g77 is needed by hdf-4.2r1-2.i386
So looks like %fedora is not defined on user machins, only in the build system?
Yes, the Fedora Extras buildsystem defines this macro. You expected otherwise?
-- Rex
Rex Dieter wrote:
Orion Poplawski wrote:
Andreas Thienemann wrote:
On Fri, 15 Jul 2005, Orion Poplawski wrote:
%if "%fedora" >= "4" BuildRequires: gcc-gfortran %else BuildRequires: gcc-g77 %endif
This should work.
On my FC4 box I get:
$ rpmbuild -ba *spec error: Failed build dependencies: gcc-g77 is needed by hdf-4.2r1-2.i386
So looks like %fedora is not defined on user machins, only in the build system?
Yes, the Fedora Extras buildsystem defines this macro. You expected otherwise?
To emulate the buildsystem behavior (in this context), you'd need to:
rpmbuild --define "fedora 4" --define "dist fc4" foo.spec
-- Rex
On 7/20/05, Rex Dieter rdieter@math.unl.edu wrote:
Yes, the Fedora Extras buildsystem defines this macro. You expected otherwise?
actually.. i sort of do. I'd very much expect my workstation running fc4 to have access to a package with the fedora specific macro definitions set to values the fedora-whatever build system uses for building packages for fc4. I dont expect my fc4 workstation to build things for fc3 or the development tree without some define love. But i would expect there to be a package that provided the fedora specific fc4 rpm macros as well as providing those macros when using a mock managed local build environment. mock is great and all.. but we can't demand it be used for local test building.
-jef
Jeff Spaleta wrote :
On 7/20/05, Rex Dieter rdieter@math.unl.edu wrote:
Yes, the Fedora Extras buildsystem defines this macro. You expected otherwise?
actually.. i sort of do. I'd very much expect my workstation running fc4 to have access to a package with the fedora specific macro definitions set to values the fedora-whatever build system uses for building packages for fc4. [...]
Just to point this out : When Dag and I were searching for agreements on many diverging points in our ways of building packages, one we easily got to was to have the default (i.e. "without any manual defines") rebuild for the latest release of the distribution available.
In this case, this means that if someone checks for %{fedora}'s value, but it isn't defined, the behavior should default to the proper one for FC4 (since it's the latest ATM). For me, this is a sane default, and I'd like to see Extras use it as much as possible too ;-)
So "if %fedora >= 4 then foo else bar" should be replaced by something else that works as expected (like what Ignacio wrote).
Matthias
On 8/1/05, Matthias Saou thias@spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net wrote:
In this case, this means that if someone checks for %{fedora}'s value, but it isn't defined, the behavior should default to the proper one for FC4 (since it's the latest ATM). For me, this is a sane default, and I'd like to see Extras use it as much as possible too ;-)
I didnt say anything about default behavior.. i just want access to a package that gives me the canonical buildsystem macro settings for the release I'm trying to build on regardless of its vintage. So when I'm doing local building when prepping a package I can have very good confidence that I am using the the correct build environment without having to resort to building inside mock for every local build attempt I make when I'm troubleshooting packaging bugs.
-jef
On Wed, 2005-07-20 at 10:41 -0600, Orion Poplawski wrote:
Andreas Thienemann wrote:
On Fri, 15 Jul 2005, Orion Poplawski wrote:
%if "%fedora" >= "4" BuildRequires: gcc-gfortran %else BuildRequires: gcc-g77 %endif
This should work.
On my FC4 box I get:
$ rpmbuild -ba *spec error: Failed build dependencies: gcc-g77 is needed by hdf-4.2r1-2.i386
So looks like %fedora is not defined on user machins, only in the build system? This won't work.
Put this in /etc/rpm:
http://fedora.ivazquez.net/files/macros.disttag
On Fri, 2005-07-15 at 16:35 -0600, Orion Poplawski wrote:
Ignacio Vazquez-Abrams wrote:
No. Use %{fedora}. It will have an integer value the same as the version of Fedora the package is built for. Even better, since there are separate branches per version it's easy enough to just have the differences in the spec files directly.
Could you give an example? I can't find docs on how to use %if in a spec file to compare values.
%if 0%{?fedora} > 03 foo %else bar %endif
On Fri, 2005-07-15 at 14:48 -0600, Orion Poplawski wrote:
Is it kosher to use the %{dist} tag for conditional compilation?
No, I don't think so - because %{dist} is not defined on the users machines, only defined on the build machine, in mock.
different spec files in the different branches seems best to me.
The shift from g77 to gfortran in FC3->FC4 has led to the need to compile packages differently for the two distributions.
--On Friday, July 15, 2005 3:28 PM -0700 "Michael A. Peters" mpeters@mac.com wrote:
different spec files in the different branches seems best to me.
OTOH, if your objective is to create a tarball that can also be built as an RPM, then you want a single spec file so that -ta is unambiguous.
On Sat, 2005-07-16 at 11:47 -0700, Kenneth Porter wrote:
--On Friday, July 15, 2005 3:28 PM -0700 "Michael A. Peters" mpeters@mac.com wrote:
different spec files in the different branches seems best to me.
OTOH, if your objective is to create a tarball that can also be built as an RPM, then you want a single spec file so that -ta is unambiguous.
The dist tag guidelines are setup specifically so that you can either use them, or not use them.
If you don't like the idea of using them in your packages, by all means, do not. It will NOT fail a review if you don't use them.
However, if you want to use them, all you have to do is use them properly.
~spot
On Sat, 2005-07-16 at 11:47 -0700, Kenneth Porter wrote:
--On Friday, July 15, 2005 3:28 PM -0700 "Michael A. Peters" mpeters@mac.com wrote:
different spec files in the different branches seems best to me.
OTOH, if your objective is to create a tarball that can also be built as an RPM, then you want a single spec file so that -ta is unambiguous.
spec files in upstream tarballs should really try to avoid using distribution specific macros anyway.
packaging@lists.fedoraproject.org