4907847
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
4907847
4907847
Name:           cloud-init
2f7ad55
Version:        0.6.3
3c73e4f
Release:        0.4.bzr532%{?dist}
dace9fa
Summary:        Cloud instance init scripts
4907847
4907847
Group:          System Environment/Base
4907847
License:        GPLv3
4907847
URL:            http://launchpad.net/cloud-init
2f7ad55
# bzr export -r 532 cloud-init-0.6.3-bzr532.tar.gz lp:cloud-init
2f7ad55
Source0:        %{name}-%{version}-bzr532.tar.gz
4907847
Source1:        cloud-init-fedora.cfg
4907847
Source2:        cloud-init-README.fedora
2f7ad55
Patch0:         cloud-init-0.6.3-fedora.patch
1829b52
# Make runparts() work on Fedora
1829b52
# https://bugs.launchpad.net/cloud-init/+bug/934404
1829b52
Patch1:         cloud-init-0.6.3-no-runparts.patch
Andy Grimm 83d60c4
# https://bugs.launchpad.net/cloud-init/+bug/970071
Andy Grimm 83d60c4
Patch2:         cloud-init-0.6.3-lp970071.patch
d1b4930
# Add support for installing packages with yum
7dfb056
Patch3:         cloud-init-0.6.3-yum.patch
4a01ffd
# https://bugzilla.redhat.com/show_bug.cgi?id=850916
4a01ffd
# https://bugs.launchpad.net/cloud-init/+bug/1040200
4a01ffd
# http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/635
4a01ffd
Patch4:         cloud-init-0.6.3-fqdn.patch
1e6bbb9
# Kill off timeouts for when users' cloud-config jobs take > 90s to finish
1e6bbb9
# https://bugzilla.redhat.com/show_bug.cgi?id=836269
1e6bbb9
Patch5:         cloud-init-0.6.3-systemd-timeout.patch
26a577b
# Send output to console so euca-get-console-output works
26a577b
# https://bugzilla.redhat.com/show_bug.cgi?id=854654
26a577b
Patch6:         cloud-init-0.6.3-systemd-stdout.patch
4907847
4907847
BuildArch:      noarch
4907847
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
4907847
4907847
BuildRequires:  python-devel
4907847
BuildRequires:  python-setuptools-devel
4907847
BuildRequires:  systemd-units
4907847
Requires:       e2fsprogs
4907847
Requires:       iproute
4907847
Requires:       libselinux-python
4907847
Requires:       net-tools
4907847
Requires:       procps
4907847
Requires:       python-boto
4907847
Requires:       python-cheetah
4907847
Requires:       python-configobj
4907847
Requires:       PyYAML
a6c1636
Requires:       rsyslog
4907847
Requires:       shadow-utils
4907847
Requires:       xfsprogs
a6c1636
Requires:       /usr/bin/run-parts
4907847
Requires(post):   systemd-units
4907847
Requires(preun):  systemd-units
4907847
Requires(postun): systemd-units
4907847
4907847
%description
4907847
Cloud-init is a set of init scripts for cloud instances.  Cloud instances
4907847
need special scripts to run during initialization to retrieve and install
4907847
ssh keys and to let the user run various scripts.
4907847
4907847
4907847
%prep
2f7ad55
%setup -q -n %{name}-%{version}-bzr532
2f7ad55
%patch0 -p0
1829b52
%patch1 -p0
Andy Grimm 83d60c4
%patch2 -p1
7dfb056
%patch3 -p1
4a01ffd
%patch4 -p1
1e6bbb9
%patch5 -p1
26a577b
%patch6 -p1
4907847
4907847
cp -p %{SOURCE2} README.fedora
4907847
4907847
4907847
%build
4907847
%{__python} setup.py build
4907847
4907847
4907847
%install
4907847
rm -rf $RPM_BUILD_ROOT
4907847
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
4907847
7ce36c0
for x in $RPM_BUILD_ROOT/%{_bindir}/*.py; do mv "$x" "${x%.py}"; done
4907847
chmod +x $RPM_BUILD_ROOT/%{python_sitelib}/cloudinit/SshUtil.py
7ce36c0
mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/cloud
4907847
4907847
# We supply our own config file since our software differs from Ubuntu's.
7ce36c0
cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/cloud/cloud.cfg
4907847
dace9fa
# Note that /etc/rsyslog.d didn't exist by default until F15.
dace9fa
# el6 request: https://bugzilla.redhat.com/show_bug.cgi?id=740420
7ce36c0
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d
7ce36c0
cp -p tools/21-cloudinit.conf $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
4907847
4907847
# Install the systemd bits
4907847
mkdir -p        $RPM_BUILD_ROOT/%{_unitdir}
4907847
cp -p systemd/* $RPM_BUILD_ROOT/%{_unitdir}
4907847
4907847
4907847
%clean
4907847
rm -rf $RPM_BUILD_ROOT
4907847
4907847
4907847
%post
4907847
if [ $1 -eq 1 ] ; then
4907847
    # Initial installation
4907847
    # Enabled by default per "runs once then goes away" exception
4907847
    /bin/systemctl enable cloud-config.service     >/dev/null 2>&1 || :
4907847
    /bin/systemctl enable cloud-final.service      >/dev/null 2>&1 || :
4907847
    /bin/systemctl enable cloud-init.service       >/dev/null 2>&1 || :
4907847
    /bin/systemctl enable cloud-init-local.service >/dev/null 2>&1 || :
4907847
fi
4907847
4907847
%preun
4907847
if [ $1 -eq 0 ] ; then
4907847
    # Package removal, not upgrade
4907847
    /bin/systemctl --no-reload disable cloud-config.service >/dev/null 2>&1 || :
4907847
    /bin/systemctl --no-reload disable cloud-final.service  >/dev/null 2>&1 || :
4907847
    /bin/systemctl --no-reload disable cloud-init.service   >/dev/null 2>&1 || :
4907847
    /bin/systemctl --no-reload disable cloud-init-local.service >/dev/null 2>&1 || :
4907847
    # One-shot services -> no need to stop
4907847
fi
4907847
4907847
%postun
4907847
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
4907847
# One-shot services -> no need to restart
4907847
4907847
4907847
%files
4907847
%doc ChangeLog LICENSE TODO README.fedora
7ce36c0
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
7ce36c0
%dir               %{_sysconfdir}/cloud/cloud.cfg.d
7ce36c0
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
7ce36c0
%doc               %{_sysconfdir}/cloud/cloud.cfg.d/README
7ce36c0
%dir               %{_sysconfdir}/cloud/templates
7ce36c0
%config(noreplace) %{_sysconfdir}/cloud/templates/*
4907847
%{_unitdir}/cloud-config.service
4907847
%{_unitdir}/cloud-config.target
4907847
%{_unitdir}/cloud-final.service
4907847
%{_unitdir}/cloud-init-local.service
4907847
%{_unitdir}/cloud-init.service
4907847
%{python_sitelib}/*
4907847
%{_libexecdir}/%{name}
7ce36c0
%{_bindir}/cloud-init*
7ce36c0
%doc %{_datadir}/doc/%{name}
7ce36c0
%dir %{_sharedstatedir}/cloud
4907847
7ce36c0
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
4907847
4907847
4907847
%changelog
4a01ffd
* Thu Sep 13 2012 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.3-0.4.bzr532
4a01ffd
- Use a FQDN (instance-data.) for instance data URL fallback [RH:850916 LP:1040200]
1e6bbb9
- Shut off systemd timeouts [RH:836269]
26a577b
- Send output to the console [RH:854654]
4a01ffd
3c73e4f
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-0.4.bzr532
3c73e4f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
3c73e4f
7dfb056
* Wed Jun 27 2012 Pádraig Brady <P@draigBrady.com> - 0.6.3-0.3.bzr532
7dfb056
- Add support for installing yum packages
7dfb056
Andy Grimm 83d60c4
* Sat Mar 31 2012 Andy Grimm <agrimm@gmail.com> - 0.6.3-0.2.bzr532
Andy Grimm 83d60c4
- Fixed incorrect interpretation of relative path for
Andy Grimm 83d60c4
  AuthorizedKeysFile (BZ #735521)
Andy Grimm 83d60c4
2f7ad55
* Mon Mar  5 2012 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.3-0.1.bzr532
2f7ad55
- Rebased against upstream rev 532
1829b52
- Fixed runparts() incompatibility with Fedora
2f7ad55
0c4c3ba
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-0.8.bzr457
0c4c3ba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
0c4c3ba
87f3319
* Wed Oct  5 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.7.bzr457
87f3319
- Disabled SSH key-deleting on startup
87f3319
a2171c6
* Wed Sep 28 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.6.bzr457
a2171c6
- Consolidated selinux file context patches
56f9947
- Fixed cloud-init.service dependencies
f354744
- Updated sshkeytypes patch
974de09
- Dealt with differences from Ubuntu's sshd
a2171c6
ae2090c
* Sat Sep 24 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.5.bzr457
655e316
- Rebased against upstream rev 457
a6c1636
- Added missing dependencies
655e316
7ce36c0
* Fri Sep 23 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.4.bzr450
7ce36c0
- Added more macros to the spec file
7ce36c0
3135871
* Fri Sep 23 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.3.bzr450
3135871
- Fixed logfile permission checking
f3b8d56
- Fixed SSH key generation
1d49adc
- Fixed a bad method call in FQDN-guessing [LP:857891]
924e2ab
- Updated localefile patch
c338482
- Disabled the grub_dpkg module
de68608
- Fixed failures due to empty script dirs [LP:857926]
3135871
c29b445
* Fri Sep 23 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.2.bzr450
c29b445
- Updated tzsysconfig patch
c29b445
4907847
* Wed Sep 21 2011 Garrett Holmstrom <gholms@fedoraproject.org> - 0.6.2-0.1.bzr450
4907847
- Initial packaging