Blame SPECS/rhel-system-roles-sap.spec

623834
%if 0%{?rhel} && ! 0%{?epel}
623834
%bcond_with ansible
623834
%else
623834
%bcond_without ansible
623834
%endif
623834
623834
%bcond_with collection_artifact
623834
623834
%if 0%{?fedora} || 0%{?rhel} >= 8
623834
%bcond_without html
623834
%else
623834
# pandoc is not supported in rhel 7 and older,
623834
# which is needed for converting .md to .html.
623834
%bcond_with html
623834
%endif
623834
623834
%global collection_namespace sap
623834
%if 0%{?rhel}
623834
%define package_name rhel-system-roles-sap
623834
%global collection_name rhel
623834
%else
623834
%define package_name linux-system-roles-sap
623834
%global collection_name linux
623834
%endif
623834
46c147
# collection_version has to be increased by every rebuild
46c147
# otherwise, it cannot be uploaded to Automation Hub and Galaxy
46c147
# due to version conflict
46c147
%define collection_version 3.1.3
46c147
46c147
%global mainid 411f58b0e8da72cd69827d6ed30d8925bea5cb23
46c147
%global gitcommit_sap ba8714a7683ace6172b8b1cf787a9699fbe2b24c
46c147
%global gitcommit_sap_hana b6a188c4f29c185da7cc68704b83e0a447563496
46c147
%global gitcommit_sap_netweaver 34f6dc9421cfa6af951c9b8f2315f1b52bd75e0a
623834
%global rolename1 sap-preconfigure
623834
%global rolename2 sap-hana-preconfigure
623834
%global rolename3 sap-netweaver-preconfigure
623834
%global src_owner linux-system-roles
623834
623834
Name: %{package_name}
623834
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
623834
Version: 3.1.1
46c147
Release: 14%{?dist}
623834
License: GPLv3+
623834
Url: https://github.com/berndfinger
623834
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
623834
Source1: https://github.com/berndfinger/sap-preconfigure/archive/%{gitcommit_sap}/sap-preconfigure-%{gitcommit_sap}.tar.gz
623834
Source2: https://github.com/berndfinger/sap-hana-preconfigure/archive/%{gitcommit_sap_hana}/sap-hana-preconfigure-%{gitcommit_sap_hana}.tar.gz
623834
Source3: https://github.com/berndfinger/sap-netweaver-preconfigure/archive/%{gitcommit_sap_netweaver}/sap-netweaver-preconfigure-%{gitcommit_sap_netweaver}.tar.gz
623834
Source4: README.md
623834
Source5: galaxy.yml
623834
# patches 0-49 for sap-preconfigure
623834
# patches 50-99 for sap-hana-preconfigure
623834
Patch50: sap-hana-preconfigure-md2html-error.patch
623834
# patches 100-149 for sap-netweaver-preconfigur
623834
623834
BuildArch: noarch
623834
623834
623834
%if %{with html}
623834
# Requirements for md2html.sh to build the documentation
623834
%if 0%{?fedora} || 0%{?rhel} >= 9
623834
BuildRequires: rubygem-kramdown-parser-gfm
623834
%else
623834
BuildRequires: pandoc
623834
BuildRequires: asciidoc
623834
BuildRequires: highlight
623834
%endif
623834
%endif
623834
623834
# Requirements for galaxy_transform.py
623834
BuildRequires: python3
623834
%if 0%{?fedora} || 0%{?rhel} >= 8
623834
BuildRequires: python3dist(ruamel.yaml)
623834
Requires: python3-jmespath
623834
Requires: python3-netaddr
623834
%else
623834
BuildRequires: python3-ruamel-yaml
623834
Requires: python-jmespath
623834
Requires: python-netaddr
623834
%endif
623834
623834
%if %{with ansible}
623834
BuildRequires: ansible >= 2.9.10
623834
%endif
623834
623834
%if %{undefined __ansible_provides}
46c147
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{version}
623834
%endif
623834
# be compatible with the usual Fedora Provides:
623834
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
623834
623834
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
623834
%if %{undefined ansible_collection_build}
623834
%if %{without ansible}
623834
# Empty command. We don't have ansible-galaxy.
623834
%define ansible_collection_build() :
623834
%else
623834
%define ansible_collection_build() ansible-galaxy collection build
623834
%endif
623834
%endif
623834
623834
%if %{undefined ansible_collection_install}
623834
%if %{without ansible}
623834
# Simply copy everything instead of galaxy-installing the built artifact.
623834
%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}; cp -a . %{buildroot}%{ansible_collection_files}/%{collection_name}/
623834
%else
46c147
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
623834
%endif
623834
%endif
623834
623834
%description
623834
Collection of Ansible roles which configures a RHEL system according
623834
to applicable SAP notes so that any SAP software can be installed.
623834
623834
%if %{with collection_artifact}
623834
%package collection-artifact
623834
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
623834
623834
%description collection-artifact
46c147
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
623834
%endif
623834
623834
%prep
623834
%setup -q -a1 -a2 -a3 -n auto-maintenance-%{mainid}
623834
623834
# rename the source directories without gitcommit_sap 
623834
mv sap-preconfigure-%{gitcommit_sap} sap-preconfigure
623834
mv sap-hana-preconfigure-%{gitcommit_sap_hana} sap-hana-preconfigure
623834
mv sap-netweaver-preconfigure-%{gitcommit_sap_netweaver} sap-netweaver-preconfigure
623834
623834
# cp own galaxy.yml and rename the collection name correctly for Automation Hub and Galaxy
623834
mkdir .collections
623834
cp %{SOURCE5} galaxy.yml
46c147
sed -i -e "s|name: rhel|name: %{collection_name}|" galaxy.yml
46c147
# add correct version for Automation Hub and Galaxy
46c147
sed -i -e "s|version: 3.1.1|version: %{collection_version}|" galaxy.yml
623834
623834
pushd sap-preconfigure
623834
popd
623834
pushd sap-hana-preconfigure
623834
%patch50 -p1
623834
popd
623834
pushd sap-netweaver-preconfigure
623834
popd
623834
623834
# remove git stuff
623834
rm -rf *-preconfigure/.git*
623834
# remove zero file
623834
rm -f sap-hana-preconfigure/tasks/RedHat_6/recommendations.yml
623834
# remove all SLES stuff and RHEL 6 stuff
623834
rm -rf sap-hana-preconfigure/tasks/SLES/
623834
rm -rf sap-hana-preconfigure/tasks/sapnote/1275776 # SLES - sapconf, saptune, etc
623834
rm -rf sap-hana-preconfigure/tasks/sapnote/1944799 # SLES - HANA install and config guidelines
623834
rm -f  sap-hana-preconfigure/tasks/sapnote/1944799.yml
623834
rm -f  sap-hana-preconfigure/tasks/sapnote/2013638.yml # RHEL 6.5 - OS settings
623834
rm -f  sap-hana-preconfigure/tasks/sapnote/2136965.yml # RHEL 6.6 - OS settings
623834
rm -f  sap-hana-preconfigure/tasks/sapnote/2247020.yml # RHEL 6.7 - OS settings
623834
rm -rf sap-hana-preconfigure/tasks/sapnote/2578899 # SLES 15 - installation
623834
rm -rf sap-hana-preconfigure/tasks/sapnote/2684254 # SLES 15 - OS settings for HANA
623834
rm -f  sap-hana-preconfigure/vars/RedHat_6.5.yml
623834
rm -f  sap-hana-preconfigure/vars/RedHat_6.6.yml
623834
rm -f  sap-hana-preconfigure/vars/RedHat_6.7.yml
623834
rm -f  sap-hana-preconfigure/vars/SLES_15.yml
623834
623834
%build
623834
sh md2html.sh \
623834
sap-preconfigure/README.md \
623834
sap-hana-preconfigure/README.md \
623834
sap-netweaver-preconfigure/README.md
623834
623834
for role in %{rolename1} %{rolename2} %{rolename3} ; do
623834
    new_role="$(echo ${role/sap-/} | tr '-' '_')"
623834
    python3 lsr_role2collection.py --role "$role" \
623834
        --src-path "$role" \
623834
        --src-owner %{src_owner} \
623834
        --dest-path .collections \
623834
        --readme %{SOURCE4} \
623834
        --namespace %{collection_namespace} \
623834
        --collection %{collection_name} \
623834
        --new-role "$new_role" \
623834
        --extra-mapping "timesync:redhat.rhel_system_roles.timesync,storage:redhat.rhel_system_roles.storage,sap-preconfigure:sap.rhel.preconfigure,sap-hana-preconfigure:sap.rhel.hana_preconfigure,sap-netweaver-preconfigure:sap.rhel.netweaver_preconfigure" 
623834
done
623834
623834
rm -f .collections/ansible_collections/%{collection_namespace}/%{collection_name}/tests/sanity/ignore-2.9.txt
623834
# Merge .sanity-ansible-ignore-2.9-ROLENAME.txt into tests/sanity/ignore-2.9.txt
623834
for role in %{rolenames}; do
623834
    if [ -f .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.sanity-ansible-ignore-2.9-"$role".txt ];
623834
    then
623834
      cat .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.sanity-ansible-ignore-2.9-"$role".txt \
623834
        >> .collections/ansible_collections/%{collection_namespace}/%{collection_name}/tests/sanity/ignore-2.9.txt
623834
      rm -f .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.sanity-ansible-ignore-*-"$role".txt
623834
    fi
623834
done
623834
623834
# removing dot files/dirs
623834
rm -rf .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.[A-Za-z]*
623834
46c147
cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name}
623834
623834
# build collection file
623834
cd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
623834
%ansible_collection_build
623834
623834
%install
623834
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles \
623834
         $RPM_BUILD_ROOT%{_pkgdocdir}/sap-hana-preconfigure \
623834
         $RPM_BUILD_ROOT%{_pkgdocdir}/sap-preconfigure \
623834
         $RPM_BUILD_ROOT%{_pkgdocdir}/sap-netweaver-preconfigure
623834
623834
cp -pR sap-hana-preconfigure sap-preconfigure sap-netweaver-preconfigure $RPM_BUILD_ROOT%{_datadir}/ansible/roles/
623834
cp -p sap-hana-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir}/sap-hana-preconfigure/
623834
cp -p sap-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir}/sap-preconfigure/
623834
cp -p sap-netweaver-preconfigure/{README.md,LICENSE} $RPM_BUILD_ROOT%{_pkgdocdir}/sap-netweaver-preconfigure/
623834
623834
# install collection files
623834
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
623834
%ansible_collection_install
623834
popd
623834
623834
# install collection_artifact
623834
%if %{with collection_artifact}
623834
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
623834
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
46c147
mv %{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
623834
popd
623834
%endif
623834
623834
%files
623834
%dir %{_pkgdocdir}
623834
%dir %{_pkgdocdir}/sap-preconfigure
623834
%dir %{_pkgdocdir}/sap-hana-preconfigure
623834
%dir %{_pkgdocdir}/sap-netweaver-preconfigure
623834
%dir %{_datadir}/ansible
623834
%dir %{_datadir}/ansible/roles
623834
%doc %{_pkgdocdir}/*/README.md
623834
%license %{_pkgdocdir}/*/LICENSE
623834
%{_datadir}/ansible/roles/*
623834
%{ansible_collection_files}
623834
623834
%if %{with collection_artifact}
623834
%files collection-artifact
46c147
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{collection_version}.tar.gz
623834
%endif
623834
623834
%changelog
46c147
* Tue Nov 16 2021 Than Ngo <than@redhat.com> - 3.1.1-14
46c147
- Resolves: #2021579, ansible-lint cleanup
46c147
46c147
* Fri Oct 15 2021 Than Ngo <than@redhat.com> - 3.1.1-13
46c147
- Fix the version of the collection tar file
46c147
46c147
* Fri Oct 15 2021 Than Ngo <than@redhat.com> - 3.1.1-12
46c147
- Resolves: #2003630, Pepare the roles for ansible-core 2.11: Only use ansible.core modules
46c147
623834
* Wed Sep 01 2021 Than Ngo <than@redhat.com> - 3.1.1-11
623834
- fix yum group install errors on RHEL 7
623834
- use grubby for setting tsx=on
623834
- set min kernel version for RHEL 8.4 x86_64
623834
623834
* Fri Aug 20 2021 Than Ngo <than@redhat.com> - 3.1.1-10
623834
- Related: #1977195, fix #149, #177, #193, #194
623834
623834
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 3.1.1-9
623834
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
623834
  Related: rhbz#1991688
623834
623834
* Fri Jul 16 2021 Than Ngo <than@redhat.com> - 3.1.1-8
623834
- Related: #1977195, add missing vars/RedHat_9.yml in sap-netweaver-preconfigure
623834
623834
* Tue Jul 13 2021 Than Ngo <than@redhat.com> - 3.1.1-7
623834
- Related: #1977195, add missing __sap_preconfigure_envgroups for RHEL 7.x and
623834
  missing __sap_hana_preconfigure_req_repos variables for RHEL 8.5 and later
623834
623834
* Tue Jun 29 2021 Than Ngo <than@redhat.com> - 3.1.1-6
623834
- Resolves: #1977195, make RHEL system roles for SAP RHEL9 compatible
623834
623834
* Mon Jun 28 2021 Than Ngo <than@redhat.com> - 3.1.1-5
623834
- updated tarball, galaxy.yml, README.md
623834
623834
* Mon Jun 07 2021 Than Ngo <than@redhat.com> - 3.1.1-4
623834
- update README.md
623834
- Adding the -collection-artifact subpackage, enabled using
623834
  "--with collection_artifact". It is used for importing to
623834
  ansible galaxy/automation hub.
623834
623834
* Fri May 21 2021 Than Ngo <than@redhat.com> - 3.1.1-3
623834
- convert roles to FQCN in the README files
623834
623834
* Thu May 20 2021 Than Ngo <than@redhat.com> - 3.1.1-2
623834
- rename dashes by underscores and drop sap-
623834
623834
* Tue May 18 2021 Than Ngo <than@redhat.com> - 3.1.1-1
623834
- rebase
623834
623834
* Wed Apr 14 2021 Than Ngo <than@redhat.com> - 3.1.0-3
623834
- bz#1928398, rebuilt against new python-ruamel-yaml-0.15.100 for conversion problem
623834
623834
* Mon Mar 22 2021 Than Ngo <than@redhat.com> - 3.1.0-2
623834
- rebase
623834
623834
* Tue Mar 02 2021 Than Ngo <than@redhat.com> - 3.1.0-1
623834
- added support Transfer SAP roles into collection format
623834
623834
* Wed Feb 24 2021 Than Ngo <than@redhat.com> - 3.0.1-3
623834
- Related: #1891642, fixed issue #125 in sap-preconfigure and #163 and #164 in sap-hana-preconfigure
623834
623834
* Thu Feb 18 2021 Than Ngo <than@redhat.com> - 3.0.1-2
623834
- Related: #1891642, update sap-hana-preconfigure 3.0.1 and fixed Urls
623834
623834
* Thu Feb 18 2021 Than Ngo <than@redhat.com> - 3.0.1-1
623834
- Related: #1891642, rebase to 3.0.1
623834
623834
* Mon Feb 15 2021 Than Ngo <than@redhat.com> - 3.0.0-2
623834
- Related: #1891642, more fixes #145, #148, #149, #150 #147
623834
623834
* Thu Jan 28 2021 Than Ngo <than@redhat.com> - 3.0.0-1
623834
- Resolves: #1891638, bug fixes
623834
- Resolves: #1891642, new features
623834
623834
* Tue Jan 12 2021 Than Ngo <than@redhat.com> - 2.0.0-8
623834
- RHEL 9.0.0 Alpha build
623834
623834
* Mon Sep 21 2020 Than Ngo <than@redhat.com> - 2.0.0-7
623834
- Related: #1867027, fix #119
623834
623834
* Thu Aug 20 2020 Than Ngo <than@redhat.com> - 2.0.0-6
623834
- Related: #1867027, fix #92
623834
623834
* Fri Aug 07 2020 Than Ngo <than@redhat.com> - 2.0.0-5
623834
- Resolves: #1867027, more fixes for #89, #109, #110, #111, #112, #113, #114, #116
623834
623834
* Tue Jul 21 2020 Than Ngo <than@redhat.com> - 2.0.0-4
623834
- Related: #1844190, more fixes for #84, #85, #86, #88, #98, #104, #105, #107
623834
623834
* Fri Jul 03 2020 Than Ngo <than@redhat.com> - 2.0.0-3
623834
- Related: #1844190, drop 1944799.yml
623834
623834
* Mon Jun 29 2020 Than Ngo <than@redhat.com> - 2.0.0-2
623834
- Related: #1844190, more fixes for #78, #79, #81, #82, #94-#97, #99, #101-#102
623834
623834
* Mon Jun 08 2020 Than Ngo <than@redhat.com> - 2.0.0-1
623834
- Resolves: #1844190, rebase to 2.0.0
623834
623834
* Thu May 07 2020 Than Ngo <than@redhat.com> - 1.1.1-2
623834
- Resolves: #1829495, fix summary
623834
623834
* Mon Oct 21 2019 Than Ngo <than@redhat.com> - 1.1.1-1
623834
- rebase to 1.1.1
623834
- always use ansible_hostname + ansible_domain instead of ansible_fqdn
623834
- use {{ ansible_hostname }}.{{ ansible_domain }} instead of {{ ansible_fqdn }}
623834
- added LC_ALL=C before commands for which the outputs are to be evaluated
623834
623834
* Thu Sep 12 2019 Than Ngo <than@redhat.com> - 1.1-1
623834
- rebase to 1.1
623834
623834
* Fri Jun 28 2019 Than Ngo <than@redhat.com> - 1.0-1
623834
- Initial release.