jcpunk / rpms / centos-release

Forked from rpms/centos-release 5 years ago
Clone

Blame SPECS/centos-release.spec

f85a5f
%define debug_package %{nil}
f85a5f
%define product_family CentOS Linux
f85a5f
%define variant_titlecase Server
f85a5f
%define variant_lowercase server
9c58df
%ifarch %{ix86}
9c58df
%define targetdir x86_64
f85a5f
%else
9c58df
%define targetdir %{_target_cpu}
f85a5f
%endif
9c58df
%ifarch %{arm}
9c58df
%define release_name AltArch
9c58df
%else
9c58df
%define release_name Core
f85a5f
%endif
f85a5f
%ifarch ppc64le
f85a5f
%define tuned_profile :server
f85a5f
%endif
f85a5f
%define base_release_version 8
f85a5f
%define full_release_version 8
f85a5f
%define dist_release_version 8
f85a5f
%define upstream_rel_long 8.0-0
f85a5f
%define upstream_rel 8.0
f85a5f
%define centos_rel 0.1905
f85a5f
#define beta Beta
9c58df
%define dist .el%{dist_release_version}
f85a5f
f85a5f
Name:           centos-release
f85a5f
Version:        %{base_release_version}
Pablo Greco ec1615
Release:        %{centos_rel}.0.4%{?dist}
f85a5f
Summary:        %{product_family} release file
f85a5f
Group:          System Environment/Base
f85a5f
License:        GPLv2
f85a5f
Requires(post): coreutils, grep
Pablo Greco ec1615
%ifnarch %{arm}
Pablo Greco ec1615
%define pkg_name %{name}
Pablo Greco ec1615
%else
f85a5f
Requires:       extlinux-bootloader
Pablo Greco ec1615
%define pkg_name centos-userland-release
Pablo Greco ec1615
%package -n %{pkg_name}
Pablo Greco ec1615
Summary:        %{product_family} release file
f85a5f
%endif
f85a5f
Provides:       centos-release = %{version}-%{release}
f85a5f
Provides:       centos-release(upstream) = %{upstream_rel}
f85a5f
Provides:       redhat-release = %{upstream_rel_long}
f85a5f
Provides:       system-release = %{upstream_rel_long}
f85a5f
Provides:       system-release(releasever) = %{base_release_version}
f85a5f
f85a5f
Provides:       centos-release-eula
f85a5f
Provides:       redhat-release-eula
f85a5f
f85a5f
Source0:        centos-release-%{base_release_version}-%{centos_rel}.tar.gz
f85a5f
Source1:        85-display-manager.preset
f85a5f
Source2:        90-default.preset
f85a5f
Source3:        99-default-disable.preset
f85a5f
f85a5f
Source99:       update-boot
f85a5f
Source100:      rootfs-expand
f85a5f
Pablo Greco ec1615
%ifarch %{arm}
Pablo Greco ec1615
%description -n %{pkg_name}
Pablo Greco ec1615
%{product_family} release files
Pablo Greco ec1615
%endif
Pablo Greco ec1615
f85a5f
%description
f85a5f
%{product_family} release files
f85a5f
f85a5f
%prep
f85a5f
%setup -q -n centos-release-%{base_release_version}
f85a5f
f85a5f
%build
f85a5f
echo OK
f85a5f
f85a5f
%install
f85a5f
rm -rf %{buildroot}
f85a5f
f85a5f
# create /etc
f85a5f
mkdir -p %{buildroot}/etc
f85a5f
f85a5f
# create /etc/system-release and /etc/redhat-release
f85a5f
echo "%{product_family} release %{full_release_version}.%{centos_rel} (%{release_name}) " > %{buildroot}/etc/centos-release
f85a5f
echo "Derived from Red Hat Enterprise Linux %{upstream_rel} (Source)" > %{buildroot}/etc/centos-release-upstream
f85a5f
ln -s centos-release %{buildroot}/etc/system-release
f85a5f
ln -s centos-release %{buildroot}/etc/redhat-release
f85a5f
f85a5f
# create /etc/os-release
f85a5f
cat << EOF >>%{buildroot}/etc/os-release
f85a5f
NAME="%{product_family}"
f85a5f
VERSION="%{full_release_version} (%{release_name})"
f85a5f
ID="centos"
f85a5f
ID_LIKE="rhel fedora"
f85a5f
VERSION_ID="%{full_release_version}"
f85a5f
PRETTY_NAME="%{product_family} %{full_release_version} (%{release_name})"
f85a5f
ANSI_COLOR="0;31"
f85a5f
CPE_NAME="cpe:/o:centos:centos:8%{?tuned_profile}"
f85a5f
HOME_URL="https://www.centos.org/"
f85a5f
BUG_REPORT_URL="https://bugs.centos.org/"
f85a5f
f85a5f
CENTOS_MANTISBT_PROJECT="CentOS-8"
f85a5f
CENTOS_MANTISBT_PROJECT_VERSION="8"
f85a5f
REDHAT_SUPPORT_PRODUCT="centos"
f85a5f
REDHAT_SUPPORT_PRODUCT_VERSION="8"
f85a5f
f85a5f
EOF
f85a5f
# write cpe to /etc/system/release-cpe
f85a5f
echo "cpe:/o:centos:centos:8" > %{buildroot}/etc/system-release-cpe
f85a5f
f85a5f
# create /etc/issue and /etc/issue.net
f85a5f
echo '\S' > %{buildroot}/etc/issue
f85a5f
echo 'Kernel \r on an \m' >> %{buildroot}/etc/issue
f85a5f
cp %{buildroot}/etc/issue %{buildroot}/etc/issue.net
f85a5f
echo >> %{buildroot}/etc/issue
f85a5f
f85a5f
pushd %{targetdir}
f85a5f
# copy GPG keys
f85a5f
mkdir -p -m 755 %{buildroot}/etc/pki/rpm-gpg
f85a5f
for file in RPM-GPG-KEY* ; do
f85a5f
    install -m 644 $file %{buildroot}/etc/pki/rpm-gpg
f85a5f
done
f85a5f
f85a5f
# copy yum repos
f85a5f
mkdir -p -m 755 %{buildroot}/etc/yum.repos.d
f85a5f
for file in CentOS-*.repo; do 
f85a5f
    install -m 644 $file %{buildroot}/etc/yum.repos.d
f85a5f
done
f85a5f
f85a5f
mkdir -p -m 755 %{buildroot}/etc/yum/vars
f85a5f
install -m 0644 yum-vars-infra %{buildroot}/etc/yum/vars/infra
f85a5f
%ifarch %{arm}
f85a5f
install -m 0644 yum-vars-releasever %{buildroot}/etc/yum/vars/releasever
f85a5f
%endif
f85a5f
popd
f85a5f
f85a5f
# set up the dist tag macros
f85a5f
install -d -m 755 %{buildroot}/etc/rpm
f85a5f
cat >> %{buildroot}/etc/rpm/macros.dist << EOF
f85a5f
# dist macros.
f85a5f
f85a5f
%%centos_ver %{base_release_version}
f85a5f
%%centos %{base_release_version}
f85a5f
%%rhel %{base_release_version}
f85a5f
%%dist .el8
f85a5f
%%el%{base_release_version} 1
f85a5f
EOF
f85a5f
f85a5f
# use unbranded datadir
f85a5f
mkdir -p -m 755 %{buildroot}/%{_datadir}/centos-release
f85a5f
ln -s centos-release %{buildroot}/%{_datadir}/redhat-release
f85a5f
install -m 644 EULA %{buildroot}/%{_datadir}/centos-release
f85a5f
f85a5f
# use unbranded docdir
f85a5f
mkdir -p -m 755 %{buildroot}/%{_docdir}/centos-release
f85a5f
ln -s centos-release %{buildroot}/%{_docdir}/redhat-release
f85a5f
install -m 644 GPL %{buildroot}/%{_docdir}/centos-release
f85a5f
install -m 644 Contributors %{buildroot}/%{_docdir}/centos-release
f85a5f
f85a5f
# copy systemd presets
f85a5f
mkdir -p %{buildroot}/%{_prefix}/lib/systemd/system-preset/
f85a5f
install -m 0644 %{SOURCE1} %{buildroot}/%{_prefix}/lib/systemd/system-preset/
f85a5f
install -m 0644 %{SOURCE2} %{buildroot}/%{_prefix}/lib/systemd/system-preset/
f85a5f
install -m 0644 %{SOURCE3} %{buildroot}/%{_prefix}/lib/systemd/system-preset/
f85a5f
f85a5f
%ifarch %{arm}
f85a5f
# Install armhfp specific tools
f85a5f
mkdir -p %{buildroot}/%{_bindir}/
f85a5f
install -m 0755 %{SOURCE99} %{buildroot}%{_bindir}/
f85a5f
install -m 0755 %{SOURCE100} %{buildroot}%{_bindir}/
f85a5f
%endif
f85a5f
Pablo Greco ec1615
%posttrans -n %{pkg_name}
f85a5f
%ifarch %{arm}
f85a5f
if [ -e /usr/local/bin/rootfs-expand ];then
f85a5f
rm -f /usr/local/bin/rootfs-expand
f85a5f
fi
f85a5f
echo 'altarch' >/etc/yum/vars/contentdir
f85a5f
%else
f85a5f
echo 'centos' > /etc/yum/vars/contentdir
f85a5f
%endif
f85a5f
f85a5f
f85a5f
%clean
f85a5f
rm -rf %{buildroot}
f85a5f
Pablo Greco ec1615
%files -n %{pkg_name}
f85a5f
%defattr(0644,root,root,0755)
f85a5f
/etc/redhat-release
f85a5f
/etc/system-release
f85a5f
/etc/centos-release
f85a5f
/etc/centos-release-upstream
f85a5f
%config(noreplace) /etc/os-release
f85a5f
%config /etc/system-release-cpe
f85a5f
%config(noreplace) /etc/issue
f85a5f
%config(noreplace) /etc/issue.net
f85a5f
/etc/pki/rpm-gpg/
f85a5f
%config(noreplace) /etc/yum.repos.d/*
f85a5f
%config(noreplace) /etc/yum/vars/*
f85a5f
/etc/rpm/macros.dist
f85a5f
%{_docdir}/redhat-release
f85a5f
%{_docdir}/centos-release/*
f85a5f
%{_datadir}/redhat-release
f85a5f
%{_datadir}/centos-release/*
f85a5f
%{_prefix}/lib/systemd/system-preset/*
f85a5f
%ifarch %{arm}
f85a5f
%attr(0755,root,root) %{_bindir}/update-boot
f85a5f
%attr(0755,root,root) %{_bindir}/rootfs-expand
f85a5f
%endif
f85a5f
f85a5f
%changelog
f85a5f
* Wed May  8 2019 Pablo Greco <pablo@fliagreco.com.ar> 8-0.el7
f85a5f
- Initial setup for CentOS-8
f85a5f