[opensuse-packaging] spec-cleaner and defines
Hi, here is my stupid question of the day: 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 ... Is it ok to ignore (in that case) spec-cleaner or is there a better way to achieve that? -- 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@physik.uni-wuerzburg.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Mar 18, 2019 at 5:24 AM Andreas Vetter <vetter@physik.uni-wuerzburg.de> wrote:
Hi, here is my stupid question of the day:
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 ...
Is it ok to ignore (in that case) spec-cleaner or is there a better way to achieve that?
It should work if you change %define to %global, but you're doing it wrong there. The whole thing in URL should be in Source, and URL is supposed to be set to the project's home page. So it'd look something like this: URL: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb Source: https://git.zerfleddert.de/hmcfgusb/releases/%{name}-%{version}.tar.gz -- 真実はいつも一つ!/ Always, there's only one truth! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Quoting Neal Gompa <ngompa13@gmail.com>:
On Mon, Mar 18, 2019 at 5:24 AM Andreas Vetter <vetter@physik.uni-wuerzburg.de> wrote:
Hi, here is my stupid question of the day:
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 ...
Is it ok to ignore (in that case) spec-cleaner or is there a better way to achieve that?
It should work if you change %define to %global, but you're doing it wrong there.
The whole thing in URL should be in Source, and URL is supposed to be set to the project's home page.
So it'd look something like this:
URL: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb Source: https://git.zerfleddert.de/hmcfgusb/releases/%{name}-%{version}.tar.gz
Ah, thank you. So I'll need to check my other packages, too. -- 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@physik.uni-wuerzburg.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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). Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
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. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Quoting Michael Schroeder <mls@suse.de>:
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@physik.uni-wuerzburg.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 18/03/2019 19:53, Andreas Vetter wrote:
Hi, here is my stupid question of the day:
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 ...
Is it ok to ignore (in that case) spec-cleaner or is there a better way to achieve that?
Another way to achieve it is to define the name and version somewhere else, i've seen spec files that define ver and base_name or something similar, but often they are more complex packages that do something different for versions / tarball names when packaging alpha's / beta's so it may not be better in your case but it is another way. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
Andreas Vetter
-
Marcus Hüwe
-
Michael Schroeder
-
Neal Gompa
-
Simon Lees