2013-04-26 07:12:13 +02:00
|
|
|
#
|
|
|
|
# spec file for package cloud-init
|
|
|
|
#
|
2013-05-07 15:10:36 +02:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2013-04-26 07:12:13 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2013-07-19 16:51:15 +02:00
|
|
|
Name: cloud-init
|
2014-04-14 21:15:14 +02:00
|
|
|
Version: 0.7.5
|
2013-04-26 07:12:13 +02:00
|
|
|
Release: 0
|
2013-05-07 15:10:36 +02:00
|
|
|
License: GPL-3.0
|
2013-07-19 16:51:15 +02:00
|
|
|
Summary: Cloud node initialization tool
|
2013-05-07 15:10:36 +02:00
|
|
|
Url: http://launchpad.net/cloud-init/
|
2013-07-19 16:51:15 +02:00
|
|
|
Group: System/Management
|
2014-04-14 21:15:14 +02:00
|
|
|
Source0: %{name}-%{version}.tar.gz
|
2013-04-26 07:12:13 +02:00
|
|
|
Source1: cloud.cfg.suse
|
2014-01-04 18:43:26 +01:00
|
|
|
Patch0: suseSysVInit.diff
|
2014-04-14 21:15:14 +02:00
|
|
|
Patch1: addopenSUSEBase.patch
|
2014-06-21 01:13:07 +02:00
|
|
|
Patch2: suseIntegratedHandler.patch
|
2014-01-04 18:43:26 +01:00
|
|
|
Patch3: setupSUSEsysVInit.diff
|
2014-03-19 22:38:02 +01:00
|
|
|
Patch5: openSUSEhostsTemplate.diff
|
2013-07-19 16:51:15 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: filesystem
|
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: python-setuptools
|
2014-03-17 18:58:53 +01:00
|
|
|
Requires: growpart
|
2013-06-19 14:42:19 +02:00
|
|
|
Requires: python-argparse
|
2013-07-19 16:51:15 +02:00
|
|
|
Requires: python-boto >= 2.7
|
2013-05-07 15:10:36 +02:00
|
|
|
Requires: python-cheetah
|
2013-06-19 14:42:19 +02:00
|
|
|
Requires: python-configobj
|
2014-01-20 18:51:58 +01:00
|
|
|
Requires: python-jsonpatch
|
2013-06-19 14:42:19 +02:00
|
|
|
Requires: python-oauth
|
2014-01-20 18:51:58 +01:00
|
|
|
Requires: python-PrettyTable
|
|
|
|
Requires: python-pyserial
|
|
|
|
Requires: python-PyYAML
|
2013-06-18 10:29:23 +02:00
|
|
|
Requires: python-requests
|
2013-05-07 15:10:36 +02:00
|
|
|
Requires: python-xml
|
|
|
|
Requires: python-yaml
|
2013-04-26 07:12:13 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%define docdir %{_defaultdocdir}/%{name}
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
|
|
%else
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
2013-06-18 10:29:23 +02:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1210
|
2014-01-04 18:43:26 +01:00
|
|
|
%define initsys sysvinit_suse
|
2013-06-18 10:29:23 +02:00
|
|
|
%else
|
|
|
|
%define initsys systemd
|
2013-07-19 16:51:15 +02:00
|
|
|
BuildRequires: systemd
|
|
|
|
%{?systemd_requires}
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} == 1220
|
|
|
|
%define systemd_prefix /lib
|
|
|
|
%else
|
|
|
|
%define systemd_prefix /usr/lib
|
|
|
|
%endif
|
2013-06-18 10:29:23 +02:00
|
|
|
%endif
|
2013-04-26 07:12:13 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Cloud-init is an init script that initializes a cloud node (VM)
|
|
|
|
according to the fetched configuration data from the admin node.
|
|
|
|
|
2013-06-18 10:29:23 +02:00
|
|
|
%package doc
|
2013-07-19 16:51:15 +02:00
|
|
|
Summary: Cloud node initialization tool - Documentation
|
2013-06-18 10:29:23 +02:00
|
|
|
Group: System/Management
|
2013-07-19 16:51:15 +02:00
|
|
|
Recommends: cloud-init = %{version}
|
2013-06-18 10:29:23 +02:00
|
|
|
|
|
|
|
%description doc
|
2013-07-19 16:51:15 +02:00
|
|
|
Cloud-init is an init script that initializes a cloud node (VM)
|
|
|
|
according to the fetched configuration data from the admin node.
|
|
|
|
|
2013-06-18 10:29:23 +02:00
|
|
|
Documentation and examples for cloud-init tools
|
|
|
|
|
|
|
|
%package test
|
2013-07-19 16:51:15 +02:00
|
|
|
Summary: Cloud node initialization tool - Testsuite
|
2013-06-18 10:29:23 +02:00
|
|
|
Group: System/Management
|
2013-07-19 16:51:15 +02:00
|
|
|
Requires: cloud-init = %{version}
|
2013-06-18 10:29:23 +02:00
|
|
|
|
|
|
|
%description test
|
2013-07-19 16:51:15 +02:00
|
|
|
Cloud-init is an init script that initializes a cloud node (VM)
|
|
|
|
according to the fetched configuration data from the admin node.
|
|
|
|
|
2013-06-18 10:29:23 +02:00
|
|
|
Unit tests for the cloud-init tools
|
|
|
|
|
2013-04-26 07:12:13 +02:00
|
|
|
%prep
|
2013-07-19 16:51:15 +02:00
|
|
|
%setup -q
|
2014-01-04 18:43:26 +01:00
|
|
|
%patch0 -p1
|
2013-04-26 07:12:13 +02:00
|
|
|
%patch1 -p1
|
2014-06-21 01:13:07 +02:00
|
|
|
%patch2
|
2014-01-04 18:43:26 +01:00
|
|
|
%patch3 -p1
|
2014-03-19 22:38:02 +01:00
|
|
|
%patch5
|
|
|
|
|
2013-06-18 10:29:23 +02:00
|
|
|
%if 0%{?suse_version} <= 1130
|
2013-04-26 07:12:13 +02:00
|
|
|
# disable ecdsa for SLE 11 (not available)
|
2013-07-19 16:51:15 +02:00
|
|
|
echo "ssh_genkeytypes: ['rsa', 'dsa']" >> %{SOURCE1}
|
2013-04-26 07:12:13 +02:00
|
|
|
%endif
|
2013-07-19 16:51:15 +02:00
|
|
|
# Install service files into correct location
|
|
|
|
sed -i "s|/etc/systemd/system|%{systemd_prefix}/systemd/system|" setup.py
|
2013-04-26 07:12:13 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
python setup.py build
|
|
|
|
|
|
|
|
%install
|
2013-07-19 16:51:15 +02:00
|
|
|
python setup.py install --root=%{buildroot} --prefix=%{_prefix} --install-lib=%{python_sitelib} --init-system=%{initsys}
|
2013-04-26 07:12:13 +02:00
|
|
|
find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete
|
|
|
|
# from debian install script
|
|
|
|
for x in "%{buildroot}%{_bindir}/"*.py; do
|
|
|
|
[ -f "${x}" ] && mv "${x}" "${x%.py}"
|
|
|
|
done
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/lib/cloud
|
|
|
|
# move documentation
|
|
|
|
mkdir -p %{buildroot}%{_defaultdocdir}
|
2013-07-19 16:51:15 +02:00
|
|
|
mv %{buildroot}%{_datadir}/doc/%{name} %{buildroot}%{docdir}
|
|
|
|
cp -a %{SOURCE1} %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
2014-03-18 20:43:58 +01:00
|
|
|
# copy the LICENSE
|
|
|
|
cp LICENSE %{buildroot}%{docdir}
|
2013-07-19 16:51:15 +02:00
|
|
|
# Set the distribution indicator
|
2013-06-19 14:42:19 +02:00
|
|
|
%if 0%{?suse_version}
|
2013-07-19 16:51:15 +02:00
|
|
|
%if 0%{?suse_version} < 1130
|
2014-03-18 20:43:58 +01:00
|
|
|
#SLE 11, openSUSE 11.x is EOL
|
2013-06-19 14:42:19 +02:00
|
|
|
sed -i s/INSERT_SUSE_DISTRO/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
|
|
|
%endif
|
2013-07-19 16:51:15 +02:00
|
|
|
%if 0%{?suse_version} > 1140
|
2014-03-18 20:43:58 +01:00
|
|
|
%if 0%{?suse_version} == 1315
|
|
|
|
# SLE 12
|
|
|
|
sed -i s/INSERT_SUSE_DISTRO/sles/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
|
|
|
%else
|
2013-06-19 14:42:19 +02:00
|
|
|
sed -i s/INSERT_SUSE_DISTRO/opensuse/ %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
|
|
|
%endif
|
|
|
|
%endif
|
2014-03-18 20:43:58 +01:00
|
|
|
%endif
|
2013-04-26 07:12:13 +02:00
|
|
|
|
|
|
|
# remove debian/ubuntu specific profile.d file (bnc#779553)
|
|
|
|
rm -f %{buildroot}%{_sysconfdir}/profile.d/Z99-cloud-locale-test.sh
|
|
|
|
|
2014-03-19 22:38:02 +01:00
|
|
|
# Remove non-SUSE templates
|
|
|
|
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.debian.*
|
|
|
|
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.redhat.*
|
|
|
|
rm %{buildroot}/%{_sysconfdir}/cloud/templates/*.ubuntu.*
|
|
|
|
|
2013-06-18 10:29:23 +02:00
|
|
|
# move sysvinit scripts into the "right" place
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1210
|
|
|
|
mkdir -p %{buildroot}/%{_initddir}
|
|
|
|
mkdir -p %{buildroot}/%{_sbindir}
|
|
|
|
pushd "%{buildroot}%{_initddir}"
|
|
|
|
for iniF in *; do
|
|
|
|
ln -s "%{_initddir}/${iniF}" "%{buildroot}/%{_sbindir}/rc${iniF}"
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
2013-04-26 07:12:13 +02:00
|
|
|
# remove duplicate files
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%fdupes %{buildroot}%{python_sitelib}
|
|
|
|
%endif
|
|
|
|
|
2013-07-19 16:51:15 +02:00
|
|
|
%postun
|
|
|
|
%insserv_cleanup
|
|
|
|
|
2013-04-26 07:12:13 +02:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2014-03-18 20:43:58 +01:00
|
|
|
# do not mark as doc or we get conflicts with the doc package
|
|
|
|
%{docdir}/LICENSE
|
2013-04-26 07:12:13 +02:00
|
|
|
%{_bindir}/cloud-init
|
|
|
|
%{_bindir}/cloud-init-per
|
|
|
|
%config(noreplace) %{_sysconfdir}/cloud/
|
2013-07-19 16:51:15 +02:00
|
|
|
%{python_sitelib}/cloudinit
|
|
|
|
%{python_sitelib}/cloud_init-%{version}-py%{py_ver}.egg-info
|
|
|
|
%{_prefix}/lib/cloud-init
|
2013-06-18 10:29:23 +02:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1210
|
2013-07-19 16:51:15 +02:00
|
|
|
%{_sbindir}/rccloud-config
|
|
|
|
%{_sbindir}/rccloud-init
|
|
|
|
%{_sbindir}/rccloud-init-local
|
|
|
|
%{_sbindir}/rccloud-final
|
|
|
|
%attr(0755, root, root) %{_initddir}/cloud-config
|
|
|
|
%attr(0755, root, root) %{_initddir}/cloud-init
|
|
|
|
%attr(0755, root, root) %{_initddir}/cloud-init-local
|
|
|
|
%attr(0755, root, root) %{_initddir}/cloud-final
|
2013-06-18 10:29:23 +02:00
|
|
|
%else
|
2013-07-19 16:51:15 +02:00
|
|
|
%{systemd_prefix}/systemd/system/cloud-config.service
|
|
|
|
%{systemd_prefix}/systemd/system/cloud-config.target
|
|
|
|
%{systemd_prefix}/systemd/system/cloud-init-local.service
|
|
|
|
%{systemd_prefix}/systemd/system/cloud-init.service
|
|
|
|
%{systemd_prefix}/systemd/system/cloud-final.service
|
2013-06-18 10:29:23 +02:00
|
|
|
%endif
|
2013-04-26 07:12:13 +02:00
|
|
|
%dir %attr(0755, root, root) %{_localstatedir}/lib/cloud
|
2014-03-18 20:43:58 +01:00
|
|
|
%dir %{docdir}
|
2013-04-26 07:12:13 +02:00
|
|
|
|
2013-06-18 10:29:23 +02:00
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
2014-03-18 20:43:58 +01:00
|
|
|
%{docdir}/examples/*
|
|
|
|
%{docdir}/README
|
|
|
|
%{docdir}/*.txt
|
|
|
|
%{docdir}/*.rst
|
|
|
|
%dir %{docdir}/examples
|
2013-06-18 10:29:23 +02:00
|
|
|
|
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{python_sitelib}/tests
|
|
|
|
|
2013-04-26 07:12:13 +02:00
|
|
|
%changelog
|