|
|
c67ab7 |
%if 0%{?rhel} && ! 0%{?epel}
|
|
|
c67ab7 |
%bcond_with ansible
|
|
|
c67ab7 |
%else
|
|
|
c67ab7 |
%bcond_without ansible
|
|
|
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
|
|
|
c67ab7 |
Version: 1.1.0
|
|
|
c67ab7 |
Release: 2%{?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 |
|
|
|
c67ab7 |
%if %{with ansible}
|
|
|
c67ab7 |
BuildRequires: ansible >= 2.9.10
|
|
|
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 |
|
|
|
c67ab7 |
# For each role, call defcommit() 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 |
|
|
|
c67ab7 |
%define defcommit() %{expand:%%global ref%{1} %{2}
|
|
|
c67ab7 |
%%global shortcommit%{1} %%(c=%%{ref%{1}}; echo ${c:0:7})
|
|
|
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 |
|
|
|
c67ab7 |
%defcommit 1 78ea547ef9e23e20015794a1e48c7d6d21229293
|
|
|
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
|
|
|
c67ab7 |
BuildRequires: python3dist(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 ./
|
|
|
c67ab7 |
# Ensure the correct entries in galaxy.yml
|
|
|
c67ab7 |
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" "Ansible collection for Microsoft SQL Server management" > galaxy.yml.tmp
|
|
|
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 |
|
|
|
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 |
|
|
|
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
|
|
|
c67ab7 |
* Thu Sep 23 2021 Sergei Petrosian <spetrosi@redhat.com> - 1.1.0-2
|
|
|
c67ab7 |
- Bump release to build with gating.yaml added
|
|
|
c67ab7 |
|
|
|
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
|