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

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