SPEC files: Include RHEL distribution in the release

Juergen Zahrer jzahrer at unix.sbg.ac.at
Fri Aug 1 07:02:15 UTC 2008


Joel Heenan wrote:
> I'm building an RPM on a number of different RHEL versions. Is there
> something I can include in the RPM spec file which will auto-set the
> distribution name and version?
> 
> I tried:
> 
> Release: 1%{distribution}
> 
> In the spec file but this did not seem to do the trick. I'm feeling what
> I'm trying to achieve is simple but I haven't found any examples yet.

Hi,

create a .rpmmacros file in your home:

all in one line:
#############################
%distribution ) %(echo `cat /etc/redhat-release | grep -q '^CentOS 
release 4' && echo 'el4'`)%(echo `cat /etc/redhat-release | grep -q 
'^CentOS release 5' && echo 'el5'`)
#############################

you may add other systems as well

-- 
Mit freundlichen Grüssen,
Mag. Jürgen Zahrer

Leiter System Services
Universität Salzburg / ITServices

Hellbrunner Strasse 34
5020 Salzburg
Austria

Phone: ++43-(0)662-8044-6745
Cell: ++43-(0)664-2823790
Fax: ++43-(0)662-6389-6745
key ID 7B34AB4C





More information about the redhat-list mailing list