%global package_name_prefix fedora %if 0%{?rhel} %global package_name_prefix rhel %endif %if 0%{?centos} %global package_name_prefix centos %endif Name: distro-swidtag Version: 0.1.1 Release: 4%{?dist} Summary: SWID Tag file for the distribution Group: System Environment/Base License: MIT URL: file:///dev/null Source0: distro-swidtag.xslt Source1: fedora-swidtag.xml Source2: rhel-swidtag.xml Source3: centos-swidtag.xml Source9: get-tagid.xslt BuildRequires: libxslt %description This package provides .swidtag file for the distribution. %if 0%{?fedora} %package -n fedora-swidtag Summary: SWID Tag file for the distribution %description -n fedora-swidtag This package provides .swidtag file for the distribution. %endif %if 0%{?rhel}%{?centos} %package -n rhel-swidtag Summary: SWID Tag file for the distribution %description -n rhel-swidtag This package provides .swidtag file for the distribution. %package -n centos-swidtag Summary: SWID Tag file for the distribution %description -n centos-swidtag This package provides .swidtag file for the distribution. %endif %prep rm -rf %{name}-%{version} mkdir %{name}-%{version} %build cd %{name}-%{version} %if 0%{?fedora} xsltproc --stringparam version %{fedora} \ --stringparam arch %{_arch} \ %{SOURCE0} %SOURCE1 > out.swidtag mkdir -p $( dirname $( xsltproc %{SOURCE9} out.swidtag ) ) mv out.swidtag $( xsltproc %{SOURCE9} out.swidtag ).swidtag %endif %if 0%{?centos} for i in %{SOURCE2} %{SOURCE3} ; do xsltproc --stringparam version %{centos} \ --stringparam arch %{_arch} \ %{SOURCE0} $i > out.swidtag mkdir -p $( dirname $( xsltproc %{SOURCE9} out.swidtag ) ) mv out.swidtag $( xsltproc %{SOURCE9} out.swidtag ).swidtag done %else %if 0%{?rhel} xsltproc --stringparam version %{rhel} \ --stringparam arch %{_arch} \ %{SOURCE0} %SOURCE2 > out.swidtag mkdir -p $( dirname $( xsltproc %{SOURCE9} out.swidtag ) ) mv out.swidtag $( xsltproc %{SOURCE9} out.swidtag ).swidtag %endif %endif %install cd %{name}-%{version} ls -la for i in * ; do install -d %{buildroot}%{_datadir}/$i install -m 644 -t %{buildroot}%{_datadir}/$i $i/* done %if 0%{?fedora} %files -n fedora-swidtag %{_datadir}/*/*.swidtag %endif %if 0%{?rhel}%{?centos} %files -n rhel-swidtag %{_datadir}/*/*RHEL*.swidtag %endif %if 0%{?centos} %files -n centos-swidtag %{_datadir}/*/*CentOS*.swidtag %endif %changelog * Tue Jul 17 2018 Jan Pazdziora - 0.1.1-4 - Various improvements to the SWID Tag content. * Mon Jun 25 2018 Jan Pazdziora - 0.1.1-3 - Add elements for XML signing to input, do not process it yet. * Tue Jun 05 2018 Jan Pazdziora - 0.1.1-2 - Addressed ERROR PRI-13-4: The @revision attribute was not provided. * Tue Jun 05 2018 Jan Pazdziora - 0.1.1-1 - Initial packaging of distribution .swidtag files.