[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 <put all your package readme and other information stuff here, except license(-s) stuff> %license <put your package license(-s) stuff here only> %else %doc <put all your package readme, license(-s) and other information stuff here> %endif ========== Gived in patch versions of dstros are settled after having couple of tests on [0] for different packages to get green "succeeded" biulding output for all. Actually, for example: [3] https://build.opensuse.org/package/show/home:k_mikhail/GOST34.11-2012 [4] https://build.opensuse.org/package/show/home:k_mikhail:branches:home:onielse... Hope, this patch will be useful/helpful for packagers, who want to build their packages for wide row of different RPM-based distros and their various versions and to be OK with building guidelines ([5], [6]). Feel free to update this patch, if needed. Thanks! References: ========== Fedora: [5] https://fedoraproject.org/wiki/Packaging:LicensingGuidelines?rd=Packaging/Li... openSUSE: [6] https://en.opensuse.org/openSUSE:Specfile_guidelines#License_files Distribution detection codes: [7] https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto -- 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 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 <mls@suse.de> 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. -- 真実はいつも一つ!/ 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 <ngompa13@gmail.com>:
On Thu, Nov 29, 2018 at 7:05 AM Michael Schroeder <mls@suse.de> 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 <ngompa13@gmail.com>:
On Thu, Nov 29, 2018 Michael Schroeder <mls@suse.de> 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 <opensuse@cboltz.de> wrote:
Hello,
Am Donnerstag, 29. November 2018, 15:31:58 CET schrieb Mikhail Kasimov:
чт, 29 нояб. 2018 г. в 14:08, Neal Gompa <ngompa13@gmail.com>:
On Thu, Nov 29, 2018 Michael Schroeder <mls@suse.de> 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 <opensuse@cboltz.de>:
Hello,
Am Donnerstag, 29. November 2018, 15:31:58 CET schrieb Mikhail Kasimov:
чт, 29 нояб. 2018 г. в 14:08, Neal Gompa <ngompa13@gmail.com>:
On Thu, Nov 29, 2018 Michael Schroeder <mls@suse.de> 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