summaryrefslogtreecommitdiffstats
path: root/genome-autostarter
diff options
context:
space:
mode:
authorChris Alfonso <calfonso@redhat.com>2008-07-07 17:20:43 -0400
committerChris Alfonso <calfonso@redhat.com>2008-07-08 10:43:59 -0400
commit40598cb7bfeb6b1042482fe91701770b179c1803 (patch)
tree57d9b019a845fbcf4a7fcb8ccbce836bfc45174c /genome-autostarter
parent9b9d481f6684777e90bb144193251244d14926ae (diff)
downloadtools-40598cb7bfeb6b1042482fe91701770b179c1803.tar.gz
tools-40598cb7bfeb6b1042482fe91701770b179c1803.tar.xz
tools-40598cb7bfeb6b1042482fe91701770b179c1803.zip
Renaming everying everest to genome
Diffstat (limited to 'genome-autostarter')
-rw-r--r--genome-autostarter/Makefile36
-rw-r--r--genome-autostarter/genome-autostarter.spec37
-rw-r--r--genome-autostarter/repo/genome-autostarter2
3 files changed, 75 insertions, 0 deletions
diff --git a/genome-autostarter/Makefile b/genome-autostarter/Makefile
new file mode 100644
index 0000000..846e15c
--- /dev/null
+++ b/genome-autostarter/Makefile
@@ -0,0 +1,36 @@
+NAME := genome-autostarter
+SPECFILE = $(NAME).spec
+VERSION := $(shell rpm -q --qf "%{VERSION}\n" --specfile $(SPECFILE)| head -1)
+RELEASE := $(shell rpm -q --qf "%{RELEASE}\n" --specfile $(SPECFILE)| head -1)
+UPSTREAM_NAME = $(PROJECT)
+
+TAG = $(subst .,_,$(NAME)-$(VERSION)-$(RELEASE))
+
+CVS = cvs
+RPMBUILD = rpmbuild
+INSTALL = /usr/bin/install
+INSTALL_DIR = $(INSTALL) --verbose -d -m 755
+ARCHIVE = $(NAME)-bin.tar.gz
+
+RPM_TOPDIR = /tmp/$(NAME)-$(VERSION)-$(RELEASE)-build
+_RPM_OPTS = --define "_topdir $(RPM_TOPDIR)" \
+ --define "_builddir %{_topdir}" \
+ --define "_sourcedir $(shell pwd)" \
+ --define "_specdir $(shell pwd)" \
+ --define "_rpmdir $(shell pwd)" \
+ --define "_srcrpmdir $(shell pwd)" \
+ --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
+RPM_OPTS = $(strip $(_RPM_OPTS))
+
+rpm: clean $(RPM_TOPDIR) $(SPECFILE) $(ARCHIVE)
+ $(RPMBUILD) --clean $(RPM_OPTS) -bb $(SPECFILE)
+ rm -f $(ARCHIVE)
+
+clean:
+ @rm -rfv *~ *.rpm $(RPM_TOPDIR) $(ARCHIVE)
+
+$(ARCHIVE):
+ cd repo; tar cvzf ../$(ARCHIVE) ./*; cd ..
+
+$(RPM_TOPDIR):
+ @$(INSTALL_DIR) $@
diff --git a/genome-autostarter/genome-autostarter.spec b/genome-autostarter/genome-autostarter.spec
new file mode 100644
index 0000000..df0fb6c
--- /dev/null
+++ b/genome-autostarter/genome-autostarter.spec
@@ -0,0 +1,37 @@
+Summary: Genome virtual machine autostarter
+Name: genome-autostarter
+Source: genome-autostarter-bin.tar.gz
+Version: 1.0.0
+Release: 1
+BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+Group: Applications/System
+URL: https://fedorahosting.org/genome
+License: GPLv2
+
+%description
+Genome virtual machine autostarter
+
+%prep
+
+%setup -c
+
+%build
+
+%install
+# Cleaning up the build root
+rm -rf $RPM_BUILD_ROOT
+
+# Create the directory structure required to lay down our files
+mkdir -p $RPM_BUILD_ROOT/etc/cron.d
+
+cp -R . $RPM_BUILD_ROOT/etc/cron.d
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+/etc/cron.d/genome-autostarter
+
+%doc
diff --git a/genome-autostarter/repo/genome-autostarter b/genome-autostarter/repo/genome-autostarter
new file mode 100644
index 0000000..e5147ce
--- /dev/null
+++ b/genome-autostarter/repo/genome-autostarter
@@ -0,0 +1,2 @@
+# Runs every minute and makes sure all the auto started vms are running
+* * * * * root find /etc/xen/auto -name "*" -type l | xargs -n1 basename 2> /dev/null | xargs -n1 virsh start &> /dev/null