| |
@@ -11,14 +11,6 @@
|
| |
|
| |
%bcond_with collection_artifact
|
| |
|
| |
- %if 0%{?fedora} || 0%{?rhel} >= 8
|
| |
- %bcond_without html
|
| |
- %else
|
| |
- # pandoc is not supported in rhel 7 and older,
|
| |
- # which is needed for converting .md to .html.
|
| |
- %bcond_with html
|
| |
- %endif
|
| |
-
|
| |
%if 0%{?rhel}
|
| |
Name: rhel-system-roles
|
| |
%else
|
| |
@@ -27,7 +19,7 @@
|
| |
Url: https://github.com/linux-system-roles
|
| |
Summary: Set of interfaces for unified system management
|
| |
Version: 1.54.0
|
| |
- Release: 1%{?dist}
|
| |
+ Release: 2%{?dist}
|
| |
|
| |
License: GPLv3+ and MIT and BSD and Python
|
| |
%global _pkglicensedir %{_licensedir}/%{name}
|
| |
@@ -86,7 +78,7 @@
|
| |
%%global rolestodir %%{?rolestodir} %%{roletodir%{1}}
|
| |
}
|
| |
|
| |
- %global mainid 5fa4921e5761565890f69f8f9bab2ef2cbc5bb8f
|
| |
+ %global mainid eadd06cfa98d244b096cff24cd11b668428b1613
|
| |
Source: %{url}/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
|
| |
|
| |
# BEGIN AUTOGENERATED SOURCES
|
| |
@@ -219,17 +211,6 @@
|
| |
|
| |
BuildArch: noarch
|
| |
|
| |
- %if %{with html}
|
| |
- # Requirements for md2html.sh to build the documentation
|
| |
- %if 0%{?fedora} || 0%{?rhel} >= 9
|
| |
- BuildRequires: rubygem-kramdown-parser-gfm
|
| |
- %else
|
| |
- BuildRequires: pandoc
|
| |
- BuildRequires: asciidoc
|
| |
- BuildRequires: highlight
|
| |
- %endif
|
| |
- %endif
|
| |
-
|
| |
# Requirements for galaxy_transform.py
|
| |
BuildRequires: python3
|
| |
BuildRequires: python%{python3_pkgversion}-ruamel-yaml
|
| |
@@ -295,6 +276,8 @@
|
| |
fi
|
| |
fi
|
| |
mv "$dir_from_archive" ${rolename}
|
| |
+ # Move a hidden .README.html to a not hidden README.html
|
| |
+ mv $rolename/.README.html $rolename/README.html
|
| |
done
|
| |
|
| |
%if 0%{?rhel}
|
| |
@@ -312,7 +295,7 @@
|
| |
-e "s/ansible-sshd/linux-system-roles.sshd/" \
|
| |
-e "s/ willshersystems.sshd/ linux-system-roles.sshd/" "$file"
|
| |
done
|
| |
- sed -r -i -e "s/ willshersystems.sshd/ linux-system-roles.sshd/" README.md
|
| |
+ sed -r -i -e "s/ willshersystems.sshd/ linux-system-roles.sshd/" README.md README.html
|
| |
sed -r -i -e 's/min_ansible_version: 2.8/min_ansible_version: "2.9"/' meta/main.yml
|
| |
cd ..
|
| |
|
| |
@@ -363,29 +346,43 @@
|
| |
# remove upstream-only documentation - for example, documentation
|
| |
# about collection dependencies is not needed in Fedora and EL RPMs
|
| |
# since the dependencies are already provided
|
| |
- sed -e '/^## Requirements/,/^#/s/^See below$/None/' \
|
| |
- -e '/^### Collection requirements/,/^#/ {/^### Collection/d;/^#/!d}' \
|
| |
+ sed -e '/# Requirements/,/^#/s/^See below$/None/' \
|
| |
+ -e '/# Collection requirements/,/^#/ {/# Collection requirements/d;/^#/!d}' \
|
| |
-i */README.md
|
| |
+ sed -e '/id="requirements">Requirements<\/h/,/^<h/s/See below/None/' \
|
| |
+ -e '/id="collection-requirements">/,/^<h/ {/id="collection-requirements">/d;/^<h/!d}' \
|
| |
+ -i */README.html
|
| |
+
|
| |
+ for role in %{rolenames}; do
|
| |
+ # awk: Remove collection-requirements from README.html TOC
|
| |
+ # 1. If match found, add the line and -2,+1 lines' line number in an array "d".
|
| |
+ # 2. Save all lines in an array with line number as index
|
| |
+ # 3. Print only those index not in array "d"
|
| |
+ awk '/id="toc-collection-requirements">/{for(x=NR-2;x<=NR+1;x++)d[x];} \
|
| |
+ {a[NR]=$0} \
|
| |
+ END{for(i=1;i<=NR;i++)if(!(i in d))print a[i]}' \
|
| |
+ $role/README.html > $role/README.html.tmp
|
| |
+ mv $role/README.html.tmp $role/README.html
|
| |
+ done
|
| |
+
|
| |
# sshd README is not in the same format
|
| |
- sed -e '/^### Optional requirements/,/^Role variables/ {/^### Optional/d;/^Role variables/!d}' \
|
| |
+ sed -e '/# Optional requirements/,/# Role variables/ {/# Optional/d;/# Role variables/!d}' \
|
| |
-i sshd/README.md
|
| |
+ sed -e '/id="optional-requirements">/,/^<h/ {/id="optional-requirements">/d;/^<h/!d}' \
|
| |
+ -i sshd/README.html
|
| |
+ # Remove optional-requirements from README.html TOC
|
| |
+ awk '/id="toc-optional-requirements">/{for(x=NR-2;x<=NR+1;x++)d[x];} \
|
| |
+ {a[NR]=$0} \
|
| |
+ END{for(i=1;i<=NR;i++)if(!(i in d))print a[i]}' \
|
| |
+ sshd/README.html > sshd/README.html.tml
|
| |
+ mv sshd/README.html.tml sshd/README.html
|
| |
|
| |
-
|
| |
- %if %{with html}
|
| |
- # HACK HACK HACK
|
| |
- # pandoc/asciidoc on rhel 8.9 does not like the journald README badge links
|
| |
- # remove all of the badge links from all README.md files
|
| |
- # in the first 14 lines of the file, remove any line that looks like a
|
| |
- # github action badge
|
| |
- # HACK HACK HACK
|
| |
- readmes=""
|
| |
matchstr="actions/workflows/"
|
| |
for role in %{rolenames}; do
|
| |
+ # in the first 14 lines of README.md, remove any line that looks like a
|
| |
+ # github action badge. README.html doesn't have these lines.
|
| |
sed -e "1,14 {\\,${matchstr},d; /\!\[/d}" -i $role/README.md
|
| |
- readmes="${readmes} $role/README.md"
|
| |
done
|
| |
- sh md2html.sh $readmes
|
| |
- %endif
|
| |
|
| |
mkdir .collections
|
| |
%if 0%{?rhel}
|
| |
@@ -396,7 +393,7 @@
|
| |
"https://linux-system-roles.github.io" \
|
| |
"https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/administration_and_configuration_tasks_using_system_roles_in_rhel" \
|
| |
"https://access.redhat.com/articles/3050101" \
|
| |
- "https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=rhel-system-roles" \
|
| |
+ "https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12332745&summary=Your%20request%20summary&issuetype=1&priority=10200&labels=Partner-Feature-Request&components=12380283" \
|
| |
> galaxy.yml.tmp
|
| |
# we vendor-in all of the dependencies on rhel, so remove them
|
| |
rm -f lsr_role2collection/collection_requirements.txt
|
| |
@@ -428,13 +425,6 @@
|
| |
--src-path $(pwd) --dest-path $(pwd)/.collections $includes --force --no-update \
|
| |
--src-owner %{name} --skip-git --skip-check --skip-changelog $extra_mapping --debug
|
| |
|
| |
- # Remove table of contents from logging README.md
|
| |
- # It is not needed for html and AH/Galaxy
|
| |
- sed -i -e 's/^\(## Table of Contents\)/## Background\n\1/' \
|
| |
- .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/logging/README.md
|
| |
- sed -i -e '/^## Table of Contents/,/^## Background/d' \
|
| |
- .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/logging/README.md
|
| |
-
|
| |
# Remove internal links from readme files
|
| |
# They are not rendered properly on AH.
|
| |
for role in %{rolenames}; do
|
| |
@@ -483,10 +473,8 @@
|
| |
"%{buildroot}%{_pkgdocdir}/$role"
|
| |
ln -sr "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/README.md" \
|
| |
"%{buildroot}%{_pkgdocdir}/$role"
|
| |
- %if %{with html}
|
| |
ln -sr "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/README.html" \
|
| |
"%{buildroot}%{_pkgdocdir}/$role"
|
| |
- %endif
|
| |
if [ -f "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/COPYING" ]; then
|
| |
ln -sr "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/COPYING" \
|
| |
"%{buildroot}%{_pkglicensedir}/$role.COPYING"
|
| |
@@ -545,7 +533,7 @@
|
| |
%{buildroot}%{_pkgdocdir}/collection
|
| |
|
| |
for rolename in %{rolenames}; do
|
| |
- for file in CHANGELOG.md README.md; do
|
| |
+ for file in CHANGELOG.md README.md README.html; do
|
| |
if [ -f %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${rolename}/$file ]; then
|
| |
if [ ! -d %{buildroot}%{_pkgdocdir}/collection/roles/${rolename} ]; then
|
| |
mkdir -p %{buildroot}%{_pkgdocdir}/collection/roles/${rolename}
|
| |
@@ -556,15 +544,6 @@
|
| |
done
|
| |
done
|
| |
|
| |
- %if %{with html}
|
| |
- # converting README.md to README.html for collection in %%{buildroot}%%{_pkgdocdir}/collection
|
| |
- readmes="%{buildroot}%{_pkgdocdir}/collection/README.md"
|
| |
- for role in %{rolenames}; do
|
| |
- readmes="${readmes} %{buildroot}%{_pkgdocdir}/collection/roles/${role}/README.md"
|
| |
- done
|
| |
- sh md2html.sh $readmes
|
| |
- %endif
|
| |
-
|
| |
%if %{with collection_artifact}
|
| |
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
|
| |
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
|
| |
@@ -666,6 +645,9 @@
|
| |
%endif
|
| |
|
| |
%changelog
|
| |
+ * Fri Sep 15 2023 Sergei Petrosian <spetrosi@redhat.com> - 1.54.0-2
|
| |
+ - Remove with_html, instead use built-in .README.html
|
| |
+
|
| |
* Thu Sep 14 2023 Packit <hello@packit.dev> - 1.54.0-1
|
| |
- Update to upstream version 1.54.0
|
| |
|
| |
This depends on https://github.com/linux-system-roles/auto-maintenance/pull/297. Timesync and sshd doesn't have .README.html yet.