Blame SPECS/ansible-collection-microsoft-sql.spec

289146
# NOTE: Even though ansible-core is in 8.6, it is only available
289146
# at *runtime*, not at *buildtime* - so we can't have
289146
# ansible-core as a build_dep on RHEL8
289146
%if 0%{?fedora} || 0%{?rhel} >= 9
289146
%bcond_without ansible
289146
%global ansible_build_dep ansible-core >= 2.11.0
289146
%else
c67ab7
%if 0%{?rhel} && ! 0%{?epel}
c67ab7
%bcond_with ansible
c67ab7
%else
c67ab7
%bcond_without ansible
289146
%global ansible_build_dep ansible >= 2.9.10
289146
%endif
c67ab7
%endif
c67ab7
c67ab7
%bcond_with collection_artifact
c67ab7
c67ab7
# Do not convert .md to .html on RHEL 7 because tools the conversion are not available
c67ab7
%if 0%{?fedora} || 0%{?rhel} >= 8
c67ab7
%bcond_without html
c67ab7
%else
c67ab7
%bcond_with html
c67ab7
%endif
c67ab7
c67ab7
Name: ansible-collection-microsoft-sql
c67ab7
Url: https://github.com/linux-system-roles/mssql
c67ab7
Summary: The Ansible collection for Microsoft SQL Server management
289146
Version: 1.2.3
289146
Release: 1%{?dist}
c67ab7
c67ab7
#Group: Development/Libraries
c67ab7
License: MIT
c67ab7
%global installbase %{_datadir}/microsoft
c67ab7
%global _pkglicensedir %{_licensedir}/%{name}
c67ab7
c67ab7
%global collection_namespace microsoft
c67ab7
%global collection_name sql
c67ab7
c67ab7
%global collection_version %{version}
c67ab7
c67ab7
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
c67ab7
# Not available on RHEL, so we must define those macros locally here without using ansible-galaxy
c67ab7
c67ab7
# Not used (yet). Could be made to point to AH in RHEL - but what about CentOS Stream?
c67ab7
#%%{!?ansible_collection_url:%%define ansible_collection_url() https://galaxy.ansible.com/%%{collection_namespace}/%%{collection_name}}
c67ab7
c67ab7
%if 0%{?fedora} || 0%{?rhel} >= 8
c67ab7
%{!?ansible_collection_files:%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/}
c67ab7
%else
c67ab7
# Define undefined macro using "!?ansible_collection_files:..." does not work for rhel-7
c67ab7
%if %{?ansible_collection_files:0}%{!?ansible_collection_files:1}
c67ab7
%define ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
c67ab7
%endif
c67ab7
%endif
c67ab7
289146
# ansible-core is in rhel 8.6 and later - default to ansible-core, but allow
289146
# the use of ansible if present - we may revisit this if the automatic dependency
289146
# generator is added to ansible-core in RHEL
289146
# Fedora - the automatic generator will add this - no need to explicit declare
289146
# it in the spec file
289146
# EL7 - no dependency on ansible because there is no ansible in el7 - user is
289146
# responsible for knowing they have to install ansible
289146
%if 0%{?rhel} >= 8
289146
Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0)
289146
%endif
289146
289146
%if 0%{?fedora}
289146
Requires: linux-system-roles
289146
%else
289146
Requires: rhel-system-roles
289146
%endif
289146
c67ab7
%if %{with ansible}
289146
BuildRequires: %{ansible_build_dep}
c67ab7
%endif
c67ab7
c67ab7
%if %{without ansible}
c67ab7
# We don't have ansible-galaxy.
c67ab7
# Simply copy everything instead of galaxy-installing the built artifact.
c67ab7
%define ansible_collection_build_install() tar -cf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz .; mkdir -p %{buildroot}%{ansible_collection_files}%{collection_name}; (cd %{buildroot}%{ansible_collection_files}%{collection_name}; tar -xf %{_tmppath}/%{collection_namespace}-%{collection_name}-%{version}.tar.gz)
c67ab7
%else
c67ab7
%define ansible_collection_build_install() ansible-galaxy collection build; ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
c67ab7
%endif
c67ab7
289146
# For each role, call defsource() and the point to it with SourceN: %{archiveurlN}.
c67ab7
%global archiveext tar.gz
c67ab7
# list of source role names
c67ab7
%global rolenames %nil
c67ab7
# list of assignments that can be used to populate a bash associative array variable
c67ab7
%global rolestodir %nil
c67ab7
# list of target rolenames to copy the roles to
c67ab7
%global target_rolenames %nil
c67ab7
# list of collection rolenames to convert the roles to
c67ab7
%global collection_rolenames %nil
c67ab7
c67ab7
%define getarchivedir() %(p=%{basename:%{S:%{1}}}; echo ${p%%.%{archiveext}})
c67ab7
c67ab7
%global parenturl https://github.com/linux-system-roles
c67ab7
289146
# You can feed either tag or commit to defsource
289146
%define defsource() %{expand:%%global ref%{1} %{2}
c67ab7
%%global extractdir%{1} %%{expand:%%getarchivedir %{1}}
c67ab7
%%global archiveurl%{1} %%{parenturl}/%%{rolename%{1}}/archive/%%{ref%{1}}/%%{rolename%{1}}-%%{ref%{1}}.tar.gz
c67ab7
%%global rolenames %%{?rolenames} %%{rolename%{1}}
c67ab7
%%global roletodir%{1} [%{rolename%{1}}]="%{extractdir%{1}}"
c67ab7
%%global rolestodir %%{?rolestodir} %{roletodir%{1}}
c67ab7
%%{!?target_rolename%{1}:%%global target_rolename%{1} %%{rolename%{1}}}
c67ab7
%%global target_rolenames %%{?target_rolenames} [%{rolename%{1}}]="%{target_rolename%{1}}"
c67ab7
%%{!?collection_rolename%{1}:%%global collection_rolename%{1} %%{rolename%{1}}}
c67ab7
%%global collection_rolenames %%{?collection_rolenames} [%{rolename%{1}}]="%{collection_rolename%{1}}"
c67ab7
}
c67ab7
289146
%defsource 1 1.2.3
c67ab7
%global rolename1 mssql
c67ab7
%global target_rolename1 sql-server
c67ab7
%global collection_rolename1 server
c67ab7
c67ab7
%global mainid cdc706f14614ef5e80bbce8db10beb369e889df9
c67ab7
Source: %{parenturl}/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
c67ab7
Source1: %{archiveurl1}
c67ab7
c67ab7
BuildArch: noarch
c67ab7
c67ab7
%if %{with html}
c67ab7
# Requirements for md2html.sh to build the documentation
c67ab7
%if 0%{?fedora} || 0%{?rhel} >= 9
c67ab7
BuildRequires: rubygem-kramdown-parser-gfm
c67ab7
%else
c67ab7
BuildRequires: pandoc
c67ab7
BuildRequires: asciidoc
c67ab7
BuildRequires: highlight
c67ab7
%endif
c67ab7
%endif
c67ab7
c67ab7
# Requirements for galaxy_transform.py
c67ab7
BuildRequires: python3
c67ab7
%if 0%{?fedora} || 0%{?rhel} >= 8
289146
BuildRequires: %{py3_dist ruamel.yaml}
c67ab7
%else
c67ab7
BuildRequires: python3-ruamel-yaml
c67ab7
%endif
c67ab7
c67ab7
%if %{undefined __ansible_provides}
c67ab7
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}
c67ab7
%endif
c67ab7
# be compatible with the usual Fedora Provides:
c67ab7
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{version}-%{release}
c67ab7
c67ab7
%description
c67ab7
This RPM installs the Ansible collection for Microsoft SQL Server management
c67ab7
microsoft.sql. This RPM also installs the roles provided by the collection in
c67ab7
the legacy roles format for users of Ansible < 2.9.
c67ab7
c67ab7
%if %{with collection_artifact}
c67ab7
%package collection-artifact
c67ab7
Summary: Collection artifact to import to Automation Hub / Ansible Galaxy
c67ab7
c67ab7
%description collection-artifact
c67ab7
Collection artifact for %{name}. This package contains %{collection_namespace}-%{collection_name}-%{version}.tar.gz
c67ab7
%endif
c67ab7
c67ab7
%prep
c67ab7
%setup -q -a1 -n %{getarchivedir 0}
c67ab7
c67ab7
# Declare the array containing names of directories to copy roles to for prep
c67ab7
declare -A ROLESTODIR=(%{rolestodir})
c67ab7
for rolename in %{rolenames}; do
c67ab7
    mv "${ROLESTODIR[${rolename}]}" ${rolename}
c67ab7
done
c67ab7
c67ab7
# Removing symlinks in tests/roles
c67ab7
for rolename in %{rolenames}; do
c67ab7
    if [ -d ${rolename}/tests/roles ]; then
c67ab7
        find ${rolename}/tests/roles -type l -exec rm {} \;
c67ab7
        if [ -d ${rolename}/tests/roles/linux-system-roles.${rolename} ]; then
c67ab7
            rm -r ${rolename}/tests/roles/linux-system-roles.${rolename}
c67ab7
        fi
c67ab7
    fi
c67ab7
done
c67ab7
c67ab7
# transform ambiguous #!/usr/bin/env python shebangs to python3 to stop brp-mangle-shebangs complaining
c67ab7
find -type f -executable -name '*.py' -exec \
c67ab7
     sed -i -r -e '1s@^(#! */usr/bin/env python)(\s|$)@#\13\2@' '{}' +
c67ab7
c67ab7
%build
c67ab7
%if %{with html}
c67ab7
# Convert README.md to README.html in the source roles
c67ab7
readmes=""
c67ab7
for rolename in %{rolenames}; do
c67ab7
    readmes="${readmes} $rolename/README.md"
c67ab7
done
c67ab7
sh md2html.sh $readmes
c67ab7
%endif
c67ab7
c67ab7
mkdir .collections
c67ab7
# Copy README.md for the collection build
c67ab7
cp %{rolename1}/.collection/README.md lsr_role2collection/collection_readme.md
c67ab7
# Copy galaxy.yml for the collection build
c67ab7
cp %{rolename1}/.collection/galaxy.yml ./
289146
c67ab7
# Ensure the correct entries in galaxy.yml
289146
%if 0%{?rhel}
289146
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
289146
                      "Ansible collection for Microsoft SQL Server management" \
289146
                      "https://github.com/linux-system-roles/mssql" \
289146
                      "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/administration_and_configuration_tasks_using_system_roles_in_rhel/assembly_configuring-microsoft-sql-server-using-microsoft-sql-server-ansible-role_assembly_updating-packages-to-enable-automation-for-the-rhel-system-roles" \
289146
                      "https://github.com/linux-system-roles/mssql/blob/master/README.md" \
289146
                      "https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=ansible-collection-microsoft-sql" \
289146
                      > galaxy.yml.tmp
289146
%else
289146
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
289146
                      "Ansible collection for Microsoft SQL Server management" \
289146
                      > galaxy.yml.tmp
289146
%endif
c67ab7
mv galaxy.yml.tmp galaxy.yml
c67ab7
c67ab7
# Declare the array containing collection rolenames to convert roles to
c67ab7
declare -A COLLECTION_ROLENAMES=(%{collection_rolenames})
c67ab7
289146
# Replace fedora.linux_system_roles with redhat.rhel_system_roles
289146
%if 0%{?rhel}
289146
for rolename in %{rolenames}; do
289146
    sed -i 's/fedora\.linux_system_roles/redhat.rhel_system_roles/g' \
289146
    $rolename/CHANGELOG.md \
289146
    $rolename/README.md \
289146
    $rolename/tasks/*.yml \
289146
    $rolename/tests/*.yml \
289146
    $rolename/meta/*.yml
289146
done
289146
%endif
289146
c67ab7
# Convert roles to the collection format
c67ab7
for rolename in %{rolenames}; do
c67ab7
    python3 lsr_role2collection.py --role "$rolename" \
c67ab7
        --src-path "$rolename" \
c67ab7
        --src-owner linux-system-roles \
c67ab7
        --dest-path .collections \
c67ab7
        --readme lsr_role2collection/collection_readme.md \
c67ab7
        --namespace %{collection_namespace} --collection %{collection_name} \
c67ab7
        --new-role "${COLLECTION_ROLENAMES[${rolename}]}" \
c67ab7
        --meta-runtime lsr_role2collection/runtime.yml
c67ab7
done
c67ab7
c67ab7
# removing dot files/dirs
c67ab7
rm -r .collections/ansible_collections/%{collection_namespace}/%{collection_name}/.[A-Za-z]*
c67ab7
c67ab7
# Copy galaxy.yml to the collection directory
c67ab7
cp -p galaxy.yml .collections/ansible_collections/%{collection_namespace}/%{collection_name}
c67ab7
289146
# Update CHANGELOG.md with the current date and copy it to collection dir
289146
curr_date=$(date +'%Y-%m-%d')
289146
sed -i "s/^\([%{version}] - \).*/\1$curr_date/g" \
289146
    .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{collection_rolename1}/CHANGELOG.md
289146
mv .collections/ansible_collections/%{collection_namespace}/%{collection_name}/roles/%{collection_rolename1}/CHANGELOG.md \
289146
    .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
289146
c67ab7
%install
c67ab7
mkdir -p $RPM_BUILD_ROOT%{installbase}
c67ab7
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/roles
c67ab7
c67ab7
# Declare the array containing target rolenames to copy roles to
c67ab7
declare -A TARGET_ROLENAMES=(%{target_rolenames})
c67ab7
c67ab7
# Copy roles to the target directory within the microsoft directory and rename
c67ab7
for rolename in %{rolenames}; do
c67ab7
    cp -pR "$rolename" "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}"
c67ab7
    sed -i "s/linux-system-roles\.$rolename/microsoft\.${TARGET_ROLENAMES[${rolename}]}/g" \
c67ab7
      $RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/tests/*.yml
c67ab7
done
c67ab7
c67ab7
# Generate symlinks for roles in /usr/share/ansible/roles
c67ab7
for rolename in %{rolenames}; do
c67ab7
    ln -s "%{installbase}/${TARGET_ROLENAMES[${rolename}]}" "$RPM_BUILD_ROOT%{_datadir}/ansible/roles/microsoft.${TARGET_ROLENAMES[${rolename}]}"
c67ab7
done
c67ab7
c67ab7
# Copy README, COPYING, and LICENSE files to the corresponding directories
c67ab7
mkdir -p $RPM_BUILD_ROOT%{_pkglicensedir}
c67ab7
for rolename in %{rolenames}; do
c67ab7
    mkdir -p "$RPM_BUILD_ROOT%{_pkgdocdir}/${TARGET_ROLENAMES[${rolename}]}"
c67ab7
    cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/README.md" \
c67ab7
       "$RPM_BUILD_ROOT%{_pkgdocdir}/${TARGET_ROLENAMES[${rolename}]}"
c67ab7
%if %{with html}
c67ab7
    cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/README.html" \
c67ab7
       "$RPM_BUILD_ROOT%{_pkgdocdir}/${TARGET_ROLENAMES[${rolename}]}"
c67ab7
%endif
c67ab7
    if [ -f "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/COPYING" ]; then
c67ab7
        cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/COPYING" \
c67ab7
           "$RPM_BUILD_ROOT%{_pkglicensedir}/${TARGET_ROLENAMES[${rolename}]}.COPYING"
c67ab7
    fi
c67ab7
    if [ -f "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/LICENSE" ]; then
c67ab7
        cp -p "$RPM_BUILD_ROOT%{installbase}/${TARGET_ROLENAMES[${rolename}]}/LICENSE" \
c67ab7
           "$RPM_BUILD_ROOT%{_pkglicensedir}/${TARGET_ROLENAMES[${rolename}]}.LICENSE"
c67ab7
    fi
c67ab7
done
c67ab7
c67ab7
# Remove dot files
c67ab7
rm -r $RPM_BUILD_ROOT%{installbase}/*/.[A-Za-z]*
c67ab7
c67ab7
# Remove the molecule directory
c67ab7
rm -r $RPM_BUILD_ROOT%{installbase}/*/molecule
c67ab7
c67ab7
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
c67ab7
%ansible_collection_build_install
c67ab7
popd
c67ab7
c67ab7
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection
c67ab7
mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles
c67ab7
c67ab7
# Copy the collection README files to the collection
c67ab7
cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/README.md \
c67ab7
   $RPM_BUILD_ROOT%{_pkgdocdir}/collection
c67ab7
c67ab7
# Declare the array containing collection rolenames to convert roles to
c67ab7
declare -A COLLECTION_ROLENAMES=(%{collection_rolenames})
c67ab7
c67ab7
for rolename in %{rolenames}; do
c67ab7
  if [ -f "%{buildroot}%{ansible_collection_files}%{collection_name}/roles/${COLLECTION_ROLENAMES[${rolename}]}/README.md" ]; then
c67ab7
    mkdir -p $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${COLLECTION_ROLENAMES[${rolename}]}
c67ab7
    cp -p %{buildroot}%{ansible_collection_files}%{collection_name}/roles/${COLLECTION_ROLENAMES[${rolename}]}/README.md \
c67ab7
        $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${COLLECTION_ROLENAMES[${rolename}]}
c67ab7
  fi
c67ab7
done
c67ab7
c67ab7
%if %{with html}
c67ab7
# converting README.md to README.html for collection in $RPM_BUILD_ROOT%{_pkgdocdir}/collection
c67ab7
readmes="$RPM_BUILD_ROOT%{_pkgdocdir}/collection/README.md"
c67ab7
for rolename in %{rolenames}; do
c67ab7
    readmes="${readmes} $RPM_BUILD_ROOT%{_pkgdocdir}/collection/roles/${COLLECTION_ROLENAMES[${rolename}]}/README.md"
c67ab7
done
c67ab7
sh md2html.sh $readmes
c67ab7
%endif
c67ab7
c67ab7
%if %{with collection_artifact}
c67ab7
# Copy collection artifact to /usr/share/ansible/collections/ for collection-artifact
c67ab7
pushd .collections/ansible_collections/%{collection_namespace}/%{collection_name}/
c67ab7
if [ -f %{collection_namespace}-%{collection_name}-%{version}.tar.gz ]; then
c67ab7
    mv %{collection_namespace}-%{collection_name}-%{version}.tar.gz \
c67ab7
       $RPM_BUILD_ROOT%{_datadir}/ansible/collections/
c67ab7
fi
c67ab7
popd
c67ab7
%endif
c67ab7
c67ab7
# generate the %files section in the file files_section.txt
c67ab7
format_item_for_files() {
c67ab7
    # $1 is directory or file name in buildroot
c67ab7
    # $2 - if true, and item is a directory, use %dir
c67ab7
    local item
c67ab7
    local files_item
c67ab7
    item="$1"
c67ab7
    files_item=${item##"%{buildroot}"}
c67ab7
    if [ -L "$item" ]; then
c67ab7
        echo "$files_item"
c67ab7
    elif [ -d "$item" ]; then
c67ab7
        if [[ "$item" == */doc* ]]; then
c67ab7
            echo "%doc $files_item"
c67ab7
        elif [ "${2:-false}" = true ]; then
c67ab7
            echo "%dir $files_item"
c67ab7
        else
c67ab7
            echo "$files_item"
c67ab7
        fi
c67ab7
    elif [[ "$item" == */README.md ]] || [[ "$item" == */README.html ]]; then
c67ab7
        if [[ "$item" == */private_* ]]; then
c67ab7
            # mark as regular file, not %doc
c67ab7
            echo "$files_item"
c67ab7
        else
c67ab7
            echo "%doc $files_item"
c67ab7
        fi
c67ab7
    elif [[ "$item" != */COPYING* ]] && [[ "$item" != */LICENSE* ]]; then
c67ab7
        # Avoid dynamically using the license macro since the license macro
c67ab7
        # is replaced with the value of License directive in the older rpmbuild.
c67ab7
        echo "$files_item"
c67ab7
    fi
c67ab7
}
c67ab7
c67ab7
files_section=files_section.txt
c67ab7
rm -f $files_section
c67ab7
touch $files_section
c67ab7
%if %{without ansible}
c67ab7
echo '%dir %{_datadir}/ansible' >> $files_section
c67ab7
echo '%dir %{_datadir}/ansible/roles' >> $files_section
c67ab7
%endif
c67ab7
%if "%{installbase}" != "%{_datadir}/ansible/roles"
c67ab7
echo '%dir %{installbase}' >> $files_section
c67ab7
%endif
c67ab7
echo '%dir %{ansible_collection_files}' >> $files_section
c67ab7
echo '%dir %{ansible_collection_files}%{collection_name}' >> $files_section
c67ab7
find %{buildroot}%{ansible_collection_files}%{collection_name} -mindepth 1 -maxdepth 1 | \
c67ab7
    while read item; do
c67ab7
        if [[ "$item" == */roles ]]; then
c67ab7
            format_item_for_files "$item" true >> $files_section
c67ab7
            find "$item" -mindepth 1 -maxdepth 1 | while read roles_dir; do
c67ab7
                format_item_for_files "$roles_dir" true >> $files_section
c67ab7
                find "$roles_dir" -mindepth 1 -maxdepth 1 | while read roles_item; do
c67ab7
                    format_item_for_files "$roles_item" >> $files_section
c67ab7
                done
c67ab7
            done
c67ab7
        else
c67ab7
            format_item_for_files "$item" >> $files_section
c67ab7
        fi
c67ab7
    done
c67ab7
c67ab7
find %{buildroot}%{installbase} -mindepth 1 -maxdepth 1 | \
c67ab7
    while read item; do
c67ab7
        if [ -d "$item" ]; then
c67ab7
            format_item_for_files "$item" true >> $files_section
c67ab7
            find "$item" -mindepth 1 -maxdepth 1 | while read roles_item; do
c67ab7
                format_item_for_files "$roles_item" >> $files_section
c67ab7
            done
c67ab7
        else
c67ab7
            format_item_for_files "$item" >> $files_section
c67ab7
        fi
c67ab7
    done
c67ab7
if [ "%{installbase}" != "%{_datadir}/ansible/roles" ]; then
c67ab7
    find %{buildroot}%{_datadir}/ansible/roles -mindepth 1 -maxdepth 1 | \
c67ab7
        while read item; do
c67ab7
            if [ -d "$item" ]; then
c67ab7
                format_item_for_files "$item" true >> $files_section
c67ab7
                find "$item" -mindepth 1 -maxdepth 1 | while read roles_item; do
c67ab7
                    format_item_for_files "$roles_item" >> $files_section
c67ab7
                done
c67ab7
            else
c67ab7
                format_item_for_files "$item" >> $files_section
c67ab7
            fi
c67ab7
        done
c67ab7
fi
c67ab7
# cat files_section.txt
c67ab7
# done with files_section.txt generation
c67ab7
c67ab7
%files -f files_section.txt
c67ab7
%{_pkgdocdir}/*/README.md
c67ab7
%{_pkgdocdir}/collection/roles/*/README.md
c67ab7
%if %{with html}
c67ab7
%{_pkgdocdir}/*/README.html
c67ab7
%{_pkgdocdir}/collection/roles/*/README.html
c67ab7
%endif
c67ab7
%license %{_pkglicensedir}/*
c67ab7
%license %{installbase}/*/LICENSE*
c67ab7
%license %{ansible_collection_files}/%{collection_name}/LICENSE*
c67ab7
c67ab7
%if %{with collection_artifact}
c67ab7
%files collection-artifact
c67ab7
%{_datadir}/ansible/collections/%{collection_namespace}-%{collection_name}-%{version}.tar.gz
c67ab7
%endif
c67ab7
c67ab7
%changelog
289146
* Thu Aug 25 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.3-1
289146
- Use firewall role to configure firewall for SQL Server
289146
  Resolves: rhbz#2120709
289146
- Add mssql_ha_virtual_ip
289146
  Replace mssql_ha_db_name with mssql_ha_db_names to let users replicate multiple DBs
289146
  Resolves: rhbz#2066337
289146
289146
- Replace simple `mssql_input_sql_file` with `pre` and `post` variables
289146
  Resolves: rhbz#2120712
289146
- Add Requires: linux-system-roles or rhel-system-roles
289146
- Replace fedora.linux_system_roles:redhat.rhel_system_roles on RHEL
289146
- Add downstream values to galaxy.yml
289146
- Change defcommit to defsource that takes both tags and commits
289146
- Update CHANGELOG.md with the current date and copy it to collection dir
289146
289146
* Mon Jul 4 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.0-2
289146
- Update mssql commit
289146
  Resolves: rhbz#2066337
289146
- Add condition for upstream spec build for galaxy_transform
289146
- Replace extra-mapping with replacing in the legacy format with sed
289146
289146
* Fri Jun 17 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.2.0-1
289146
- Add MVP HA functionality to the server role
289146
  Resolves: rhbz#2066337
289146
- Add mssql_tls_remote_src to the server role
289146
  Resolves: rhbz#2098212
289146
- Add Requires: linux-system-roles or rhel-system-roles
289146
- Add downstream values to galaxy.yml
289146
289146
* Mon Mar 21 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.1.1-3
289146
- Fix inserting ansible_managed
289146
  Resolves: rhbz#2057652
289146
- Users now can provide a custom URLs to pull packages and RPM key from
289146
  Resolves: rhbz#2070452
289146
- Add "Requires: ansible-core or ansible"
289146
  Resolves: rhbz#2067496
289146
289146
289146
* Fri Mar 18 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.1.1-2
289146
- RHEL8.6, 9 - add "Requires: ansible-core or ansible"
289146
  Resolves: rhbz#2065669 (EL9)
289146
289146
* Thu Mar 17 2022 Sergei Petrosian <spetrosi@redhat.com> - 1.1.1-1
289146
- Insert the "Ansible managed" comment to the /var/opt/mssql/mssql.conf file
289146
  Resolves rhbz#2064690 (EL9)
289146
289146
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
289146
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
289146
c67ab7
* Thu Sep 23 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.1.0-2
c67ab7
- Bump release to build with gating.yaml added
c67ab7
289146
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
289146
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
289146
c67ab7
* Wed Jul 21 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.1.0-1
c67ab7
- Add support for Microsoft SQL Server 2017
c67ab7
c67ab7
* Mon Jul 19 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.12-2
c67ab7
- Copy fix for RHEL 7 builds from rhel-system-roles
c67ab7
  Link to the original fix:
c67ab7
  https://src.fedoraproject.org/rpms/linux-system-roles/c/093981119f99ac51a6e06a2714b587e4e2fe287c
c67ab7
c67ab7
* Tue Jul 13 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.12-1
c67ab7
- Add the meta-runtime option from the latest auto-maintenance
c67ab7
- Use the latest mssql that ships fixes for issues #24,#25,#26,#27,#28,35
c67ab7
c67ab7
* Tue Jun 29 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.11-3
c67ab7
- Add a missing slash at the {ansible_collection_files} definition for rhel 7
c67ab7
c67ab7
* Thu Jun 17 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.11-2
c67ab7
- Make the ansible_collection_files macro defined in Fedora automatically and
c67ab7
  in RHEL manually consistent - having slash at the end to clean double-slashes
c67ab7
c67ab7
* Thu Jun 17 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.0.11-1
c67ab7
- Update the version to be consistent with the Galaxy collection at
c67ab7
  https://galaxy.ansible.com/microsoft/sql
c67ab7
c67ab7
* Wed Jun 16 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-5
c67ab7
- Update commit hash for mssql
c67ab7
c67ab7
* Wed Jun 16 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-4
c67ab7
- Generate symlinks for roles in /usr/share/ansible/roles
c67ab7
c67ab7
* Wed Jun 16 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-3
c67ab7
- Copy changes made to linux-system-roles in this PR:
c67ab7
  https://src.fedoraproject.org/rpms/linux-system-roles/pull-request/13#
c67ab7
- Make spec file available for older versions of OSes.
c67ab7
- Drop python3-six dependency which was used by lsr_role2collection.py.
c67ab7
- Drop html files from rpm if the version has no markdown parser.
c67ab7
- Drop unnecessary python scripts which include python3 only code, e.g.,
c67ab7
  f-strings.
c67ab7
  Resolves rhbz#1970165
c67ab7
c67ab7
* Mon Jun 14 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-2
c67ab7
- Fix long description lines
c67ab7
- Fix incorrect role includes in microsoft/sql-server/tests/
c67ab7
c67ab7
* Thu Jun 3 2021 Sergei Petrosian <spetrosi@redhat.com> - 0.0.1-1
c67ab7
- Initial release