File osc-plugin-install.spec of Package osc-plugin-install

# spec file for package osc-plugin-install
# Copyright (c) 2021 SUSE LLC
# Copyright (C) 2012,2013,, Novell Inc.,
# 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

# Define just "test" as a package in _multibuild file to distinguish test
# instructions here
%if "@BUILD_FLAVOR@" == ""
%define _test 0
%define name_ext %nil
%define _test 1
%define name_ext -test

%define oscplugindir %{_prefix}/lib/osc-plugins
%define orig_name osc-plugin-install
Name:           %{orig_name}%{?name_ext}
Version:        0.27
Release:        0
Summary:        Plugin to make package installation easier
License:        GPL-2.0-only OR GPL-3.0-only
Group:          Development/Tools/Other
URL:  {name}
%if 0%{?_test}
BuildRequires:  %{orig_name} == %{version}
BuildRequires:  expect
%if 0%{?suse_version} >= 1330
BuildRequires:  python3-certifi
# Needed for directory ownership
BuildRequires:  osc
Requires:       osc
%if 0%{?!fedora_version:1} && 0%{?!centos_version:1} && 0%{?!scientificlinux_version:1} && 0%{?!rhel_version:1}
Recommends:     rpm-python
Recommends:     rpmdevtools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Provides:       python3-%{orig_name} = %{version}-%{release}

This osc plugin extends osc with the subcommand 'osc install'.
The main effort of this plugin is to free the end-user of the sometimes tedious
task to look up the correct repository URL to be used with zypper.
Dependencies are resolved across projects, just as the online one-click mechanism
would do.
The plugin can also guess the best matching platform for your system.

Example usage:
 osc co PROJ PACK ; cd PACK
 do osc build ; vi ... ; osc ci ; osc results
 osc in


%if 0%{?_test}
rpm -ql %{orig_name}
cat > test_osc_in << EOF
strace 2
spawn osc in --help
expect "Username: "
send "test"
expect "Password: "
send "foo"
expect "install a package after build via zypper in"
expect -f test_osc_in

# disable debug packages in package test to prevent error about missing files
%define debug_package %{nil}

install -D -m0644 %{S:0} %{buildroot}%{oscplugindir}/

%defattr(-, root, root)
# also glob for byte-compiled (pyc) and optimized byte-compiled (pyo)
# files (they are generated by fedora's brp-python-bytecompile script)

openSUSE Build Service is sponsored by