Specfile question about %{?dist} - Redhat

This is a discussion on Specfile question about %{?dist} - Redhat ; Hi, I have a Fedora FC5 running hapily on my laptop. Regularly I build my own RPM packages, starting from *.src.rpm source packages and applying my personal patches. In the header of some SPEC files I find something like: Release: ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Specfile question about %{?dist}

  1. Specfile question about %{?dist}

    Hi,

    I have a Fedora FC5 running hapily on my laptop. Regularly I build my own
    RPM packages, starting from *.src.rpm source packages and applying my
    personal patches.

    In the header of some SPEC files I find something like:

    Release: 3%{?dist}

    Which should - I guess - automatically be expanded to "3.fc5" while
    building the rpm package. But on my system this is ignored and the built
    package will only have "3" as release number. No big deal, but what's
    missing on my system ? Maybe I should edit the rpm macro files somewhere ?

    I'm using up to date rpm/rpmbuild packages. But maybe something wasn't
    updated since I once started with RH9 and later updated to FC3, FC4, FC5.

    --

    Martin Tarenskeen

  2. Re: Specfile question about %{?dist}

    Martin Tarenskeen wrote:

    > Hi,
    >
    > I have a Fedora FC5 running hapily on my laptop. Regularly I build my own
    > RPM packages, starting from *.src.rpm source packages and applying my
    > personal patches.
    >
    > In the header of some SPEC files I find something like:
    >
    > Release: 3%{?dist}
    >
    > Which should - I guess - automatically be expanded to "3.fc5" while
    > building the rpm package. But on my system this is ignored and the built
    > package will only have "3" as release number. No big deal, but what's
    > missing on my system ? Maybe I should edit the rpm macro files somewhere ?


    No it is not automatically expanded to show the distro version, you need to
    supply the information by adding it to the spec file or when typing the
    rpmbuild command;

    Spec file addition: %define dist .fc5
    rpmbuild -bb --define 'dist .fc5' foo.spec

    What really makes this fun is when you use the define statement the binary
    packagename(s) results can be different;

    rpmbuild -bb --define 'dist .xyz' foo.spec

    The resulting binary rpm package(s0 will have .xyz as part of the package
    name. Consider that setting the define dist statement as a quick and easy
    way to know if the packages are meant for the distro in question.


    --
    Contained within the Microsoft EULA;
    This Limited Warranty is void if failure of the Product has resulted
    from accident, abuse, misapplication, abnormal use or a virus.

+ Reply to Thread