Commit 507621ce authored by Jonathan Perkin's avatar Jonathan Perkin

Differentiate between Oracle Enterprise Linux and Red Hat Enterprise Linux.

parent 0ac4bc17
...@@ -121,21 +121,39 @@ ...@@ -121,21 +121,39 @@
%define distro_specific 0 %define distro_specific 0
%endif %endif
%if %{distro_specific} %if %{distro_specific}
%if %(test -f /etc/redhat-release && echo 1 || echo 0) %if %(test -f /etc/enterprise-release && echo 1 || echo 0)
%define elver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') %define elver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%elver" == "4" %if "%elver" == "4"
%define distro_description Enterprise Linux 4 %define distro_description Oracle Enterprise Linux 4
%define distro_releasetag el4 %define distro_releasetag el4
%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 "%elver" == "5" %if "%elver" == "5"
%define distro_description Enterprise Linux 5 %define distro_description Oracle Enterprise Linux 5
%define distro_releasetag el5 %define distro_releasetag el5
%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
%{error:Enterprise Linux %{elver} is unsupported} %{error:Oracle Enterprise Linux %{elver} is unsupported}
%endif
%endif
%else
%if %(test -f /etc/redhat-release && echo 1 || echo 0)
%define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
%if "%rhelver" == "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
%else
%if "%rhelver" == "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
%else
%{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
%endif %endif
%endif %endif
%else %else
...@@ -160,6 +178,7 @@ ...@@ -160,6 +178,7 @@
%{error:Unsupported distribution} %{error:Unsupported distribution}
%endif %endif
%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})
......
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