File osc.spec of Package osc

#
# spec file for package osc (Version 0.120)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           osc
BuildRequires:  python-devel
Version:        0.118
Release:        7.1
Group:          Development/Tools/Other
License:        GPL v2 or later
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/python/osc/
# v=0.114; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/python/osc osc-$v && tar czf osc-$v.tar.gz osc-$v
Source:         osc-%{version}.tar.gz
Summary:        openSUSE (build service) commander
Requires:       python-urlgrabber
#
%if 0%{?suse_version}
%if %suse_version < 1020
BuildRequires:  python-elementtree
Requires:       python-elementtree
%else
BuildRequires:  python-xml
Requires:       python-xml
%endif
%if %suse_version > 1000
Recommends:     rpm-python
Recommends:     build > 2009.06.03
%endif
%endif
%if 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  python-elementtree
Requires:       python-elementtree
%endif
#
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%description
Commandline client for the openSUSE build service.

See http://en.opensuse.org/Build_Service/CLI , as well as
http://en.opensuse.org/Build_Service_Tutorial for a general
introduction.



Authors:
--------
    Peter Poeml <poeml@suse.de>

%prep
%setup -q

%build
CFLAGS="%{optflags}" \
%{__python} setup.py build

%install
%{__python} setup.py install --prefix=%{_prefix} --root %{buildroot}
ln -s osc-wrapper.py %{buildroot}/%{_bindir}/osc
mkdir -p %{buildroot}/var/lib/osc-plugins
mkdir -p %{buildroot}%{_prefix}/%{_lib}/osc
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
#install -m 0755 dist/osc.complete %{buildroot}%{_prefix}/%{_lib}/osc/complete
#install -m 0755 dist/complete.csh %{buildroot}%{_sysconfdir}/profile.d/osc.csh
#install -m 0755 dist/complete.sh %{buildroot}%{_sysconfdir}/profile.d/osc.sh

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%{_bindir}/osc*
%{python_sitelib}/*
#%{_sysconfdir}/profile.d/*
%dir %{_prefix}/%{_lib}/osc
#%{_prefix}/%{_lib}/osc/*
%dir /var/lib/osc-plugins
%doc AUTHORS README TODO NEWS
%doc %_mandir/man1/osc.*

openSUSE Build Service is sponsored by