summaryrefslogtreecommitdiff
path: root/packages/redhat/cloud-init.spec.in
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-07-09 17:09:04 -0400
committerScott Moser <smoser@ubuntu.com>2012-07-09 17:09:04 -0400
commit48ec119bd68dfa090785db7758c542878ee5fc56 (patch)
tree32aebacd8123d12035564a53a115f277e90f3840 /packages/redhat/cloud-init.spec.in
parent39e038a6c1b3e273d22527c05a484626e51b8ed3 (diff)
downloadvyos-cloud-init-48ec119bd68dfa090785db7758c542878ee5fc56.tar.gz
vyos-cloud-init-48ec119bd68dfa090785db7758c542878ee5fc56.zip
fix bddeb and brpm: by renaming packaging files that are templates
In cherry picking the cheetah commit, I missed the rename of these files. packages/debian/changelog => packages/debian/changelog.in packages/debian/control => packages/debian/control.in packages/redhat/cloud-init.spec => packages/redhat/cloud-init.spec.in
Diffstat (limited to 'packages/redhat/cloud-init.spec.in')
-rw-r--r--packages/redhat/cloud-init.spec.in170
1 files changed, 170 insertions, 0 deletions
diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in
new file mode 100644
index 00000000..35b27beb
--- /dev/null
+++ b/packages/redhat/cloud-init.spec.in
@@ -0,0 +1,170 @@
+## This is a cheetah template
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+# See: http://www.zarb.org/~jasonc/macros.php
+# Or: http://fedoraproject.org/wiki/Packaging:ScriptletSnippets
+# Or: http://www.rpm.org/max-rpm/ch-rpm-inside.html
+
+Name: cloud-init
+Version: ${version}
+Release: ${release}%{?dist}
+Summary: Cloud instance init scripts
+
+Group: System Environment/Base
+License: GPLv3
+URL: http://launchpad.net/cloud-init
+
+Source0: ${archive_name}
+BuildArch: noarch
+BuildRoot: %{_tmppath}
+
+BuildRequires: python-devel
+BuildRequires: python-setuptools
+BuildRequires: python-cheetah
+
+# System util packages needed
+Requires: shadow-utils
+Requires: rsyslog
+Requires: iproute
+Requires: e2fsprogs
+Requires: net-tools
+Requires: procps
+Requires: shadow-utils
+
+# Install pypi 'dynamic' requirements
+#for $r in $requires
+Requires: ${r}
+#end for
+
+#if $sysvinit
+Requires(post): chkconfig
+Requires(postun): initscripts
+Requires(preun): chkconfig
+Requires(preun): initscripts
+#end if
+
+#if $systemd
+BuildRequires: systemd-units
+Requires(post): systemd-units
+Requires(postun): systemd-units
+Requires(preun): systemd-units
+#end if
+
+%description
+Cloud-init is a set of init scripts for cloud instances. Cloud instances
+need special scripts to run during initialization to retrieve and install
+ssh keys and to let the user run various scripts.
+
+%prep
+%setup -q -n %{name}-%{version}~${release}
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf \$RPM_BUILD_ROOT
+%{__python} setup.py install -O1 \
+ --skip-build --root \$RPM_BUILD_ROOT \
+ --init-system=${init_sys}
+
+# Note that /etc/rsyslog.d didn't exist by default until F15.
+# el6 request: https://bugzilla.redhat.com/show_bug.cgi?id=740420
+mkdir -p \$RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d
+cp -p tools/21-cloudinit.conf \
+ \$RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
+
+%clean
+rm -rf \$RPM_BUILD_ROOT
+
+%post
+
+#if $systemd
+if [ \$1 -eq 1 ]
+then
+ /bin/systemctl enable cloud-config.service >/dev/null 2>&1 || :
+ /bin/systemctl enable cloud-final.service >/dev/null 2>&1 || :
+ /bin/systemctl enable cloud-init.service >/dev/null 2>&1 || :
+ /bin/systemctl enable cloud-init-local.service >/dev/null 2>&1 || :
+fi
+#end if
+
+#if $sysvinit
+/sbin/chkconfig --add %{_initrddir}/cloud-init-local
+/sbin/chkconfig --add %{_initrddir}/cloud-init
+/sbin/chkconfig --add %{_initrddir}/cloud-config
+/sbin/chkconfig --add %{_initrddir}/cloud-final
+#end if
+
+%preun
+
+#if $sysvinit
+if [ \$1 -eq 0 ]
+then
+ /sbin/service cloud-init stop >/dev/null 2>&1 || :
+ /sbin/chkconfig --del cloud-init || :
+ /sbin/service cloud-init-local stop >/dev/null 2>&1 || :
+ /sbin/chkconfig --del cloud-init-local || :
+ /sbin/service cloud-config stop >/dev/null 2>&1 || :
+ /sbin/chkconfig --del cloud-config || :
+ /sbin/service cloud-final stop >/dev/null 2>&1 || :
+ /sbin/chkconfig --del cloud-final || :
+fi
+#end if
+
+#if $systemd
+if [ \$1 -eq 0 ]
+then
+ /bin/systemctl --no-reload disable cloud-config.service >/dev/null 2>&1 || :
+ /bin/systemctl --no-reload disable cloud-final.service >/dev/null 2>&1 || :
+ /bin/systemctl --no-reload disable cloud-init.service >/dev/null 2>&1 || :
+ /bin/systemctl --no-reload disable cloud-init-local.service >/dev/null 2>&1 || :
+fi
+#end if
+
+%postun
+
+#if $systemd
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+#end if
+
+%files
+
+#if $sysvinit
+%attr(0755, root, root) %{_initddir}/cloud-config
+%attr(0755, root, root) %{_initddir}/cloud-final
+%attr(0755, root, root) %{_initddir}/cloud-init-local
+%attr(0755, root, root) %{_initddir}/cloud-init
+#end if
+
+#if $systemd
+%{_unitdir}/cloud-*
+#end if
+
+# Program binaries
+%{_bindir}/cloud-init*
+
+# There doesn't seem to be an agreed upon place for these
+# although it appears the standard says /usr/lib but rpmbuild
+# will try /usr/lib64 ??
+/usr/lib/%{name}/uncloud-init
+/usr/lib/%{name}/write-ssh-key-fingerprints
+
+# Docs
+%doc TODO LICENSE ChangeLog Requires
+%doc %{_defaultdocdir}/cloud-init/*
+
+# Configs
+%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg
+%dir %{_sysconfdir}/cloud/cloud.cfg.d
+%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/*.cfg
+%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/README
+%dir %{_sysconfdir}/cloud/templates
+%config(noreplace) %{_sysconfdir}/cloud/templates/*
+%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
+
+# Python code is here...
+%{python_sitelib}/*
+
+%changelog
+
+${changelog}