File openstack-novncproxy.spec of Package openstack-novncproxy
#
# spec file for package openstack-novncproxy
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: openstack-novncproxy
Version: 2012.1+git.1340678576.e5d5a7d
Release: 0
License: LGPL-3.0+ and LGPL-2.0+ and (GPL-2.0 or LGPL-2.1) and BSD and OFL-1.1 and CC-BY-SA-3.0
Summary: A webbased VNC proxy which integrates with openstack-nova
Url: https://github.com/openstack/noVNC
Group: Development/Languages/Python
Source0: noVNC-%{version}.tar.gz
Source1: %{name}.init
Source2: sysconfig.%{name}
Patch0: python-path.patch
# reverse patch, to support essex
# https://github.com/kanaka/noVNC/commit/90f18a8a960ae2e11b9d0188280be5d39553edc4.patch
Patch1: 90f18a8a-essex_rpc.patch
# reverse patch, to support essex
# https://github.com/kanaka/noVNC/commit/9e2351f5eb70df5f333299ea9829a14f23a78a70.patch
Patch2: 9e2351f5-essex_flags.patch
BuildRequires: openstack-nova
# we require logrotate and the /var/log/nova directory for logs defined
# in the openstack-nova package
Requires: openstack-nova
Requires: python >= 2.6.8
Requires: python-numpy
Obsoletes: noVNC < %{version}
Provides: noVNC = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
This package contains a VNC proxy service integrated with
openstack-nova.
%prep
%setup -q -n noVNC-%{version}
# we temporarily hack the python path in the nova-novncproxy bin until
# we can package the python modules better
%patch0 -p1
%patch1 -p1
%patch2 -p1
%post
%{fillup_and_insserv %{name}}
%restart_on_update %{name}
%preun
%stop_on_removal %{name}
%postun
%insserv_cleanup
%build
%install
install -d %{buildroot}%{_bindir}
mv utils/nova-novncproxy %{buildroot}%{_bindir}/
install -d %{buildroot}%{_localstatedir}/lib/nova/noVNC
chmod 755 utils/websocket.py
cp -av * %{buildroot}%{_localstatedir}/lib/nova/noVNC
install -d %{buildroot}%{_initddir}
install -d %{buildroot}%{_sbindir}
install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/%{name}
ln -s %{_initddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}
find %{buildroot}%{_localstatedir}/lib/nova/noVNC -name "*.c" | xargs rm -f
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_var}/adm/fillup-templates/sysconfig.%{name}
%files
%defattr(-,root,root,-)
%{_initddir}/%{name}
%{_bindir}/nova-novncproxy
%{_sbindir}/rc%{name}
%{_localstatedir}/lib/nova/noVNC
%{_var}/adm/fillup-templates/sysconfig.%{name}
%changelog