#7 Add SWID tag for the CentOS Linux distribution.
Opened 4 years ago by adelton. Modified 4 years ago
rpms/ adelton/centos-release swid  into  c8

@@ -0,0 +1,25 @@ 

+ <?xml version="1.0" encoding="utf-8"?>

+ <SoftwareIdentity

+   xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"

+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+   xsi:schemaLocation="http://standards.iso.org/iso/19770/-2/2015/schema.xsd http://standards.iso.org/iso/19770/-2/2015-current/schema.xsd"

+   xml:lang="en-US"

+   tagId="org.centos.CentOS-Linux-$revision-$arch"

+   tagVersion="1"

+   supplemental="true"

+   name="CentOS Linux"

+   version="8"

+   versionScheme="multipartnumeric">

+   <Entity

+     name="CentOS Project"

+     regid="centos.org"

+     role="tagCreator" />

+   <Link

+     rel="supplemental"

+     href="swid:org.centos.CentOS-Linux-8" />

+   <Meta

+     product="CentOS Linux"

+     colloquialVersion="8"

+     revision="$revision"

+     arch="$arch" />

+ </SoftwareIdentity>

@@ -0,0 +1,26 @@ 

+ <?xml version="1.0" encoding="utf-8"?>

+ <SoftwareIdentity

+   xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"

+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+   xsi:schemaLocation="http://standards.iso.org/iso/19770/-2/2015/schema.xsd http://standards.iso.org/iso/19770/-2/2015-current/schema.xsd"

+   xml:lang="en-US"

+   tagId="org.centos.CentOS-Linux-8"

+   tagVersion="1"

+   name="CentOS Linux"

+   version="8"

+   versionScheme="multipartnumeric">

+   <Entity

+     name="CentOS Project"

+     regid="centos.org"

+     role="tagCreator softwareCreator aggregator distributor licensor" />

+   <Meta

+     product="CentOS Linux"

+     colloquialVersion="8"

+     summary="Linux distribution that provides a free, community-supported computing platform functionally compatible with its upstream source, Red Hat Enterprise Linux"

+     entitlementDataRequired="false"

+     unspscCode="43233004"

+     unspscVersion="20.0601" />

+   <Link

+     rel="license"

+     href="http://mirror.centos.org/centos/8/BaseOS/x86_64/os/EULA" />

+ </SoftwareIdentity>

file modified
+18 -1
@@ -21,13 +21,14 @@ 

  %define centos_rel 1.1911

  #define beta Beta

  %define dist .el%{dist_release_version}

+ %{!?_swidtagdir: %define _swidtagdir %{_prefix}/lib/swidtag/centos.org}

  

  # The anaconda scripts in %%{_libexecdir} can create false requirements

  %global __requires_exclude_from %{_libexecdir}

  

  Name:           centos-release

  Version:        %{upstream_rel}

- Release:        %{centos_rel}.0.8%{?dist}

+ Release:        %{centos_rel}.0.9%{?dist}

  Summary:        %{product_family} release file

  Group:          System Environment/Base

  License:        GPLv2
@@ -78,6 +79,9 @@ 

  Source310:      CentOS-centosplus.repo

  Source311:      CentOS-HA.repo

  

+ Source400:      CentOS-Linux-%{base_release_version}.swidtag

+ Source401:      CentOS-Linux-%{base_release_version}-minor-arch.swidtag

+ 

  %ifarch %{arm}

  %description -n %{pkg_name}

  %{product_family} release files
@@ -216,6 +220,14 @@ 

  install -m 0755 %{SOURCE100} %{buildroot}%{_bindir}/

  %endif

  

+ # install distro-level SWID tag file

+ install -d %{buildroot}%{_swidtagdir}

+ install -m 644 %{SOURCE400} %{buildroot}%{_swidtagdir}/org.centos.CentOS-Linux-%{base_release_version}.swidtag

+ # create supplemental SWID tag for minor release

+ sed -e 's#\$revision#%{base_release_version}.%{centos_rel}#g' -e 's#\$arch#%{_arch}#g' %{SOURCE401} > %{buildroot}%{_swidtagdir}/org.centos.CentOS-Linux-%{base_release_version}.%{centos_rel}-%{_arch}.swidtag

+ # enable SWID tag lookup

+ install -d %{buildroot}%{_sysconfdir}/swid/swidtags.d

+ ln -s %{_swidtagdir} %{buildroot}%{_sysconfdir}/swid/swidtags.d/centos.org

  

  %clean

  rm -rf %{buildroot}
@@ -240,6 +252,8 @@ 

  %attr(0755,root,root) %{_bindir}/update-boot

  %attr(0755,root,root) %{_bindir}/rootfs-expand

  %endif

+ %{_sysconfdir}/swid

+ %{_swidtagdir}

  

  %files -n centos-repos

  %config(noreplace) /etc/yum.repos.d/*
@@ -249,6 +263,9 @@ 

  /etc/pki/rpm-gpg/

  

  %changelog

+ * Tue Jan 21 2020 Jan Pazdziora <jpazdziora@redhat.com> - 8-1.0.9

+ - Add SWID tag for the CentOS Linux distribution.

+ 

  * Thu Jan 02 2020 Brian Stinson <bstinson@centosproject.org> - 8-1.0.8

  - Add base module platform Provides so DNF can auto-discover modular platform (ngompa)pr#6

  - Switched CR repo to mirrorlist to spread the load (arrfab)pr#5

no initial comment

@bstinson, who would be the best person to ask for review of this pull request?

Changes to centos-release are fairly slow, but I'll put some time into a full review shortly.

Is there a better way we could handle the tags for CentOS Stream as well? Currently centos-release-stream is in a separate package: https://git.centos.org/rpms/centos-release-stream

Thanks.

As for CentOS Stream, looking at http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/ both centos-release-8.1-1.1911.0.7.el8.x86_64.rpm and centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm are shipped. I see the .spec file does

Requires:       centos-release >= %{version}-%{release}

so they are expected to be installed at the same time. If that's the case, we could do the CentOS Stream SWID tag as a supplemental SWID tag to the CentOS one which would just amend Edition, similar to what we do in https://src.fedoraproject.org/rpms/fedora-release/blob/master/f/distro-edition-template.swidtag.

On the other hand, if CentOS Stream is a separate software product, it would need its own primary tag and we would need some mechanism to properly override the base CentOS SWID tag. How is CentOS Stream expected to be treated from the software / product identity point of view?

Hello @bstinson, any chance of getting the proposed change reviewed?