Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RPM spec file and Upstart file. Fix novnc in console
- Loading branch information
1 parent
169e0f0
commit c5d18a5
Showing
5 changed files
with
148 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
description "WebVirtManager" | ||
author "Edoardo Spadoni <edoardo.spadoni@nethesis.it>" | ||
|
||
start on started libvirtd | ||
stop on stopped libvirtd | ||
|
||
script | ||
export HOME="/usr/lib/python2.6/site-packages/webvirtmgr" | ||
export PYTHONPATH="$PYTHONPATH:/usr/lib/python2.6/site-packages/Django-1.5.6-py2.6.egg" | ||
export DJANGO_SETTINGS_MODULE="webvirtmgr.settings" | ||
exec $HOME/manage.py run_gunicorn -c $HOME/conf/gunicorn.conf.py | ||
end script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Installation through RPM | ||
======================== | ||
|
||
If you want you can install webvirtmgr through a rpm package. Under `deploy/rpmbuild/webvirtmgr.spec` you find the spec file to build the rpm. | ||
|
||
Tested on `CentOS 6.5`. | ||
|
||
### Build | ||
|
||
Using `mock` and `rpmdevtools` to create the rpm (`yum install mock rpm-build rpmdevtools` from `EPEL` ). | ||
|
||
##### User | ||
|
||
Add new mock user: | ||
|
||
```sh | ||
useradd <username> | ||
passwd <username> | ||
usermod -aG mock <username> | ||
``` | ||
|
||
Or editing existing users: | ||
|
||
```sh | ||
usermod -aG mock <username> && newgrp mock | ||
``` | ||
|
||
##### Get sources from repository | ||
|
||
```sh | ||
cd deploy/rpmbuild/ | ||
spectool -g webvirtmgr.spec | ||
``` | ||
|
||
##### Build the sources (src.rpm) | ||
|
||
```sh | ||
mock --resultdir=. --root epel-6-x86_64 --buildsrpm --spec webvirtmgr.spec --sources . | ||
``` | ||
|
||
##### Build rpm | ||
|
||
```sh | ||
mock --resultdir=. --root=epel-6-x86_64 --rebuild webvirtmgr-4.8.8-1.el6.src.rpm | ||
``` | ||
|
||
After this operations you have `webvirtmgr-4.8.8-1.el6.noarch.rpm`. To install it simply run: | ||
|
||
```sh | ||
yum localinstall webvirtmgr-4.8.8-1.el6.noarch.rpm | ||
``` | ||
|
||
### Files | ||
|
||
After the rpm installation, you can find the webvirtmgr files under `{python_sitelib}/webvirtmgr`. | ||
|
||
Set the correct bind parameter in file `{python_sitelib}/webvirtmgr/conf/gunicorn.conf.py`. | ||
|
||
In `CentOS 6.5` the path `{python_sitelib}` is usually `/usr/lib/python2.6/site-packages`. | ||
|
||
Upstart file | ||
============ | ||
|
||
If you want that webvirtmgr starts at boot, under `{python_sitelib}/webvirtmgr/conf/init/webvirtmgr-redhat.conf` there is the configuration file for upstart. The installation through rpm **launch** the app at boot. In fact the rpm installation copy the file `webvirtmgr-redhat.conf` in `/etc/init/`. | ||
|
||
If you don't want to start webvirtmgr at boot simply remove the `webvirtmgr-redhat.conf` file in `/etc/init/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
%global name webvirtmgr | ||
%global version 4.8.8 | ||
%global release 1 | ||
|
||
Name: %{name} | ||
Version: %{version} | ||
Release: %{release}%{?dist} | ||
Summary: WebVirtMgr panel for manage virtual machine | ||
|
||
License: Apache Licence, Version 2.0 | ||
URL: http://github.com/retspen/webvirtmgr | ||
Source0: https://github.com/retspen/webvirtmgr/archive/master.tar.gz | ||
|
||
BuildArch: noarch | ||
BuildRequires: python-setuptools | ||
|
||
Requires: python-setuptools libvirt-python libxml2-python python-websockify python-django15 python-gunicorn python-lockfile | ||
Requires: libvirt qemu-kvm | ||
|
||
%description | ||
WebVirtMgr is a libvirt-based Web interface for managing virtual machines. | ||
It allows you to create and configure new domains, and adjust a domain resource allocation. | ||
A VNC viewer presents a full graphical console to the guest domain. | ||
KVM is currently the only hypervisor supported. | ||
|
||
%prep | ||
%setup -n %{name}-master | ||
|
||
%build | ||
%{__python} setup.py build | ||
|
||
%install | ||
%{__python} setup.py install --skip-build --install-lib=%{python_sitelib}/%{name} --root $RPM_BUILD_ROOT | ||
cp -r templates $RPM_BUILD_ROOT%{python_sitelib}/%{name}/ | ||
cp -r webvirtmgr/static $RPM_BUILD_ROOT%{python_sitelib}/%{name}/ | ||
|
||
mkdir -p $RPM_BUILD_ROOT%{python_sitelib}/%{name}/conf | ||
cp conf/gunicorn.conf.py $RPM_BUILD_ROOT%{python_sitelib}/%{name}/conf/gunicorn.conf.py | ||
|
||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init | ||
cp conf/init/webvirtmgr-redhat.conf $RPM_BUILD_ROOT%{_sysconfdir}/init/webvirtmgr.conf | ||
|
||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d | ||
cp conf/initd/webvirtmgr-novnc-redhat $RPM_BUILD_ROOT%{_sysconfdir}/init.d/webvirtmgr-console | ||
|
||
cp manage.py $RPM_BUILD_ROOT%{python_sitelib}/%{name}/ | ||
rm -rf $RPM_BUILD_ROOT%{_bindir}/manage.py | ||
|
||
%post | ||
/sbin/chkconfig --add webvirtmgr-console | ||
|
||
%clean | ||
rm -rf $RPM_BUILD_ROOT | ||
|
||
%files | ||
%defattr(-,root,root) | ||
%{python_sitelib}/* | ||
%{_sysconfdir}/init/* | ||
%{_sysconfdir}/init.d/* | ||
|
||
%changelog | ||
* Wed Jan 26 2015 Edoardo Spadoni <edoardo.spadoni@nethesis.it> - 4.8.8 | ||
- first version |