Better Makefile build, and fixes in spec file.
Stephen Soltesz [Wed, 18 May 2011 00:17:31 +0000 (00:17 +0000)]
Makefile
myops.spec

index 3e7a7d6..d8bc8ad 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,8 +12,12 @@ main.FILE    := myops-1.0.tar.bz2
 # Thierry - when called from within the build, PWD is /build
 SOURCEFILES := $(main.FILE)
 
+all: rpm
+
 $(main.FILE): #FORCE
        rm -f myops-1.0.tar.bz2
+       ( test -d $(PWD)/../myops-1.0 &&  unlink $(PWD)/../myops-1.0/ ) || echo "none"
+       ln -s $(PWD) $(PWD)/../myops-1.0
        tar -jchvf myops-1.0.tar.bz2 -C ../  myops-1.0
        @echo "hello"
 
@@ -36,4 +40,6 @@ rpm: sources
 
 clean:
        rm -f *.rpm *.tgz *.bz2 *.gz
-       rm *.pyc *.dat *.log
+       rm -rf myops-1.0
+       unlink $(PWD)/../myops-1.0
+       rm -f *.pyc *.dat *.log
index 9647ed4..28b623a 100644 (file)
@@ -62,30 +62,29 @@ Server side services
 rm -rf $RPM_BUILD_ROOT
 
 
-#################### SERVER
-echo "Reminder: open ports 8139,8140,8141 in iptables"
+# setup directories
 install -d $RPM_BUILD_ROOT/usr/share/%{name}
 install -d $RPM_BUILD_ROOT/etc/puppet/manifests
 install -d $RPM_BUILD_ROOT/etc/puppet/bin
 install -d $RPM_BUILD_ROOT/etc/cron.hourly
 install -d $RPM_BUILD_ROOT/var/lib/puppet
 
+# server
 rsync -a ./puppet  $RPM_BUILD_ROOT/usr/share/myops/
-
-# Generate an autosign list from plc node hostnames
 install -D -m 755 puppet/cron.d/autosign.plcsh $RPM_BUILD_ROOT/%{_sysconfdir}/cron.hourly/
 install -D -m 755 puppet/server/bin/node_classifier $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/bin/
 install -D -m 644 puppet/server/manifests/site.pp $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/manifests/
 install -D -m 644 puppet/server/puppetmaster.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
-install -D -m 644 puppet/client/hardcoded.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
 
+# client
+install -D -m 644 puppet/client/hardcoded.conf $RPM_BUILD_ROOT/%{_sysconfdir}/puppet
 rsync -ar ./puppet/server/modules $RPM_BUILD_ROOT/%{_sysconfdir}/puppet/
 
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files puppet-server
+%files server
 %defattr(-,root,root)
 /%{_sysconfdir}/cron.hourly/autosign.plcsh
 /%{_sysconfdir}/puppet/bin/node_classifier
@@ -93,12 +92,13 @@ rm -rf $RPM_BUILD_ROOT
 /%{_sysconfdir}/puppet/puppetmaster.conf
 /%{_sysconfdir}/puppet/modules
 
-%files puppet-client
+%files client
 %defattr(-,root,root)
 /%{_sysconfdir}/puppet/hardcoded.conf
 /usr/share/%{name}
 
 %post server
+echo "Reminder: open ports 8139,8140,8141 in iptables"
 chkconfig --add puppetmaster
 chkconfig puppetmaster on