diff --git a/SPECS/powerel-release.spec b/SPECS/powerel-release.spec index 679e9061..7d1b2193 100644 --- a/SPECS/powerel-release.spec +++ b/SPECS/powerel-release.spec @@ -1,6 +1,6 @@ Name: powerel-release Version: 7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: PowerEL release file Group: System Environment/Base License: GPLv2 @@ -26,9 +26,21 @@ Obsoletes: whitebox-release Obsoletes: oracle-release Obsoletes: sl-release Obsoletes: centos-release -Source0: %{name}-%{version}.tar.gz +#Source0: %{name}-%{version}.tar.gz Source1: 85-display-manager.preset Source2: 90-default.preset +#NoSource: 0 + + +%ifarch ppc64 +%define cputype power8 +%endif +%ifarch ppc64le +%define cputype power8 +%endif +%ifarch x86_64 +%define cputype intelavx +%endif %description @@ -36,18 +48,22 @@ PowerEL release and information files %prep -%setup -q -n %{name}-%{version} +%setup -q -T -c %{name}-%{version} +git clone git.powerel.org:powerel/powerel-release-7 . %build echo OK + %install rm -rf %{buildroot} mkdir -p %{buildroot}/etc echo "PowerEL release %{version}" > %{buildroot}/etc/%{name} ln -s %{name} %{buildroot}/etc/system-release +ln -s %{name} %{buildroot}/etc/redhat-release +ln -s %{name} %{buildroot}/etc/centos-release # create /etc/os-release cat << EOF >>%{buildroot}/etc/os-release NAME="PowerEL" @@ -57,13 +73,13 @@ ID_LIKE="rhel fedora" VERSION_ID="%{version}" PRETTY_NAME="PowerEL %{version}" ANSI_COLOR="0;33" -CPE_NAME="cpe:/o:powerel:powerel:7:ppcbe" +CPE_NAME="cpe:/o:powerel:powerel:7:%{cputype}-%{_arch}" HOME_URL="https://www.powerel.org/" BUG_REPORT_URL="https://bugzilla.powerel.org/" -POWEREL_BUGZILLA_PRODUCT="PowerEL %{version} %{arch}" +POWEREL_BUGZILLA_PRODUCT="PowerEL %{version} %{cputype} %{_arch}" POWEREL_BUGZILLA_PRODUCT_VERSION=%{version} -POWEREL_SUPPORT_PRODUCT="PowerEL %{version} %{arch}" +POWEREL_SUPPORT_PRODUCT="PowerEL %{version} %{cputype} %{_arch}" POWEREL_SUPPORT_PRODUCT_VERSION="%{version}" EOF @@ -82,6 +98,8 @@ done # copy yum repos mkdir -p -m 755 %{buildroot}/etc/yum.repos.d for file in PowerEL-*.repo; do + sed "s/@CPUTYPE@/%{cputype}/" -i $file + sed "s/\$basearch/%{_arch}/" -i $file install -m 644 $file %{buildroot}/etc/yum.repos.d done # set up the dist tag macros @@ -121,6 +139,8 @@ rm -rf %{buildroot} %defattr(0644,root,root,0755) /etc/powerel-release /etc/system-release +/etc/redhat-release +/etc/centos-release %config /etc/system-release-cpe %config(noreplace) /etc/os-release %config(noreplace) /etc/issue