[opensuse-packaging] Generalized %license <-> %doc macros backward compability patch
Hello, list!
After having couple of tests on [0] https://build.opensuse.org, let me
introduce a way (workable patch) how to have normal %license <-> %doc
RPM-macros backward compability for wide row of various versions of
different RPM-based distros
(RedHat/CentOS/Fedora/SUSE/openSUSE/Mageia/Mandriva).
Patch is based on:
[1] https://lists.opensuse.org/opensuse-factory/2016-02/msg00167.html
[2] https://lists.opensuse.org/opensuse-packaging/2018-11/msg00015.html
Patch code:
==========
#
# Copy LICENSE(-s) stuff to %%doc for:
#
# - RedHat Enterprise Linux 6 and lower
# - CentOS 6 and lower
# - Fedora 18 and lower
#
# - Scientific Linux 6 and lower
#
# - SUSE Linux Enterprise 12 SP2 and lower
# - openSUSE Leap 42.2 and lower
#
# - Mageia 4 and lower and all Mandriva line
#
# Copy LICENSE(-s) stuff to %%license for:
#
# - RedHat Enterprise Linux 7 and higher
# - CentOS 7 and higher
# - Fedora 19 and higher
#
# - Scientific Linux 7 and higher
#
# - SUSE Linux Enterprise 12 SP3 and higher
# - openSUSE Leap 42.3 and higher
# - openSUSE Tumbleweed and its derivatives
#
# - Mageia 5 and higher
#
#
%if ( 0%{?sle_version} > 120200 && !0%{?is_opensuse} ) || (
0%{?sle_version} > 120200 && 0%{?is_opensuse} ) || 0%{?suse_version} >
1500 || 0%{?rhel_version} > 600 || 0%{?centos_version} > 600 ||
0%{?scientificlinux_version} > 600 || 0%{?fedora_version} > 18 ||
0%{?mageia} > 4
%doc
On Thu, Nov 29, 2018 at 11:58:15AM +0200, Mikhail Kasimov wrote:
After having couple of tests on [0] https://build.opensuse.org, let me introduce a way (workable patch) how to have normal %license <-> %doc RPM-macros backward compability for wide row of various versions of different RPM-based distros (RedHat/CentOS/Fedora/SUSE/openSUSE/Mageia/Mandriva). [...]
Can't you do something simple like (untested): %{?!_licensedir:%define license %%doc} 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
On Thu, Nov 29, 2018 at 7:05 AM Michael Schroeder
On Thu, Nov 29, 2018 at 11:58:15AM +0200, Mikhail Kasimov wrote:
After having couple of tests on [0] https://build.opensuse.org, let me introduce a way (workable patch) how to have normal %license <-> %doc RPM-macros backward compability for wide row of various versions of different RPM-based distros (RedHat/CentOS/Fedora/SUSE/openSUSE/Mageia/Mandriva). [...]
Can't you do something simple like (untested):
%{?!_licensedir:%define license %%doc}
This works for everyone but SLE 12 and SLE 12.1 (and corresponding Leap derivative releases). The reason it doesn't work is because %_licensedir is defined and filesystem didn't own the directory. So the %license macro would work, but OBS would reject the package anyway. That was fixed in SLE 12.2. -- 真実はいつも一つ!/ 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
Hello!
чт, 29 нояб. 2018 г. в 14:08, Neal Gompa
On Thu, Nov 29, 2018 at 7:05 AM Michael Schroeder
wrote: On Thu, Nov 29, 2018 at 11:58:15AM +0200, Mikhail Kasimov wrote:
After having couple of tests on [0] https://build.opensuse.org, let me introduce a way (workable patch) how to have normal %license <-> %doc RPM-macros backward compability for wide row of various versions of different RPM-based distros (RedHat/CentOS/Fedora/SUSE/openSUSE/Mageia/Mandriva). [...]
Can't you do something simple like (untested):
%{?!_licensedir:%define license %%doc}
This works for everyone but SLE 12 and SLE 12.1 (and corresponding Leap derivative releases).
The reason it doesn't work is because %_licensedir is defined and filesystem didn't own the directory. So the %license macro would work, but OBS would reject the package anyway. That was fixed in SLE 12.2.
This bumped me to take one more experiment: to re-check with backported repos. And the most interesting results are for i586 architecture on openSUSE_Leap_42.3_Ports (succeeded) and SLE_12_SP3_Backports (failed): (succeeded) https://build.opensuse.org/package/live_build_log/home:k_mikhail:branches:ho... (failed) https://build.opensuse.org/package/live_build_log/home:k_mikhail:branches:ho... ( [33s] fprobe-1.1-23.1.i586.rpm: directories not owned by a package: - /usr/share/licenses). The same is to the second package. Me surprised... Ideas? "Can't you do something simple like (untested): %{?!_licensedir:%define license %%doc}" <-- I'm very сareful on "simplifications" instead of giving explicit constructions. In what exact location of spec file such construction should be put? Thanks! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, Am Donnerstag, 29. November 2018, 15:31:58 CET schrieb Mikhail Kasimov:
чт, 29 нояб. 2018 г. в 14:08, Neal Gompa
: On Thu, Nov 29, 2018 Michael Schroeder
wrote: Can't you do something simple like (untested):
%{?!_licensedir:%define license %%doc}
This works for everyone but SLE 12 and SLE 12.1 (and corresponding Leap derivative releases).
The reason it doesn't work is because %_licensedir is defined and filesystem didn't own the directory. So the %license macro would work, but OBS would reject the package anyway. That was fixed in SLE 12.2. ... fprobe-1.1-23.1.i586.rpm: directories not owned by a package: - /usr/share/licenses).
The same is to the second package. Me surprised... Ideas?
You could add %dir /usr/share/licenses to %files. Even if you add version checks for the (IIRC) two distributions where this directory isn't owned by aaa_base, the spec will still look much cleaner than the big chain of version checks in your initial proposal ;-)
"Can't you do something simple like (untested): %{?!_licensedir:%define license %%doc}" <-- I'm very сareful on "simplifications" instead of giving explicit constructions. In what exact location of spec file such construction should be put?
AFAIK at or near the beginning, so that %license is defined when it gets used ;-) Regards, Christian Boltz -- höflich Erklärung auf einem Niveau, das nicht vorsätzlich das Gegenüber als Volltrottel hinstellt. [Lars Marowsky-Brée] -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, Nov 29, 2018 at 12:56 PM Christian Boltz
Hello,
Am Donnerstag, 29. November 2018, 15:31:58 CET schrieb Mikhail Kasimov:
чт, 29 нояб. 2018 г. в 14:08, Neal Gompa
: On Thu, Nov 29, 2018 Michael Schroeder
wrote: Can't you do something simple like (untested):
%{?!_licensedir:%define license %%doc}
This works for everyone but SLE 12 and SLE 12.1 (and corresponding Leap derivative releases).
The reason it doesn't work is because %_licensedir is defined and filesystem didn't own the directory. So the %license macro would work, but OBS would reject the package anyway. That was fixed in SLE 12.2. ... fprobe-1.1-23.1.i586.rpm: directories not owned by a package: - /usr/share/licenses).
The same is to the second package. Me surprised... Ideas?
You could add %dir /usr/share/licenses to %files. Even if you add version checks for the (IIRC) two distributions where this directory isn't owned by aaa_base, the spec will still look much cleaner than the big chain of version checks in your initial proposal ;-)
"Can't you do something simple like (untested): %{?!_licensedir:%define license %%doc}" <-- I'm very сareful on "simplifications" instead of giving explicit constructions. In what exact location of spec file such construction should be put?
AFAIK at or near the beginning, so that %license is defined when it gets used ;-)
It's not a good idea to put it anywhere close to the preamble area, since it would break the License tag, hence the suggestion to put it at the top of a %files section. -- 真実はいつも一つ!/ 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
Hello!
The problem for SLE_12_SP3_Backport (i586), in fact, looks more
specific, with "underwater stone":
https://bugzilla.opensuse.org/show_bug.cgi?id=1118751 . In particular
https://bugzilla.opensuse.org/show_bug.cgi?id=1118751#c7
've left patch code "long", as it was in initial variant, to avoid
potential "underwater stones" like mentioned above.
Thanks!
чт, 29 нояб. 2018 г. в 19:56, Christian Boltz
Hello,
Am Donnerstag, 29. November 2018, 15:31:58 CET schrieb Mikhail Kasimov:
чт, 29 нояб. 2018 г. в 14:08, Neal Gompa
: On Thu, Nov 29, 2018 Michael Schroeder
wrote: Can't you do something simple like (untested):
%{?!_licensedir:%define license %%doc}
This works for everyone but SLE 12 and SLE 12.1 (and corresponding Leap derivative releases).
The reason it doesn't work is because %_licensedir is defined and filesystem didn't own the directory. So the %license macro would work, but OBS would reject the package anyway. That was fixed in SLE 12.2. ... fprobe-1.1-23.1.i586.rpm: directories not owned by a package: - /usr/share/licenses).
The same is to the second package. Me surprised... Ideas?
You could add %dir /usr/share/licenses to %files. Even if you add version checks for the (IIRC) two distributions where this directory isn't owned by aaa_base, the spec will still look much cleaner than the big chain of version checks in your initial proposal ;-)
"Can't you do something simple like (untested): %{?!_licensedir:%define license %%doc}" <-- I'm very сareful on "simplifications" instead of giving explicit constructions. In what exact location of spec file such construction should be put?
AFAIK at or near the beginning, so that %license is defined when it gets used ;-)
Regards,
Christian Boltz -- höflich Erklärung auf einem Niveau, das nicht vorsätzlich das Gegenüber als Volltrottel hinstellt. [Lars Marowsky-Brée]
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (4)
-
Christian Boltz
-
Michael Schroeder
-
Mikhail Kasimov
-
Neal Gompa