http://code.google.com/p/emt/source/detail?r=211
Added:
/trunk/emt.spec.template
Deleted:
/trunk/emt.spec
Modified:
/trunk/scripts/build_rpm.sh
=======================================
--- /dev/null
+++ /trunk/emt.spec.template Fri Aug 20 15:27:38 2010
@@ -0,0 +1,85 @@
+Name: emt
+Version: 0.2
+Release: %release%
+Group: ProcenScaling/Monitoring
+License: GPL
+Summary: Eric's Monitoring Tool
+Buildroot: /tmp/emt_buildroot/
+Packager: Eric Bergen <er...@provenscaling.com>
+BuildArch: noarch
+Requires: gmp >= 4.1.4 sysstat >= 5.0.5
+Requires: /usr/bin/php
+
+%files
+%defattr(-,root,root,0755)
+/opt/emt
+%attr(0644,root,root) /etc/cron.d/emt.cron
+
+%description
+A php based framework for collecting and viewing system performance
statistics
+%post
+#make sure crond reloads
+touch /etc/cron.d/emt.cron
+mkdir -p /etc/emt.d
+if [ ! -e /usr/local/bin/emt_view ]; then
+ echo "Creating link to /usr/local/bin/emt_view"
+ ln -s /opt/emt/bin/emt_view /usr/local/bin/emt_view
+fi
+
+if [ ! -e /usr/local/bin/emt_awk ]; then
+ echo "Creating link to /usr/local/bin/emt_awk"
+ ln -s /opt/emt/bin/emt_awk /usr/local/bin/emt_awk
+fi
+
+if [ ! -e /usr/local/bin/emt_dump_conf ]; then
+ echo "Creating link to /usr/local/bin/emt_dump_conf"
+ ln -s /opt/emt/bin/emt_dump_conf /usr/local/bin/emt_dump_conf
+fi
+
+if [ ! -e /usr/local/bin/emt_nsca ]; then
+ echo "Creating link to /usr/local/bin/emt_nsca"
+ ln -s /opt/emt/bin/emt_nsca /usr/local/bin/emt_nsca
+fi
+
+groupadd -r emt 2> /dev/null
+#The crontab errors if the user doesn't have a home dir so we create it
here.
+#If you see this and know how to fix it please file a bug.
+useradd -m -r emt -c "EMT" -g emt 2> /dev/null
+#This is a fix for emt running as root.
+if [ -e /var/tmp/emt ]; then chown emt: /var/tmp/emt; fi
+
+#Set up a default emt.cnf so emt will actually do something on a default
+#install even if people don't install a plugin
+if [ ! -e /etc/emt.cnf ]; then
+ echo "Copying a sample config file to /etc/emt.cnf"
+ cp /opt/emt/sample/emt.cnf /etc/
+
+ #If emt.cnf doesn't exist and the sys plugin doesn't exist assume
+ #this is a new install and copy the sys conf file so emt will
+ #collect system stats
+ if [ ! -e /etc/emt.d/emt_sys.cnf ]; then
+ echo "Copying the system stats conf file to /etc/emt.d/emt_sys.cnf"
+ cp /opt/emt/plugins/configuration/emt_sys.cnf /etc/emt.d/
+ fi
+fi
+
+if [ ! -e /etc/emt.cnf ]; then echo "WARNING! /etc/emt.cnf does not
exist."; echo "EMT will not gather data until you create a valid
/etc/emt.cnf file."; fi
+
+echo "The emt_view command will likely having missing data until you
specify correct interfaces and disks in /opt/emt/plugins/views/default.php."
+
+%pre
+if [ -e /usr/local/bin/emt_view ]; then
+ rm /usr/local/bin/emt_view
+fi
+
+if [ -e /usr/local/bin/emt_awk ]; then
+ rm /usr/local/bin/emt_awk
+fi
+
+if [ -e /usr/local/bin/emt_dump_conf ]; then
+ rm /usr/local/bin/emt_dump_conf
+fi
+
+if [ -e /usr/local/bin/emt_nsca ]; then
+ rm /usr/local/bin/emt_nsca
+fi
=======================================
--- /trunk/emt.spec Fri Aug 20 15:22:25 2010
+++ /dev/null
@@ -1,85 +0,0 @@
-Name: emt
-Version: 0.2
-Release: 108
-Group: ProcenScaling/Monitoring
-License: GPL
-Summary: Eric's Monitoring Tool
-Buildroot: /tmp/emt_buildroot/
-Packager: Eric Bergen <er...@provenscaling.com>
-BuildArch: noarch
-Requires: gmp >= 4.1.4 sysstat >= 5.0.5
-Requires: /usr/bin/php
-
-%files
-%defattr(-,root,root,0755)
-/opt/emt
-%attr(0644,root,root) /etc/cron.d/emt.cron
-
-%description
-A php based framework for collecting and viewing system performance
statistics
-%post
-#make sure crond reloads
-touch /etc/cron.d/emt.cron
-mkdir -p /etc/emt.d
-if [ ! -e /usr/local/bin/emt_view ]; then
- echo "Creating link to /usr/local/bin/emt_view"
- ln -s /opt/emt/bin/emt_view /usr/local/bin/emt_view
-fi
-
-if [ ! -e /usr/local/bin/emt_awk ]; then
- echo "Creating link to /usr/local/bin/emt_awk"
- ln -s /opt/emt/bin/emt_awk /usr/local/bin/emt_awk
-fi
-
-if [ ! -e /usr/local/bin/emt_dump_conf ]; then
- echo "Creating link to /usr/local/bin/emt_dump_conf"
- ln -s /opt/emt/bin/emt_dump_conf /usr/local/bin/emt_dump_conf
-fi
-
-if [ ! -e /usr/local/bin/emt_nsca ]; then
- echo "Creating link to /usr/local/bin/emt_nsca"
- ln -s /opt/emt/bin/emt_nsca /usr/local/bin/emt_nsca
-fi
-
-groupadd -r emt 2> /dev/null
-#The crontab errors if the user doesn't have a home dir so we create it
here.
-#If you see this and know how to fix it please file a bug.
-useradd -m -r emt -c "EMT" -g emt 2> /dev/null
-#This is a fix for emt running as root.
-if [ -e /var/tmp/emt ]; then chown emt: /var/tmp/emt; fi
-
-#Set up a default emt.cnf so emt will actually do something on a default
-#install even if people don't install a plugin
-if [ ! -e /etc/emt.cnf ]; then
- echo "Copying a sample config file to /etc/emt.cnf"
- cp /opt/emt/sample/emt.cnf /etc/
-
- #If emt.cnf doesn't exist and the sys plugin doesn't exist assume
- #this is a new install and copy the sys conf file so emt will
- #collect system stats
- if [ ! -e /etc/emt.d/emt_sys.cnf ]; then
- echo "Copying the system stats conf file to /etc/emt.d/emt_sys.cnf"
- cp /opt/emt/plugins/configuration/emt_sys.cnf /etc/emt.d/
- fi
-fi
-
-if [ ! -e /etc/emt.cnf ]; then echo "WARNING! /etc/emt.cnf does not
exist."; echo "EMT will not gather data until you create a valid
/etc/emt.cnf file."; fi
-
-echo "The emt_view command will likely having missing data until you
specify correct interfaces and disks in /opt/emt/plugins/views/default.php."
-
-%pre
-if [ -e /usr/local/bin/emt_view ]; then
- rm /usr/local/bin/emt_view
-fi
-
-if [ -e /usr/local/bin/emt_awk ]; then
- rm /usr/local/bin/emt_awk
-fi
-
-if [ -e /usr/local/bin/emt_dump_conf ]; then
- rm /usr/local/bin/emt_dump_conf
-fi
-
-if [ -e /usr/local/bin/emt_nsca ]; then
- rm /usr/local/bin/emt_nsca
-fi
=======================================
--- /trunk/scripts/build_rpm.sh Sun Jun 13 17:29:04 2010
+++ /trunk/scripts/build_rpm.sh Fri Aug 20 15:27:38 2010
@@ -40,6 +40,12 @@
cp etc/cron.d/emt.cron $BUILDROOT/etc/cron.d/
+echo "Setting new version in spec file"
+
+VERSION=`svn info | grep Revision | awk '{ print $2 }'`
+echo $VERSION;
+sed "s/%release%/$VERSION/" < emt.spec.template > emt.spec;
+
if [ "$USE_RPM_BUILD_ROOT" = "y" ]; then
echo "%_topdir $BUILDROOT/rpmbuild" > ~/.rpmmacros;