parametrized macro for %description

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello,

I want to add information in the %description field without having to modify
the spec file (because there are hundreds of packages to maintain).
The goal is to indicate with which gcc and glibc the package has been compiled,
(but the information could be anything else).

So I added these two lines in ~/.rpmmacros :

%description()  %%description %*\
Built with %(rpm -q gcc) and %(rpm -q glibc).

Now, imagine the following .spec file :

Name:           blah
Version:        1.0
Release:        1
License:        GPL
Summary: Test package
Group: Applications/Games
%description
The blah package makes nothing.

%package devel
Summary: Devel package
Group: Applications/Devel

%description devel
To develop blah.

%package -n blah2
Summary: Alternative test package
Group: Applications/Games

%description -n blah2
Alternative version of blah.

[...]

This should generate 3 packages :

1) blah-1.0-1.i386.rpm with the following description :

Built with gcc-2.96-112.7.2 and glibc-2.2.4-33.
The blah package makes nothing.

2) blah-devel-1.0-1.i386.rpm with the following description :

Built with gcc-2.96-112.7.2 and glibc-2.2.4-33.
To develop blah.

3) blah2-1.0-1.i386.rpm with the following description :

Built with gcc-2.96-112.7.2 and glibc-2.2.4-33.
Alternative version of blah.


The first two packages are built correctly, but the third one
doesn't (I tried 2 and 3 separately). The error is the following :

description: invalid option -- n
error: Unknown option ? in description()
error: line 33: Package does not exist: %description %*

I've tried with rpm-4.0.4-7x (RH 7.2) and rpm-4.3.3-18 (RHEL 4), the results are
the same.

So how can I manage the "-n" option in my macro ?

Thanks for your help !

BTW : if someone knows how to include my additional information ("Built with gcc ...")
AT THE END of the description, it would be nice.

Loïc

Toulouse, France
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux