[PATCH 3/3] Use install macro and adjust config perms

James Laska jlaska at redhat.com
Thu Dec 15 16:34:10 UTC 2011


Instead of using mkdir and cp directly, this patch uses the built-in rpm
%{__install} macro.  This allows specifying file permissions for the
desitination file on the same command.
---
 imagefactory.spec.in |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/imagefactory.spec.in b/imagefactory.spec.in
index 0667b8b..aec9e24 100644
--- a/imagefactory.spec.in
+++ b/imagefactory.spec.in
@@ -63,16 +63,16 @@ python setup.py build
 %install
 python setup.py install -O1 --root=%{buildroot} --skip-build
 
-mkdir -p %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
-mkdir -p %{buildroot}/%{_localstatedir}/lib/imagefactory/images
-mkdir -p %{buildroot}/%{_sysconfdir}/logrotate.d
+%{__install} -d %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
+%{__install} -d %{buildroot}/%{_localstatedir}/lib/imagefactory/images
+%{__install} -d %{buildroot}/%{_sysconfdir}/logrotate.d
 
 sed -i '/\/usr\/bin\/env python/d' %{buildroot}/%{python_sitelib}/imgfac/*.py
 
-cp conf/ec2_fedora_jeos_03_OCT_2011.conf %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
-cp conf/ec2_rhel_jeos_03_OCT_2011.conf %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
-cp conf/imagefactory.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/imagefactory
-cp conf/imagefactory.logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/imagefactory
+%{__install} conf/ec2_fedora_jeos_03_OCT_2011.conf %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
+%{__install} conf/ec2_rhel_jeos_03_OCT_2011.conf %{buildroot}/%{_sysconfdir}/imagefactory/jeos_images
+%{__install} -m0600 conf/imagefactory.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/imagefactory
+%{__install} -m0600 conf/imagefactory.logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/imagefactory
 
 %post
 /sbin/chkconfig --add %{name}
-- 
1.7.7.4




More information about the aeolus-devel mailing list