Commit 1a9504c0 authored by Jonathan Perkin's avatar Jonathan Perkin

fixup license and tidy distro detection

parent 5893458e
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
%define mysql_vendor_2 Sun Microsystems, Inc. %define mysql_vendor_2 Sun Microsystems, Inc.
%define mysql_vendor Oracle and/or its affiliates %define mysql_vendor Oracle and/or its affiliates
%define mysql_license GPL
%define mysql_version @VERSION@ %define mysql_version @VERSION@
%define mysqld_user mysql %define mysqld_user mysql
...@@ -130,43 +129,44 @@ ...@@ -130,43 +129,44 @@
%endif %endif
%if %{distro_specific} %if %{distro_specific}
%if %(test -f /etc/redhat-release && echo 1 || echo 0) %if %(test -f /etc/redhat-release && echo 1 || echo 0)
%define redhatver %(rpm -qf --qf '%%{version}' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') %define redhatver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%{echo:Found Red Hat version %{redhatver}} %if "%redhatver" == "4"
%if %redhatver == 4
%define distro_description Red Hat Enterprise Linux 4 %define distro_description Red Hat Enterprise Linux 4
%define distro_releasetag rhel4 %define distro_releasetag rhel4
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils %define distro_requires chkconfig coreutils grep procps shadow-utils
%else %else
%if %redhatver == 5 %if "%redhatver" == "5"
%define distro_description Red Hat Enterprise Linux 5 %define distro_description Red Hat Enterprise Linux 5
%define distro_releasetag rhel5 %define distro_releasetag rhel5
%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
%define distro_requires chkconfig coreutils grep procps shadow-utils %define distro_requires chkconfig coreutils grep procps shadow-utils
%else
%{error:Red Hat %{redhatver} is unsupported}
%endif %endif
%endif %endif
%else %else
%if %(test -f /etc/SuSE-release && echo 1 || echo 0) %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
%define susever %(rpm -qf --qf '%%{version}' /etc/SuSE-release) %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release)
%{echo:Found SuSE version %{susever}} %if "%susever" == "10"
%if %susever == 10
%define distro_description SUSE Linux Enterprise Server 10 %define distro_description SUSE Linux Enterprise Server 10
%define distro_releasetag sles10 %define distro_releasetag sles10
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils %define distro_requires aaa_base coreutils grep procps pwdutils
%else %else
%if %susever == 11 %if "%susever" == "11"
%define distro_description SUSE Linux Enterprise Server 11 %define distro_description SUSE Linux Enterprise Server 11
%define distro_releasetag sles11 %define distro_releasetag sles11
%define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
%define distro_requires aaa_base coreutils grep procps pwdutils %define distro_requires aaa_base coreutils grep procps pwdutils
%else
%{error:SuSE %{susever} is unsupported}
%endif %endif
%endif %endif
%endif %else
%endif
%if %{undefined distro_description}
%{error:Unsupported distribution} %{error:Unsupported distribution}
%endif %endif
%endif
%else %else
%define generic_kernel %(uname -r | cut -d. -f1-2) %define generic_kernel %(uname -r | cut -d. -f1-2)
%define distro_description Generic Linux (kernel %{generic_kernel}) %define distro_description Generic Linux (kernel %{generic_kernel})
...@@ -175,7 +175,8 @@ ...@@ -175,7 +175,8 @@
%define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
%endif %endif
%{echo:Building for %{distro_description}} %{echo:Building for %{distro_description}
}
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Support optional "tcmalloc" library (experimental) # Support optional "tcmalloc" library (experimental)
...@@ -196,7 +197,7 @@ ...@@ -196,7 +197,7 @@
%else %else
%define license_files_devel %{src_dir}/EXCEPTIONS-CLIENT %define license_files_devel %{src_dir}/EXCEPTIONS-CLIENT
%define license_files_server %{src_dir}/COPYING %{src_dir}/README %define license_files_server %{src_dir}/COPYING %{src_dir}/README
%define license_type %{mysql_license} %define license_type GPL
%endif %endif
############################################################################## ##############################################################################
...@@ -209,7 +210,7 @@ Group: Applications/Databases ...@@ -209,7 +210,7 @@ Group: Applications/Databases
Version: @MYSQL_U_SCORE_VERSION@ Version: @MYSQL_U_SCORE_VERSION@
Release: %{release}%{?distro_releasetag:.%{distro_releasetag}} Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
Distribution: %{distro_description} Distribution: %{distro_description}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Use is subject to license terms. Under %{mysql_license} license as shown in the Description field. License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Use is subject to license terms. Under %{license_type} license as shown in the Description field.
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/ URL: http://www.mysql.com/
Packager: MySQL Build Team <build@mysql.com> Packager: MySQL Build Team <build@mysql.com>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment