summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorJonathan Perkin <jonathan.perkin@oracle.com>2010-04-12 22:23:25 +0200
committerJonathan Perkin <jonathan.perkin@oracle.com>2010-04-12 22:23:25 +0200
commit96a04b532c275e2b6b386008074bfd9bdd220a95 (patch)
treee8ff3d5e6015a4ce6362fded0fa069e17d40706b /support-files
parentf00356905d5360735309189b3a4a03dedba47781 (diff)
downloadmariadb-git-96a04b532c275e2b6b386008074bfd9bdd220a95.tar.gz
Dynamic distribution support.
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mysql.spec.sh77
1 files changed, 39 insertions, 38 deletions
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index d0df8389b76..ab866628182 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -118,45 +118,46 @@
# ----------------------------------------------------------------------------
# Distribution support
# ----------------------------------------------------------------------------
-#
-%if "%{distribution}" == "rhel4"
-%define distro_description Red Hat Enterprise Linux 4
-%define distro_releasetag rhel4
-%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
-%define distro_requires chkconfig coreutils grep procps shadow-utils
-%endif
-%if "%{distribution}" == "rhel5"
-%define distro_description Red Hat Enterprise Linux 5
-%define distro_releasetag rhel5
-%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
-%define distro_requires chkconfig coreutils grep procps shadow-utils
-%endif
-%if "%{distribution}" == "sles10"
-%define distro_description SUSE Linux Enterprise Server 10
-%define distro_releasetag sles10
-%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
-%endif
-%if "%{distribution}" == "sles11"
-%define distro_description SUSE Linux Enterprise Server 11
-%define distro_releasetag sles11
-%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
+%if %{undefined distro_specific}
+%define distro_specific 0
%endif
-%if "%{distribution}" == "glibc23"
-%define distro_description Generic Linux (glibc version 2.3)
-%define distro_releasetag glibc23
-%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
-%define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
-%endif
-#
-# Untested default if distribution is unspecified or not supported
-#
-%if %{undefined distro_description}
-%define distro_description Generic Linux
-# leave distro_releasetag empty
-%define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
-%define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
+%if %{distro_specific}
+ %if %(test -f /etc/redhat-release && echo 1 || echo 0)
+ %define redhatver %(rpm -qf --qf '%%{version}' /etc/redhat-release | sed -e 's/Server//g')
+ %if %redhatver == 4
+ %define distro_description Red Hat Enterprise Linux 4
+ %define distro_releasetag rhel4
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %elseif %redhatver == 5
+ %define distro_description Red Hat Enterprise Linux 5
+ %define distro_releasetag rhel5
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %endif
+ %elseif %(test -f /etc/SuSE-release && echo 1 || echo 0)
+ %define susever %(rpm -qf --qf '%%{version}' /etc/SuSE-release)
+ %if %susever == 10
+ %define distro_description SUSE Linux Enterprise Server 10
+ %define distro_releasetag sles10
+ %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
+ %elseif %susever == 11
+ %define distro_description SUSE Linux Enterprise Server 11
+ %define distro_releasetag sles11
+ %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
+ %endif
+ %endif
+ %if %{undefined distro_description}
+ %{error:Unsupported distribution}
+ %endif
+%else
+ %define generic_kernel %(uname -r | cut -d\. -f1-2)
+ %define distro_description Generic Linux %{generic_kernel}
+ %define distro_releasetag linux%{generic_kernel}
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
%endif
# ----------------------------------------------------------------------------