2012-03-12 17:23:53 +01:00
|
|
|
#
|
|
|
|
# spec file for package osc
|
|
|
|
#
|
2021-01-27 17:42:25 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2012-03-12 17:23:53 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2021-01-27 17:42:25 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-03-12 17:23:53 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2019-12-06 14:17:37 +01:00
|
|
|
%if 0%{?suse_version} >= 1500 || 0%{?fedora_version} >= 29 || 0%{?centos_version} >= 800
|
2019-04-22 14:19:59 +02:00
|
|
|
%bcond_without python3
|
|
|
|
%else
|
|
|
|
%bcond_with python3
|
|
|
|
%endif
|
|
|
|
%if %{with python3}
|
|
|
|
%define use_python python3
|
|
|
|
%else
|
|
|
|
%define use_python python
|
|
|
|
%endif
|
|
|
|
|
2021-05-18 22:59:43 +02:00
|
|
|
%define version_unconverted 0.173.0
|
2017-08-01 12:34:44 +02:00
|
|
|
%define osc_plugin_dir %{_prefix}/lib/osc-plugins
|
|
|
|
%define macros_file macros.osc
|
2021-05-11 11:56:32 +02:00
|
|
|
%if ! %{defined _rpmmacrodir}
|
|
|
|
%define _rpmmacrodir %{_sysconfdir}/rpm
|
|
|
|
%endif
|
2016-04-11 10:52:00 +02:00
|
|
|
|
2012-03-12 17:23:53 +01:00
|
|
|
Name: osc
|
2021-05-18 22:59:43 +02:00
|
|
|
Version: 0.173.0
|
2012-03-12 17:23:53 +01:00
|
|
|
Release: 0
|
2015-07-01 21:35:58 +02:00
|
|
|
Summary: Open Build Service Commander
|
2018-06-29 09:28:51 +02:00
|
|
|
License: GPL-2.0-or-later
|
2012-03-12 17:23:53 +01:00
|
|
|
Group: Development/Tools/Other
|
2021-01-27 17:42:25 +01:00
|
|
|
URL: https://github.com/openSUSE/osc
|
2012-03-12 17:23:53 +01:00
|
|
|
Source: %{name}-%{version}.tar.gz
|
2021-05-11 11:56:32 +02:00
|
|
|
Source1: debian.dirs
|
2020-03-05 08:43:09 +01:00
|
|
|
Source2: debian.docs
|
|
|
|
Source3: debian.osc.links
|
2012-03-12 17:23:53 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2019-04-22 14:19:59 +02:00
|
|
|
BuildRequires: %{use_python}-devel
|
|
|
|
BuildRequires: %{use_python}-setuptools
|
|
|
|
BuildRequires: diffstat
|
2016-06-02 16:40:08 +02:00
|
|
|
%if 0%{?mandriva_version} || 0%{?mageia}
|
2012-03-12 17:23:53 +01:00
|
|
|
BuildRequires: python-rpm
|
|
|
|
Requires: python-rpm
|
|
|
|
%else
|
2019-12-06 14:17:37 +01:00
|
|
|
%if 0%{?suse_version} >= 1500 || 0%{?fedora_version} >= 32 || 0%{?centos_version} >= 800
|
2019-04-22 14:19:59 +02:00
|
|
|
BuildRequires: %{use_python}-rpm
|
|
|
|
Requires: %{use_python}-rpm
|
|
|
|
%else
|
2012-03-12 17:23:53 +01:00
|
|
|
BuildRequires: rpm-python
|
|
|
|
Requires: rpm-python
|
|
|
|
%endif
|
2019-04-22 14:19:59 +02:00
|
|
|
%endif
|
2019-04-24 11:57:40 +02:00
|
|
|
%if 0%{?suse_version} == 0 || 0%{?suse_version} >= 1120
|
2019-04-22 14:19:59 +02:00
|
|
|
BuildArch: noarch
|
2018-06-29 09:28:51 +02:00
|
|
|
%endif
|
2019-04-24 11:57:40 +02:00
|
|
|
%if 0%{?suse_version}
|
2019-04-22 14:19:59 +02:00
|
|
|
Requires: %{use_python}
|
|
|
|
Recommends: %{use_python}-progressbar
|
|
|
|
BuildRequires: %{use_python}-xml
|
|
|
|
Requires: %{use_python}-xml
|
|
|
|
%if !%{with python3} && 0%{?suse_version} < 1020
|
2012-03-12 17:23:53 +01:00
|
|
|
BuildRequires: python-elementtree
|
|
|
|
Requires: python-elementtree
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version} > 1000
|
2019-12-06 14:17:37 +01:00
|
|
|
Recommends: build
|
2021-05-11 11:56:32 +02:00
|
|
|
Recommends: ca-certificates
|
|
|
|
Recommends: diffstat
|
2016-04-01 12:56:02 +02:00
|
|
|
Recommends: powerpc32
|
2021-05-11 11:56:32 +02:00
|
|
|
Recommends: sudo
|
2012-03-12 17:23:53 +01:00
|
|
|
# These packages are needed for "osc add $URL"
|
|
|
|
Recommends: obs-service-recompress
|
|
|
|
Recommends: obs-service-download_files
|
|
|
|
Recommends: obs-service-format_spec_file
|
2021-05-11 11:56:32 +02:00
|
|
|
Recommends: obs-service-obs_scm
|
|
|
|
Recommends: obs-service-set_version
|
2012-03-12 17:23:53 +01:00
|
|
|
Recommends: obs-service-source_validator
|
2021-05-11 11:56:32 +02:00
|
|
|
Recommends: obs-service-tar_scm
|
|
|
|
Recommends: obs-service-verify_file
|
2019-10-28 13:57:07 +01:00
|
|
|
Recommends: xdg-utils
|
2021-05-11 11:56:32 +02:00
|
|
|
# for osc >= 0.167.0 the newest build version is needed.
|
2019-12-06 14:17:37 +01:00
|
|
|
# Otherwise osc chroot might not work correctly.
|
2020-01-07 14:06:27 +01:00
|
|
|
Conflicts: build < 20200106
|
2012-03-12 17:23:53 +01:00
|
|
|
%endif
|
|
|
|
%endif
|
2012-09-20 11:10:54 +02:00
|
|
|
# needed for storing credentials in kwallet/gnome-keyring
|
|
|
|
%if 0%{?suse_version} > 1000 || 0%{?mandriva_version} || 0%{?mdkversion}
|
2020-02-13 12:02:34 +01:00
|
|
|
%if %{with python3}
|
|
|
|
Recommends: python3-keyring
|
|
|
|
%else
|
2012-09-20 11:10:54 +02:00
|
|
|
Recommends: python-keyring
|
|
|
|
%endif
|
2020-02-13 12:02:34 +01:00
|
|
|
%endif
|
2012-03-12 17:23:53 +01:00
|
|
|
%if 0%{?rhel_version} && 0%{?rhel_version} < 600
|
|
|
|
BuildRequires: python-elementtree
|
|
|
|
Requires: python-elementtree
|
|
|
|
%endif
|
|
|
|
%if 0%{?centos_version} && 0%{?centos_version} < 600
|
|
|
|
BuildRequires: python-elementtree
|
|
|
|
Requires: python-elementtree
|
|
|
|
%endif
|
2016-06-02 16:40:08 +02:00
|
|
|
%if 0%{?suse_version} || 0%{?mandriva_version} || 0%{?mageia}
|
2019-04-22 14:19:59 +02:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
BuildRequires: %{use_python}-M2Crypto > 0.19
|
|
|
|
BuildRequires: %{use_python}-chardet
|
|
|
|
Requires: %{use_python}-M2Crypto > 0.19
|
|
|
|
Requires: %{use_python}-chardet
|
|
|
|
%else
|
|
|
|
BuildRequires: python-m2crypto > 0.19
|
2012-03-12 17:23:53 +01:00
|
|
|
Requires: python-m2crypto > 0.19
|
2019-04-22 14:19:59 +02:00
|
|
|
%endif
|
2012-03-12 17:23:53 +01:00
|
|
|
%else
|
2019-12-06 14:17:37 +01:00
|
|
|
%if 0%{?fedora_version} >= 29 || 0%{?centos_version} >= 800
|
2019-04-24 11:57:40 +02:00
|
|
|
BuildRequires: python3-m2crypto
|
|
|
|
Requires: python3-m2crypto
|
|
|
|
%else
|
2019-04-22 14:19:59 +02:00
|
|
|
BuildRequires: m2crypto > 0.19
|
2012-03-12 17:23:53 +01:00
|
|
|
Requires: m2crypto > 0.19
|
|
|
|
%endif
|
2019-04-24 11:57:40 +02:00
|
|
|
%endif
|
2019-05-21 11:13:00 +02:00
|
|
|
|
|
|
|
Provides: %{use_python}-osc
|
|
|
|
|
2019-04-22 14:19:59 +02:00
|
|
|
%if %{with python3}
|
|
|
|
%define python_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
|
|
|
%else
|
2012-03-12 17:23:53 +01:00
|
|
|
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
2019-04-22 14:19:59 +02:00
|
|
|
%endif
|
2021-05-11 11:56:32 +02:00
|
|
|
|
2012-03-12 17:23:53 +01:00
|
|
|
%description
|
2015-07-01 21:35:58 +02:00
|
|
|
Commandline client for the Open Build Service.
|
2012-03-12 17:23:53 +01:00
|
|
|
|
|
|
|
See http://en.opensuse.org/openSUSE:OSC , as well as
|
|
|
|
http://en.opensuse.org/openSUSE:Build_Service_Tutorial for a general
|
|
|
|
introduction.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
|
|
|
%build
|
2014-11-14 13:56:18 +01:00
|
|
|
# the PATH hack/rewrite is needed for Fedora 20 builds, because /bin
|
|
|
|
# is a symlink to /usr/bin and /bin precedes /usr/bin in PATH
|
|
|
|
# => a "wrong" interpreter line ("#!/bin/python") is constructed
|
|
|
|
# ("wrong", because no package provides "/bin/python").
|
2019-04-22 14:19:59 +02:00
|
|
|
PATH="/usr/bin:$PATH" CFLAGS="%{optflags}" %{use_python} setup.py build
|
2012-03-12 17:23:53 +01:00
|
|
|
|
2017-08-01 12:34:44 +02:00
|
|
|
cat << eom > %{macros_file}
|
|
|
|
%%osc_plugin_dir %{osc_plugin_dir}
|
|
|
|
eom
|
|
|
|
echo >> %{macros_file}
|
|
|
|
|
2012-03-12 17:23:53 +01:00
|
|
|
%install
|
2019-04-22 14:19:59 +02:00
|
|
|
%{use_python} setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
|
|
|
perl -p -i -e 's{#!.*python}{#!%{_bindir}/%{use_python}}' osc-wrapper.py
|
2012-03-12 17:23:53 +01:00
|
|
|
ln -s osc-wrapper.py %{buildroot}/%{_bindir}/osc
|
2017-08-01 12:34:44 +02:00
|
|
|
mkdir -p %{buildroot}%{osc_plugin_dir}
|
2012-03-12 17:23:53 +01:00
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/lib/osc-plugins
|
|
|
|
install -Dm0644 dist/complete.csh %{buildroot}%{_sysconfdir}/profile.d/osc.csh
|
2014-12-15 13:35:01 +01:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
install -Dm0644 dist/complete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/osc.sh
|
|
|
|
%else
|
2012-03-12 17:23:53 +01:00
|
|
|
install -Dm0644 dist/complete.sh %{buildroot}%{_sysconfdir}/profile.d/osc.sh
|
2014-12-15 13:35:01 +01:00
|
|
|
%endif
|
2012-03-12 17:23:53 +01:00
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
install -Dm0755 dist/osc.complete %{buildroot}%{_prefix}/lib/osc/complete
|
|
|
|
%else
|
|
|
|
install -Dm0755 dist/osc.complete %{buildroot}%{_libdir}/osc/complete
|
|
|
|
%endif
|
|
|
|
|
2020-07-26 10:04:18 +02:00
|
|
|
install -Dm644 osc.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/osc.fish
|
2020-03-04 09:38:57 +01:00
|
|
|
|
2021-05-11 11:56:32 +02:00
|
|
|
install -m644 %{macros_file} -D %{buildroot}%{_rpmmacrodir}/%{macros_file}
|
2017-08-01 12:34:44 +02:00
|
|
|
|
2019-04-22 14:19:59 +02:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
%check
|
|
|
|
cd tests
|
2020-07-09 11:11:52 +02:00
|
|
|
%{use_python} suite.py
|
2021-05-11 11:56:32 +02:00
|
|
|
%endif
|
2019-04-22 14:19:59 +02:00
|
|
|
|
2012-03-12 17:23:53 +01:00
|
|
|
%clean
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root,-)
|
2019-04-22 14:19:59 +02:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
%license COPYING
|
|
|
|
%doc AUTHORS README TODO NEWS
|
|
|
|
%else
|
2014-01-01 11:42:26 +01:00
|
|
|
%doc AUTHORS README TODO NEWS COPYING
|
2019-04-22 14:19:59 +02:00
|
|
|
%endif
|
2012-03-12 17:23:53 +01:00
|
|
|
%{_bindir}/osc*
|
|
|
|
%{python_sitelib}/*
|
|
|
|
%config %{_sysconfdir}/profile.d/osc.csh
|
2014-12-15 13:35:01 +01:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%config %{_sysconfdir}/bash_completion.d/osc.sh
|
|
|
|
%else
|
2012-03-12 17:23:53 +01:00
|
|
|
%config %{_sysconfdir}/profile.d/osc.sh
|
2014-12-15 13:35:01 +01:00
|
|
|
%endif
|
2021-05-11 11:56:32 +02:00
|
|
|
%{_rpmmacrodir}/%{macros_file}
|
2012-03-12 17:23:53 +01:00
|
|
|
%dir %{_localstatedir}/lib/osc-plugins
|
|
|
|
%{_mandir}/man1/osc.*
|
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
%{_prefix}/lib/osc
|
|
|
|
%else
|
|
|
|
%{_libdir}/osc
|
|
|
|
%endif
|
2020-07-26 10:04:18 +02:00
|
|
|
%dir %{_datadir}/fish
|
|
|
|
%dir %{_datadir}/fish/vendor_completions.d
|
|
|
|
%{_datadir}/fish/vendor_completions.d/osc.fish
|
2017-08-01 12:34:44 +02:00
|
|
|
%dir %{osc_plugin_dir}
|
2012-03-12 17:23:53 +01:00
|
|
|
|
|
|
|
%changelog
|