carlwgeorge / rpms / centos-release

Forked from rpms/centos-release 4 years ago
Clone

Blame SPECS/centos-release.spec

Karanbir Singh a5b8a1
%define debug_package %{nil}
Karanbir Singh a5b8a1
%define product_family CentOs Linux
Karanbir Singh a5b8a1
%define variant_titlecase Server
Karanbir Singh a5b8a1
%define variant_lowercase server
Karanbir Singh a5b8a1
%define release_name Final
Karanbir Singh a5b8a1
%define base_release_version 7
Karanbir Singh a5b8a1
%define full_release_version 7.0
Karanbir Singh a5b8a1
%define dist_release_version 7
Karanbir Singh a5b8a1
#define beta Beta
Karanbir Singh a5b8a1
%define dist .el%{dist_release_version}
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
Name:           centos-release
Karanbir Singh a5b8a1
Version:        %{base_release_version}
Karanbir Singh a5b8a1
Release:        0%{?dist}.0
Karanbir Singh a5b8a1
Summary:        %{product_family} release file
Karanbir Singh a5b8a1
Group:          System Environment/Base
Karanbir Singh a5b8a1
License:        GPLv2
Karanbir Singh a5b8a1
Provides:       centos-release = %{version}-%{release}
Karanbir Singh a5b8a1
Provides:       redhat-release = %{version}-%{release}
Karanbir Singh a5b8a1
Provides:       system-release = %{version}-%{release}
Karanbir Singh a5b8a1
Provides:       system-release(releasever) = %{base_release_version}%{?variant_titlecase}
Karanbir Singh a5b8a1
Source0:        centos-release-%{base_release_version}.tar.gz
Karanbir Singh a5b8a1
Source1:        85-display-manager.preset
Karanbir Singh a5b8a1
Source2:        90-default.preset
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%description
Karanbir Singh a5b8a1
%{product_family} release files
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%prep
Karanbir Singh a5b8a1
%setup -q -n centos-release-%{base_release_version}
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%build
Karanbir Singh a5b8a1
echo OK
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%install
Karanbir Singh a5b8a1
rm -rf %{buildroot}
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# create /etc
Karanbir Singh a5b8a1
mkdir -p %{buildroot}/etc
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# create /etc/system-release and /etc/redhat-release
Karanbir Singh a5b8a1
echo "%{product_family}%{?variant_titlecase: %{variant_titlecase}} release %{full_release_version}%{?beta: %{beta}} (%{release_name})" > %{buildroot}/etc/centos-release
Karanbir Singh a5b8a1
ln -s centos-release %{buildroot}/etc/system-release
Karanbir Singh a5b8a1
ln -s centos-release %{buildroot}/etc/redhat-release
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# create /etc/os-release
Karanbir Singh a5b8a1
cat << EOF >>%{buildroot}/etc/os-release
Karanbir Singh a5b8a1
NAME="%{product_family}%{?variant_titlecase: %{variant_titlecase}}"
Karanbir Singh a5b8a1
VERSION="%{full_release_version} (%{release_name})"
Karanbir Singh a5b8a1
ID="rhel"
Karanbir Singh a5b8a1
ID_LIKE="fedora"
Karanbir Singh a5b8a1
VERSION_ID="%{full_release_version}"
Karanbir Singh a5b8a1
PRETTY_NAME="%{product_family}%{?variant_titlecase: %{variant_titlecase}} %{full_release_version} (%{release_name})"
Karanbir Singh a5b8a1
ANSI_COLOR="0;31"
Karanbir Singh a5b8a1
CPE_NAME="cpe:/o:redhat:enterprise_linux:%{full_release_version}:%{?beta:beta}%{!?beta:GA}%{?variant_lowercase::%{variant_lowercase}}"
Karanbir Singh a5b8a1
HOME_URL="https://www.redhat.com/"
Karanbir Singh a5b8a1
BUG_REPORT_URL="https://bugzilla.redhat.com/"
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
REDHAT_BUGZILLA_PRODUCT="%{product_family} %{base_release_version}"
Karanbir Singh a5b8a1
REDHAT_BUGZILLA_PRODUCT_VERSION=%{full_release_version}
Karanbir Singh a5b8a1
REDHAT_SUPPORT_PRODUCT="%{product_family}"
Karanbir Singh a5b8a1
REDHAT_SUPPORT_PRODUCT_VERSION=%{full_release_version}
Karanbir Singh a5b8a1
EOF
Karanbir Singh a5b8a1
# write cpe to /etc/system/release-cpe
Karanbir Singh a5b8a1
echo "cpe:/o:redhat:enterprise_linux:%{full_release_version}:%{?beta:beta}%{!?beta:GA}%{?variant_lowercase::%{variant_lowercase}}" | tr [A-Z] [a-z] > %{buildroot}/etc/system-release-cpe
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# create /etc/issue and /etc/issue.net
Karanbir Singh a5b8a1
echo '\S' > %{buildroot}/etc/issue
Karanbir Singh a5b8a1
echo 'Kernel \r on an \m' >> %{buildroot}/etc/issue
Karanbir Singh a5b8a1
cp %{buildroot}/etc/issue %{buildroot}/etc/issue.net
Karanbir Singh a5b8a1
echo >> %{buildroot}/etc/issue
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# copy GPG keys
Karanbir Singh a5b8a1
mkdir -p -m 755 %{buildroot}/etc/pki/rpm-gpg
Karanbir Singh a5b8a1
for file in RPM-GPG-KEY* ; do
Karanbir Singh a5b8a1
    install -m 644 $file %{buildroot}/etc/pki/rpm-gpg
Karanbir Singh a5b8a1
done
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# set up the dist tag macros
Karanbir Singh a5b8a1
install -d -m 755 %{buildroot}/etc/rpm
Karanbir Singh a5b8a1
cat >> %{buildroot}/etc/rpm/macros.dist << EOF
Karanbir Singh a5b8a1
# dist macros.
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%%centos_ver %{base_release_version}
Karanbir Singh a5b8a1
%%rhel %{base_release_version}
Karanbir Singh a5b8a1
%%dist %dist
Karanbir Singh a5b8a1
%%el%{base_release_version} 1
Karanbir Singh a5b8a1
EOF
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# use unbranded datadir
Karanbir Singh a5b8a1
mkdir -p -m 755 %{buildroot}/%{_datadir}/redhat-release
Karanbir Singh a5b8a1
install -m 644 EULA %{buildroot}/%{_datadir}/redhat-release
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# use unbranded docdir
Karanbir Singh a5b8a1
mkdir -p -m 755 %{buildroot}/%{_docdir}/redhat-release
Karanbir Singh a5b8a1
install -m 644 GPL %{buildroot}/%{_docdir}/redhat-release
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
# copy systemd presets
Karanbir Singh a5b8a1
mkdir -p %{buildroot}%{_prefix}/lib/systemd/system-preset/
Karanbir Singh a5b8a1
install -m 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/systemd/system-preset/
Karanbir Singh a5b8a1
install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/systemd/system-preset/
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%clean
Karanbir Singh a5b8a1
rm -rf %{buildroot}
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%files
Karanbir Singh a5b8a1
%defattr(0644,root,root,0755)
Karanbir Singh a5b8a1
/etc/redhat-release
Karanbir Singh a5b8a1
/etc/system-release
Karanbir Singh a5b8a1
/etc/centos-release
Karanbir Singh a5b8a1
%config(noreplace) /etc/os-release
Karanbir Singh a5b8a1
%config /etc/system-release-cpe
Karanbir Singh a5b8a1
%config(noreplace) /etc/issue
Karanbir Singh a5b8a1
%config(noreplace) /etc/issue.net
Karanbir Singh a5b8a1
/etc/pki/rpm-gpg/
Karanbir Singh a5b8a1
/etc/rpm/macros.dist
Karanbir Singh a5b8a1
%{_docdir}/redhat-release/*
Karanbir Singh a5b8a1
%{_datadir}/redhat-release/*
Karanbir Singh a5b8a1
%{_prefix}/lib/systemd/system-preset/*
Karanbir Singh a5b8a1
Karanbir Singh a5b8a1
%changelog
Karanbir Singh a5b8a1
* Fri Jun 13 2014 Karanbir Singh <kbsingh@centos.org> 7-0.el7
Karanbir Singh a5b8a1
- initial setup for centos-rc