File openstack-quantum.spec of Package openstack-quantum

#
# spec file for package openstack-quantum
#
# 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/
#


%bcond_with from_vcs
%bcond_with no_from_vcs

%if %{with from_vcs}
%define BUILD_FROM_VCS 1
%endif
%if %{with no_from_vcs}
%define BUILD_FROM_VCS 0
%endif

%if 0%{?BUILD_FROM_VCS}
%define vcs_summary_warn -- Git Snapshot
%else
%define vcs_summary_warn %null
%endif

Name:           openstack-quantum
Version:        0.1
Release:        0
License:        Apache-2.0 and GPL-3.0+
Summary:        A virtual network manager %{vcs_summary_warn}
Url:            https://github.com/openstack/quantum
Group:          Development/Languages/Python
%if 0%{?BUILD_FROM_VCS}
%define _tarball_name quantum-git-master
%else
%define _tarball_name openstack-quantum-ce2b509
%endif
Source0:        %{_tarball_name}.tar.gz
BuildRequires:  python-devel
BuildRequires:  python-setuptools
%if 0%{?BUILD_FROM_VCS}
BuildRequires:  python-virtualenv
%endif
Requires:       python-eventlet
Requires:       python-httplib2
Requires:       python-routes
Requires:       python-webob
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
%py_requires
%if 0%{?suse_version} > 1110
BuildArch:      noarch
%endif
%endif
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%description
A virtual network manager

%prep
%setup -q -n %{_tarball_name}

%build
CFLAGS="%{optflags}" python setup.py build

%install
%if 0%{?BUILD_FROM_VCS}
for i in common server client cisco_plugin openvswitch_plugin; do
  python setup_$i.py install --prefix=%{_prefix} --root=%{buildroot}
done
%else
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%endif

%files
%defattr(-,root,root,-)
%{python_sitelib}/*
%if 0%{?BUILD_FROM_VCS}
%{_bindir}/quantum
%{_bindir}/quantum-server
%{_initddir}/quantum-server
%dir %{_sysconfdir}/quantum
%{_sysconfdir}/quantum/plugins.ini
%{_sysconfdir}/quantum/quantum.conf
%{_sysconfdir}/quantum/quantum.conf.sample
%{_sysconfdir}/quantum/quantum.conf.test
%dir %{_sysconfdir}/quantum/plugins
%{_sysconfdir}/quantum/plugins/cisco/
%{_sysconfdir}/quantum/plugins/openvswitch/
%endif

%changelog
openSUSE Build Service is sponsored by