2013-04-26 07:12:13 +02:00
|
|
|
#
|
|
|
|
# spec file for package cloud-init
|
|
|
|
#
|
2015-02-24 16:55:16 +01:00
|
|
|
# Copyright (c) 2015 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
|
2016-09-13 18:56:10 +02:00
|
|
|
Version: 0.7.8
|
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-06-26 20:54:36 +02:00
|
|
|
Source2: rsyslog-cloud-init.cfg
|
2014-01-04 18:43:26 +01:00
|
|
|
Patch0: suseSysVInit.diff
|
2014-06-24 21:29:50 +02:00
|
|
|
# FIXME addopenSUSEBase.patch proposed for upstream merge
|
2014-04-14 21:15:14 +02:00
|
|
|
Patch1: addopenSUSEBase.patch
|
2014-06-24 21:29:50 +02:00
|
|
|
# FIXME suseIntegratedHandler.patch proposed for upstream merge
|
2014-06-21 01:13:07 +02:00
|
|
|
Patch2: suseIntegratedHandler.patch
|
2014-01-04 18:43:26 +01:00
|
|
|
Patch3: setupSUSEsysVInit.diff
|
2014-06-24 21:29:50 +02:00
|
|
|
# FIXME openSUSEhostsTemplate.diff proposed for upstream merge
|
2014-03-19 22:38:02 +01:00
|
|
|
Patch5: openSUSEhostsTemplate.diff
|
2014-06-24 21:29:50 +02:00
|
|
|
# FIXME dynamicInitCmd.patch proposed for upstream merge
|
|
|
|
Patch6: dynamicInitCmd.diff
|
2014-08-11 17:58:55 +02:00
|
|
|
Patch9: cloud-init-no-dmidecode-on-ppc64.patch
|
2014-09-17 09:17:45 +02:00
|
|
|
Patch10: cloud-init-no-user-lock-if-already-locked.patch
|
2015-02-24 16:55:16 +01:00
|
|
|
Patch11: dataSourceOpenNebula.patch
|
2015-04-13 17:57:34 +02:00
|
|
|
Patch12: fix-default-systemd-unit-dir.patch
|
2016-05-03 23:50:58 +02:00
|
|
|
Patch14: cloud-init-finalbeforelogin.patch
|
2016-06-13 15:10:49 +02:00
|
|
|
# python2 disables SIGPIPE, causing broken pipe errors in shell scripts (bsc#903449)
|
|
|
|
Patch20: cloud-init-python2-sigpipe.patch
|
2016-09-13 18:56:10 +02:00
|
|
|
Patch21: cloud-init-net-eni.patch
|
|
|
|
Patch22: cloud-init-service.patch
|
2016-09-15 18:41:25 +02:00
|
|
|
Patch23: cloud-init-fix-unicode-handling-binarydecode.patch
|
2016-10-11 17:44:56 +02:00
|
|
|
# From upstream patch
|
|
|
|
Patch24: cloud-init-handle-no-carrier.patch
|
2013-07-19 16:51:15 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: filesystem
|
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: python-setuptools
|
2015-04-13 17:57:34 +02:00
|
|
|
# pkg-config is needed to find correct systemd unit dir
|
|
|
|
BuildRequires: pkg-config
|
2014-06-24 21:29:50 +02:00
|
|
|
Requires: bash
|
|
|
|
Requires: file
|
2014-03-17 18:58:53 +01:00
|
|
|
Requires: growpart
|
2015-02-05 11:18:48 +01:00
|
|
|
Requires: e2fsprogs
|
2014-06-24 21:29:50 +02:00
|
|
|
Requires: openssh
|
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
|
2015-10-06 13:01:33 +02:00
|
|
|
Requires: python-Jinja2
|
2014-01-20 18:51:58 +01:00
|
|
|
Requires: python-jsonpatch
|
2016-09-15 18:41:25 +02:00
|
|
|
Requires: python-oauthlib
|
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
|
2016-09-15 18:41:25 +02:00
|
|
|
Requires: python-setuptools
|
2013-05-07 15:10:36 +02:00
|
|
|
Requires: python-xml
|
2014-06-24 21:29:50 +02:00
|
|
|
Requires: sudo
|
|
|
|
Requires: util-linux
|
2013-04-26 07:12:13 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%define docdir %{_defaultdocdir}/%{name}
|
2014-06-24 21:50:04 +02:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
|
|
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
2015-04-27 14:30:28 +02:00
|
|
|
%ifarch %ix86 x86_64
|
2014-07-28 17:40:40 +02:00
|
|
|
Requires: pmtools
|
2015-04-27 14:30:28 +02:00
|
|
|
%endif
|
2014-06-24 21:50:04 +02:00
|
|
|
%else
|
2014-08-11 17:58:55 +02:00
|
|
|
%ifarch %ix86 x86_64
|
2014-07-28 17:40:40 +02:00
|
|
|
Requires: dmidecode
|
2014-08-11 17:58:55 +02:00
|
|
|
%endif
|
2013-04-26 07:12:13 +02:00
|
|
|
%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
|
2014-06-24 21:29:50 +02:00
|
|
|
Requires: systemd
|
2013-07-19 16:51:15 +02:00
|
|
|
%{?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
|
2014-06-24 21:29:50 +02:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} >= 1315
|
|
|
|
Requires: wicked-service
|
|
|
|
%else
|
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
|
|
|
Requires: sysconfig
|
|
|
|
%else
|
|
|
|
Requires: sysconfig-network
|
|
|
|
%endif
|
|
|
|
%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
|
2016-09-13 18:56:10 +02:00
|
|
|
%patch3
|
2014-03-19 22:38:02 +01:00
|
|
|
%patch5
|
2014-06-24 21:29:50 +02:00
|
|
|
%patch6
|
2016-09-13 18:56:10 +02:00
|
|
|
%patch9
|
2014-09-17 09:17:45 +02:00
|
|
|
%patch10 -p1
|
2016-09-13 18:56:10 +02:00
|
|
|
%patch11
|
2015-04-13 17:57:34 +02:00
|
|
|
%patch12
|
2016-05-03 23:50:58 +02:00
|
|
|
%patch14
|
2016-09-13 18:56:10 +02:00
|
|
|
%patch20
|
|
|
|
%patch21
|
|
|
|
%patch22
|
2016-09-15 18:41:25 +02:00
|
|
|
%patch23
|
2016-10-11 17:44:56 +02:00
|
|
|
%patch24
|
2014-03-19 22:38:02 +01:00
|
|
|
|
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
|
|
|
|
|
|
|
|
%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
|
2014-06-26 20:54:36 +02:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1110
|
|
|
|
mkdir %{buildroot}/%{_sysconfdir}/rsyslog.d
|
|
|
|
cp -a %{SOURCE2} %{buildroot}/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
|
|
|
|
%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/
|
2016-09-13 18:56:10 +02:00
|
|
|
%{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
|
|
|
|
%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
|
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
|
2016-09-13 18:56:10 +02:00
|
|
|
%{systemd_prefix}/systemd/system-generators/cloud-init-generator
|
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
|
2016-09-13 18:56:10 +02:00
|
|
|
%{systemd_prefix}/systemd/system/cloud-init.target
|
2013-07-19 16:51:15 +02:00
|
|
|
%{systemd_prefix}/systemd/system/cloud-final.service
|
2013-06-18 10:29:23 +02:00
|
|
|
%endif
|
2014-06-26 20:54:36 +02:00
|
|
|
%if 0%{?suse_version} && 0%{?suse_version} > 1110
|
2014-07-28 17:55:33 +02:00
|
|
|
%dir %{_sysconfdir}/rsyslog.d
|
2014-06-26 20:54:36 +02:00
|
|
|
%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
|
|
|
|
%endif
|
2016-09-13 18:56:10 +02:00
|
|
|
/lib/udev/rules.d/66-azure-ephemeral.rules
|
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}
|
2016-09-13 18:56:10 +02:00
|
|
|
%dir /etc/NetworkManager
|
|
|
|
%dir /etc/NetworkManager/dispatcher.d
|
|
|
|
%dir /etc/dhcp
|
|
|
|
%dir /etc/dhcp/dhclient-exit-hooks.d
|
|
|
|
%dir /lib/udev
|
|
|
|
%dir /lib/udev/rules.d
|
2014-07-28 17:55:33 +02:00
|
|
|
|
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
|