README.html files (main README for the collection and README for

each role) will not be located in /usr/share/ansible/collections,
but just put in /usr/share/doc/linux-system-roles/collection in rpm.

The README.html files are not included in the collection artifact.

Related: rhbz#1961404
This commit is contained in:
Noriko Hosoi 2021-04-16 11:46:15 -07:00
parent 031963c284
commit 37a0a35ee7

View File

@ -163,7 +163,7 @@ BuildRequires: ansible >= 2.9.10
%defcommit 17 779bb78559de58bb5a1f25a4b92039c373ef59a4
%global rolename17 ha_cluster
%global mainid 8f069305caa0a142c2c6ac14bd4d331282a1c079
%global mainid e9e30b03c0fe9387cb0ea8a5e7aac8313de2deef
Source: %{url}auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
Source1: %{archiveurl1}
Source2: %{archiveurl2}
@ -392,6 +392,8 @@ cp -p galaxy.yml lsr_role2collection/.ansible-lint \
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
%ansible_collection_build
# converting README.md to README.html
sh ../../../../md2html.sh -l \
README.md \
@ -412,8 +414,26 @@ sh ../../../../md2html.sh -l \
roles/%{rolename15}/README.md \
roles/%{rolename16}/README.md \
roles/%{rolename17}/README.md
%ansible_collection_build
tar -cf - README.html \
roles/%{rolename1}/README.html \
roles/%{rolename2}/README.html \
roles/%{rolename3}/README.html \
roles/%{rolename4}/README.html \
roles/%{rolename5}/README.html \
roles/%{rolename6}/README.html \
roles/%{rolename7}/README.html \
roles/%{rolename8}/README.html \
roles/%{rolename9}/README.html \
roles/%{rolename10}/README.html \
roles/%{rolename11}/README.html \
roles/%{rolename12}/README.html \
roles/%{rolename13}/README.html \
roles/%{rolename14}/README.html \
roles/%{rolename15}/README.html \
roles/%{rolename16}/README.html \
roles/%{rolename17}/README.html | \
(cd ../../../..; tar -xf -)
popd
%install
@ -653,14 +673,13 @@ mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles
cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/README.md \
%{buildroot}%{ansible_collection_files}%{collection_name}/README.html \
$RPM_BUILD_ROOT%{_pkgdocdir}/collection
../../../../README.html $RPM_BUILD_ROOT%{_pkgdocdir}/collection
for rolename in %{rolenames}; do
if [ -f %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/README.md ]; then
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${rolename}
cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/README.md \
%{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/README.html \
../../../../roles/%{rolename1}/README.html \
$RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${rolename}
fi
done
@ -668,8 +687,8 @@ done
%if %{with collection_artifact}
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
if [ -f %{collection_namespace}-%{collection_name}-%{version}.tar.gz ]; then
mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
$RPM_BUILD_ROOT%{_datadir}/ansible/collections/
mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
$RPM_BUILD_ROOT%{_datadir}/ansible/collections/
fi
%endif
popd
@ -744,10 +763,6 @@ popd
%doc %{ansible_collection_files}/%{collection_name}/roles/sshd/README.md
%doc %{ansible_collection_files}/%{collection_name}/roles/ssh/README.md
%doc %{ansible_collection_files}/%{collection_name}/roles/ha_cluster/README.md
# can't use a glob for .md files, only for .html. .md files include READMEs
# for private subroles, and we don;t want to tag those as docs.
%doc %{ansible_collection_files}/%{collection_name}/README.html
%doc %{ansible_collection_files}/%{collection_name}/roles/*/README.html
%license %{_pkglicensedir}/*
%license %{installbase}/%{roleinstprefix}kdump/COPYING
@ -782,6 +797,10 @@ popd
- Adding the -collection-artifact subpackage, enabled using
"--with collection_artifact". It is used for importing to
ansible galaxy/automation hub.
- README.html files (main README for the collection and README
for each role) are not located in /usr/share/ansible/collections,
but just put in /usr/share/doc/linux-system-roles/collection in rpm.
- The README.html files are not included in the collection artifact.
* Tue Apr 6 2021 Pavel Cahyna <pcahyna@redhat.com> - 1.0.1-1
- Sync with RHEL version 1.0.1-1.el8