Skip to content

Commit

Permalink
Improve distribution detection in RPM spec (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailKasimov authored and adegtyarev committed Nov 24, 2018
1 parent 3cbee1f commit 8e41694
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions gost3411-2012.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,45 @@ install -pm 644 gost3411-2012-sse41.h %{buildroot}%{_includedir}/gost3411-2012/
%{_mandir}/man1/gost3411-2012*
#
# Copy LICENSE file to %%doc for:
# - SLE 12 SP2 and lower
# - openSUSE Leap 42.2 and lower
# - RHEL 6 and lower
#
# - 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
#
# Copy LICENSE file to %%license for:
# - SLE 12 SP3 and higher
# - openSUSE Leap 42.3 and higher
# - RHEL 7 and higher
#
# - RedHat Enterprise Linux 7 and higher
# - CentOS 7 and higher
# - Fedora 19 and higher
#
# - Scientific Linux 7 and higher
#
# Fedora distros feel OK to LICENSE being both in %%doc or %%license regardless to their version.
# - SUSE Linux Enterprise 12 SP3 and higher
# - openSUSE Leap 42.3 and higher
# - openSUSE Tumbleweed and its derivatives
#
# - Mageia 5 and higher
#
# Guideline paragraphs about using %%license macro instead of %%doc for LICENSE in spec-files:
#
# Fedora: [0] https://fedoraproject.org/wiki/Packaging:LicensingGuidelines?rd=Packaging/LicensingGuidelines#License_Text
#
# openSUSE: [1] https://en.opensuse.org/openSUSE:Specfile_guidelines#License_files
#
%if ( 0%{?sle_version} <= 120200 && !0%{?is_opensuse} ) || ( 0%{?sle_version} <= 120200 && 0%{?is_opensuse} ) || 0%{?rhel_version} <= 600 || 0%{?centos_version} <= 600 || 0%{?scientificlinux_version} <= 600
%doc LICENSE LICENSE.GPL2 README.md
%else
# Distribution detection codes: [2] https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto
#
%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 README.md
%license LICENSE LICENSE.GPL2
%else
%doc LICENSE LICENSE.GPL2 README.md
%endif

%files devel
Expand All @@ -103,4 +114,3 @@ install -pm 644 gost3411-2012-sse41.h %{buildroot}%{_includedir}/gost3411-2012/

* Mon Apr 09 2018 [email protected] 0.12-1
- Initial RPM release

0 comments on commit 8e41694

Please sign in to comment.