diff --git a/Makefile b/Makefile index 83a3058c..b9c23bf2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ NAME=koji SPECFILE = $(firstword $(wildcard *.spec)) -SUBDIRS = hub builder koji cli docs util www plugins +SUBDIRS = hub builder koji cli docs util www plugins vm ifdef DIST DIST_DEFINES := --define "dist $(DIST)" diff --git a/koji.spec b/koji.spec index c47bf054..a46e8050 100644 --- a/koji.spec +++ b/koji.spec @@ -81,6 +81,24 @@ Requires: createrepo >= 0.9.2 koji-builder is the daemon that runs on build machines and executes tasks that come through the Koji system. +%package vm +Summary: Koji virtual machine management daemon +Group: Applications/System +License: LGPLv2 +Requires: %{name} = %{version}-%{release} +Requires(post): /sbin/chkconfig +Requires(post): /sbin/service +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires: libvirt-python +Requires: libxml2-python +Requires: python-virtinst +Requires: qemu-img + +%description vm +koji-vm contains a supplemental build daemon that executes certain tasks in a +virtual machine. This package is not required for most installations. + %package utils Summary: Koji Utilities Group: Applications/Internet @@ -185,6 +203,26 @@ if [ $1 = 0 ]; then /sbin/chkconfig --del kojid fi +%files vm +%defattr(-,root,root) +%{_sbindir}/kojivmd +#dir %{_datadir}/kojivmd +%{_datadir}/kojivmd/kojikamid +%{_initrddir}/kojivmd +%config(noreplace) %{_sysconfdir}/sysconfig/kojivmd +%dir %{_sysconfdir}/kojivmd +%config(noreplace) %{_sysconfdir}/kojivmd/kojivmd.conf + +%post vm +/sbin/chkconfig --add kojivmd +/sbin/service kojivmd condrestart &> /dev/null || : + +%preun vm +if [ $1 = 0 ]; then + /sbin/service kojivmd stop &> /dev/null + /sbin/chkconfig --del kojivmd +fi + %post utils /sbin/chkconfig --add kojira /sbin/service kojira condrestart &> /dev/null || : diff --git a/vm/Makefile b/vm/Makefile new file mode 100644 index 00000000..6e959562 --- /dev/null +++ b/vm/Makefile @@ -0,0 +1,34 @@ + +BINFILES = kojivmd +SHAREFILES = kojikamid + +_default: + @echo "nothing to make. try make install" + +clean: + rm -f *.o *.so *.pyc *~ + + +install: + @if [ "$(DESTDIR)" = "" ]; then \ + echo " "; \ + echo "ERROR: A destdir is required"; \ + exit 1; \ + fi + + mkdir -p $(DESTDIR)/usr/sbin + install -p -m 755 $(BINFILES) $(DESTDIR)/usr/sbin + + mkdir -p $(DESTDIR)/usr/share/kojivmd + install -p -m 644 $(SHAREFILES) $(DESTDIR)/usr/share/kojivmd + + mkdir -p $(DESTDIR)/etc/rc.d/init.d + install -p -m 755 kojivmd.init $(DESTDIR)/etc/rc.d/init.d/kojivmd + + mkdir -p $(DESTDIR)/etc/sysconfig + install -p -m 644 kojivmd.sysconfig $(DESTDIR)/etc/sysconfig/kojivmd + + mkdir -p $(DESTDIR)/etc/kojivmd + install -p -m 644 kojivmd.conf $(DESTDIR)/etc/kojivmd/kojivmd.conf + + diff --git a/vm/kojivmd.sysconfig b/vm/kojivmd.sysconfig new file mode 100644 index 00000000..1d7af4d3 --- /dev/null +++ b/vm/kojivmd.sysconfig @@ -0,0 +1,3 @@ +FORCE_LOCK=Y +KOJIVMD_DEBUG=N +KOJIVMD_VERBOSE=Y