summaryrefslogtreecommitdiff
path: root/ansible-core.spec
blob: 4134c6bbdbfeb6bd621ae22735c6c5bf5cfafb7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
%global _empty_manifest_terminate_build 0

Name:           ansible-core
Version:        2.16.10
Release:        1
Summary:        Radically simple IT automation
License:        GPLv3+
URL:            https://ansible.com/
Source0:        https://files.pythonhosted.org/packages/c3/94/a4ce3ff57aebbf5350ea983b6e67b769711449241423d47d8ee3724e3062/ansible_core-2.16.10.tar.gz

BuildArch:      noarch
%description
%{common_description}


# Base build requires
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pbr
BuildRequires:  python3-pip
BuildRequires:  python3-wheel
# General build requires
BuildRequires:  python3-jinja2 >= 3.0.0
BuildRequires:  python3-pyyaml >= 5.1
BuildRequires:  python3-cryptography
BuildRequires:  python3-packaging
BuildRequires:  python3-resolvelib < 1.1.0
BuildRequires:  python3-resolvelib >= 0.5.3
# General requires
Requires:       python3-jinja2 >= 3.0.0
Requires:       python3-pyyaml >= 5.1
Requires:       python3-cryptography
Requires:       python3-packaging
BuildRequires:  python3-resolvelib < 1.1.0
BuildRequires:  python3-resolvelib >= 0.5.3



%package help
Summary:        Radically simple IT automation
Provides:       ansible-core-doc
%description help
%{common_description}

%prep
%autosetup -n ansible_core-%{version}

%build
%py3_build

# Build manpages
mkdir -p docs/man/man1
%{__python3} packaging/cli-doc/build.py man --output-dir docs/man/man1

%install
%py3_install

install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
    find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
    find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
    find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
    find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
    find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

# Create system directories that Ansible defines as default locations in
# ansible/config/base.yml
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
%{_datadir}/ansible/collections/ansible_collections
%{_datadir}/ansible/plugins/doc_fragments
%{_datadir}/ansible/plugins/action
%{_datadir}/ansible/plugins/become
%{_datadir}/ansible/plugins/cache
%{_datadir}/ansible/plugins/callback
%{_datadir}/ansible/plugins/cliconf
%{_datadir}/ansible/plugins/connection
%{_datadir}/ansible/plugins/filter
%{_datadir}/ansible/plugins/httpapi
%{_datadir}/ansible/plugins/inventory
%{_datadir}/ansible/plugins/lookup
%{_datadir}/ansible/plugins/modules
%{_datadir}/ansible/plugins/module_utils
%{_datadir}/ansible/plugins/netconf
%{_datadir}/ansible/roles
%{_datadir}/ansible/plugins/strategy
%{_datadir}/ansible/plugins/terminal
%{_datadir}/ansible/plugins/test
%{_datadir}/ansible/plugins/vars'


UPSTREAM_DATADIR_LOCATIONS=$(grep -ri default lib/ansible/config/base.yml| tr ':' '\n' | grep '/usr/share/ansible')

if [ "$SYSTEM_LOCATIONS" != "$UPSTREAM_SYSTEM_LOCATIONS" ] ; then
	echo "The upstream Ansible datadir locations have changed.  Spec file needs to be updated"
	exit 1
fi

mkdir -p $RPM_BUILD_ROOT%{_datadir}/ansible/plugins/
for location in $DATADIR_LOCATIONS ; do
	mkdir $RPM_BUILD_ROOT"$location"
done
mkdir -p $RPM_BUILD_ROOT/etc/ansible/
mkdir -p $RPM_BUILD_ROOT/etc/ansible/roles/

mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1
cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/


#mkdir -p %{buildroot}%{_datadir}/ansible/plugins/
#for location in $DATADIR_LOCATIONS ; do
#    mkdir %{buildroot}"$location"
#done

#mkdir -p %{buildroot}%{_sysconfdir}/ansible/
#mkdir -p %{buildroot}%{_sysconfdir}/ansible/roles/

#mkdir -p %{buildroot}/%{_mandir}/man1
#cp -v docs/man/man1/*.1 %{buildroot}/%{_mandir}/man1/

%check


%files -n ansible-core -f filelist.lst
%dir %{python3_sitelib}/*
%dir %{_sysconfdir}/ansible/
%config(noreplace) %{_sysconfdir}/ansible/*
%{_mandir}/man1/ansible*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Mon Aug 19 2024 OpenStack_SIG <openstack@openeuler.org> - 2.16.10-1
- Init package ansible-core of version 2.16.10