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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define component cloud-init
|
|
|
|
|
|
|
|
Name: %{component}
|
|
|
|
Version: 0.6.3
|
|
|
|
Release: 0
|
|
|
|
Summary: Cloud node initialization tool
|
2013-05-07 15:10:36 +02:00
|
|
|
License: GPL-3.0
|
2013-04-26 07:12:13 +02:00
|
|
|
Group: System/Management
|
2013-05-07 15:10:36 +02:00
|
|
|
Url: http://launchpad.net/cloud-init/
|
2013-04-26 07:12:13 +02:00
|
|
|
Source0: %{component}-%{version}.tar.bz2
|
|
|
|
Source1: cloud.cfg.suse
|
|
|
|
Source2: cloud-init.init
|
|
|
|
Patch0: drop-MAAS-datasource.diff
|
|
|
|
Patch1: drop-python27-only-code.diff
|
|
|
|
Patch2: drop-ubuntu-default-username.diff
|
2013-05-07 15:10:36 +02:00
|
|
|
# backport fix from upstream version 0.7.1 for bug bnc#818306
|
|
|
|
Patch3: relative-authorized-keys-file.diff
|
|
|
|
Requires: python-boto
|
|
|
|
Requires: python-cheetah
|
|
|
|
Requires: python-xml
|
|
|
|
Requires: python-yaml
|
|
|
|
BuildRequires: filesystem
|
2013-04-26 07:12:13 +02:00
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: python-setuptools
|
|
|
|
#BuildRequires: python-distribute
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%define docdir %{_defaultdocdir}/%{name}
|
|
|
|
|
|
|
|
%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()")}
|
|
|
|
%else
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%{py_requires}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Cloud-init is an init script that initializes a cloud node (VM)
|
|
|
|
according to the fetched configuration data from the admin node.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Scott Moser <scott.moser@canonical.com>
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{component}-%{version}
|
|
|
|
%patch0 -p1
|
|
|
|
%if 0%{?suse_version} <= 1130
|
|
|
|
%patch1 -p1
|
|
|
|
# disable ecdsa for SLE 11 (not available)
|
|
|
|
echo "ssh_genkeytypes: ['rsa', 'dsa']" >> %{S:1}
|
|
|
|
%endif
|
|
|
|
%patch2 -p1
|
2013-05-07 15:10:36 +02:00
|
|
|
%patch3 -p1
|
2013-04-26 07:12:13 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
python setup.py build
|
|
|
|
|
|
|
|
%install
|
|
|
|
python setup.py install --skip-build --root=%{buildroot} --prefix=%{_prefix} --record-rpm=INSTALLED_FILES --install-lib=%{python_sitelib}
|
|
|
|
find %{buildroot} \( -name .gitignore -o -name .placeholder \) -delete
|
|
|
|
mv %{buildroot}/%{_sysconfdir}/init %{buildroot}/%{_sysconfdir}/cloud/
|
|
|
|
# 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}
|
|
|
|
mv %{buildroot}/usr/share/doc/%{component} %{buildroot}%{docdir}
|
|
|
|
cp -a %{S:1} %{buildroot}/%{_sysconfdir}/cloud/cloud.cfg
|
|
|
|
mkdir -p %{buildroot}/%{_initddir} %{buildroot}/%{_sbindir}
|
|
|
|
cp -a %SOURCE2 %{buildroot}/%{_initddir}/%{component}
|
|
|
|
ln -s %{_initddir}/%{component} %{buildroot}/%{_sbindir}/rc%{component}
|
|
|
|
|
|
|
|
# remove debian/ubuntu specific profile.d file (bnc#779553)
|
|
|
|
rm -f %{buildroot}%{_sysconfdir}/profile.d/Z99-cloud-locale-test.sh
|
|
|
|
|
|
|
|
# remove duplicate files
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
%fdupes %{buildroot}%{python_sitelib}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{python_sitelib}/cloudinit
|
|
|
|
%{python_sitelib}/cloud_init*egg-info
|
|
|
|
%{_bindir}/cloud-init
|
|
|
|
%{_bindir}/cloud-init-per
|
|
|
|
%{_bindir}/cloud-init-cfg
|
|
|
|
%{_sbindir}/rc%{component}
|
|
|
|
%config(noreplace) %{_sysconfdir}/cloud/
|
|
|
|
%doc %{docdir}
|
|
|
|
/usr/lib/cloud-init
|
|
|
|
%attr(0755, root, root) %{_initddir}/%{component}
|
|
|
|
%dir %attr(0755, root, root) %{_localstatedir}/lib/cloud
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
%changelog
|