Mailinglist Archive: opensuse-packaging (121 mails)

< Previous Next >
Re: [opensuse-packaging] spec-cleaner and defines
Quoting Michael Schroeder <mls@xxxxxxx>:

On Mon, Mar 18, 2019 at 06:54:24PM +0100, Marcus Hüwe wrote:
On 2019-03-18 10:23:45 +0100, Andreas Vetter wrote:
> spec-cleaner wants to move defines to the beginning of the spec file. But I
> need it after Name and Version like that:
>
> Name: hmcfgusb
> Version: 0.103
> %define tarball %{name}-%{version}.tar.gz
> ...
> URL: https://git.zerfleddert.de/hmcfgusb/releases/%{tarball}
> Source: %{tarball}
>
>
> spec-cleaner wants to turn it around, but then it does not work:
>
> %define tarball %{name}-%{version}.tar.gz
> Name: hmcfgusb
> Version: 0.103
> ...
>
This will work as long as the URL tag is specified after the Name and
Version tags (if the URL tag is specified before Name or Version, some
macros cannot be expanded).

Just some more clarification: With %define, macros in the body (in this
case %{name} and %{version}) will be expanded at the time the macro is
used. So defining %tarball before the Name and Version line works.

This is different to %global, where macros in the body will be expanded
right away.

Thank you, Michael.
So this means moving %define to the beginning is completely ok and works.

--
Mit freundlichen Gruessen,
  Andreas Vetter

Stellv. IT-Bereichsmanager Fakultaet fuer Physik und Astronomie
Tel.: +49 (0)931 31-82264

Informations- und Kommunikationstechnik
Tel: +49 (0)931 31-85890
iuk@xxxxxxxxxxxxxxxxxxxxxxx
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >