diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-07-09 16:41:45 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-07-09 16:41:45 -0400 |
commit | 75af023c864d1b6c4e48788b1b4cf7aad5eb2204 (patch) | |
tree | 2f79d479ee27ecb26faa94b91ea47e10b63c6612 /packages/redhat | |
parent | 50b9e8b7be096e331eb070c5c48d833b1756463c (diff) | |
download | vyos-cloud-init-75af023c864d1b6c4e48788b1b4cf7aad5eb2204.tar.gz vyos-cloud-init-75af023c864d1b6c4e48788b1b4cf7aad5eb2204.zip |
Revert back to using cheetah + adjust resultant code + templates
At this point there is a mixture of "double hash" cheetah comments and '#*'
cheetah comments.
Diffstat (limited to 'packages/redhat')
-rw-r--r-- | packages/redhat/cloud-init.spec | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/packages/redhat/cloud-init.spec b/packages/redhat/cloud-init.spec index 5dfb6b0d..35b27beb 100644 --- a/packages/redhat/cloud-init.spec +++ b/packages/redhat/cloud-init.spec @@ -1,3 +1,4 @@ +## 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 @@ -5,20 +6,21 @@ # Or: http://www.rpm.org/max-rpm/ch-rpm-inside.html Name: cloud-init -Version: {{version}} -Release: {{release}}%{?dist} +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}} +Source0: ${archive_name} BuildArch: noarch BuildRoot: %{_tmppath} BuildRequires: python-devel BuildRequires: python-setuptools +BuildRequires: python-cheetah # System util packages needed Requires: shadow-utils @@ -30,23 +32,23 @@ Requires: procps Requires: shadow-utils # Install pypi 'dynamic' requirements -{{for r in requires}} -Requires: {{r}} -{{endfor}} +#for $r in $requires +Requires: ${r} +#end for -{{if sysvinit}} +#if $sysvinit Requires(post): chkconfig Requires(postun): initscripts Requires(preun): chkconfig Requires(preun): initscripts -{{endif}} +#end if -{{if systemd}} +#if $systemd BuildRequires: systemd-units Requires(post): systemd-units Requires(postun): systemd-units Requires(preun): systemd-units -{{endif}} +#end if %description Cloud-init is a set of init scripts for cloud instances. Cloud instances @@ -54,89 +56,89 @@ 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}} +%setup -q -n %{name}-%{version}~${release} %build %{__python} setup.py build %install -rm -rf $RPM_BUILD_ROOT +rm -rf \$RPM_BUILD_ROOT %{__python} setup.py install -O1 \ - --skip-build --root $RPM_BUILD_ROOT \ - --init-system={{init_sys}} + --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 +mkdir -p \$RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d cp -p tools/21-cloudinit.conf \ - $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf + \$RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf %clean -rm -rf $RPM_BUILD_ROOT +rm -rf \$RPM_BUILD_ROOT %post -{{if systemd}} -if [ $1 -eq 1 ] +#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 -{{endif}} +#end if -{{if sysvinit}} +#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 -{{endif}} +#end if %preun -{{if sysvinit}} -if [ $1 -eq 0 ] +#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 + /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 -{{endif}} +#end if -{{if systemd}} -if [ $1 -eq 0 ] +#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 -{{endif}} +#end if %postun -{{if systemd}} +#if $systemd /bin/systemctl daemon-reload >/dev/null 2>&1 || : -{{endif}} +#end if %files -{{if sysvinit}} +#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 -{{endif}} +#end if -{{if systemd}} +#if $systemd %{_unitdir}/cloud-* -{{endif}} +#end if # Program binaries %{_bindir}/cloud-init* @@ -165,4 +167,4 @@ fi %changelog -{{changelog}} +${changelog} |