File osc.spec of Package osc

# spec file for package osc
# Copyright (c) 2014 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

Name:           osc
Version:        0.148.1
Release:        0
Summary:        openSUSE Build Service Commander
License:        GPL-2.0+
Group:          Development/Tools/Other
Source:         %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?mandriva_version} < 02010
BuildRequires:  python-urlgrabber
Requires:       python-urlgrabber
BuildRequires:  python-devel
%if 0%{?mandriva_version}
BuildRequires:  python-rpm
Requires:       python-rpm
BuildRequires:  rpm-python
Requires:       rpm-python
%if 0%{?suse_version}
%if 0%{?suse_version} < 1020
BuildRequires:  python-elementtree
Requires:       python-elementtree
BuildRequires:  python-xml
Requires:       python-xml
%if 0%{?suse_version} > 1110
BuildArch:      noarch
%if 0%{?suse_version} > 1000
Recommends:     build >= 2010.05.04
# These packages are needed for "osc add $URL"
Recommends:     obs-service-recompress
Recommends:     obs-service-set_version
Recommends:     obs-service-tar_scm
Recommends:     obs-service-verify_file
Recommends:     obs-service-download_files
Recommends:     obs-service-format_spec_file
Recommends:     obs-service-source_validator
# needed for storing credentials in kwallet/gnome-keyring
%if 0%{?suse_version} > 1000 || 0%{?mandriva_version} || 0%{?mdkversion}
Recommends:     python-keyring
%if 0%{?rhel_version} && 0%{?rhel_version} < 600
BuildRequires:  python-elementtree
Requires:       python-elementtree
%if 0%{?centos_version} && 0%{?centos_version} < 600
BuildRequires:  python-elementtree
Requires:       python-elementtree
%if 0%{?suse_version}%{?mandriva_version}
BuildRequires:  python-m2crypto
Requires:       python-m2crypto > 0.19
BuildRequires:  m2crypto
Requires:       m2crypto > 0.19
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Commandline client for the openSUSE Build Service.

See , as well as for a general

%setup -q

CFLAGS="%{optflags}" python build

python install --prefix=%{_prefix} --root=%{buildroot}
ln -s %{buildroot}/%{_bindir}/osc
mkdir -p %{buildroot}%{_localstatedir}/lib/osc-plugins
install -Dm0644 dist/complete.csh %{buildroot}%{_sysconfdir}/profile.d/osc.csh
install -Dm0644 dist/ %{buildroot}%{_sysconfdir}/profile.d/
%if 0%{?suse_version} > 1110
install -Dm0755 dist/osc.complete %{buildroot}%{_prefix}/lib/osc/complete
install -Dm0755 dist/osc.complete %{buildroot}%{_libdir}/osc/complete

rm -rf %{buildroot}

%config %{_sysconfdir}/profile.d/osc.csh
%config %{_sysconfdir}/profile.d/
%dir %{_localstatedir}/lib/osc-plugins
%if 0%{?suse_version} > 1110