File unicorn.spec of Package unicorn

# spec file for package unicorn
# Copyright (c) 2017 SUSE LINUX 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

%define _lver   2
Name:           unicorn
Version:        2.0.1.post1
Release:        0
Summary:        Lightweight multi-platform, multi-architecture CPU emulator framework
License:        GPL-2.0
Group:          System/Emulators/Other
# PATCH-FIX-OPENSUSE openSUSE-unicorn-python-rm-distutils.patch remove distutils for incompatible non-x86 platform tags on wheel build
Patch0:         openSUSE-unicorn-python-rm-distutils.patch
BuildRequires:  fdupes
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  pkg-config
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
Provides:       bundled(qemu) = 2.2.1
%define python_subpackage_only 1

Unicorn is a lightweight multi-platform, multi-architecture CPU emulator

Highlight features:

   * Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, PowerPC, RISCV, SPARC, S390X, TriCore and X86 (16, 32, 64-bit)
   * Clean/simple/lightweight/intuitive architecture-neutral API.
   * Implemented in pure C language, with bindings for Crystal, Clojure, Visual Basic, Perl, Rust, Ruby, Python, Java, .NET, Go, Delphi/Free Pascal, Haskell, Pharo, and Lua.
   * Native support for Windows & *nix (with Mac OSX, Linux, *BSD
     & Solaris confirmed).
   * High performance by using Just-In-Time compiler.
   * Support fine-grained instrumentation at various levels.
   * Thread-safe by design.
   * Distributed under free software license GPLv2.

%package        devel
Summary:        Development files for package %{name}
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{_lver} = %{version}

%description    devel
This package contains development files for %{name}

%package -n     lib%{name}%{_lver}
Summary:        Support library for %{name}
Group:          System/Libraries

%description -n lib%{name}%{_lver}
This package contains the support library for %{name}

%package -n     python-%{name}
Summary:        Python bindings for %{name}
Group:          Development/Languages/Python
Requires:       lib%{name}%{_lver} = %{version}
BuildArch:      noarch

%description -n python-%{name}
This package contains the Python bindings for %{name}

%autosetup -p1 -n %{name}-%{version}

#options required for fixing
%cmake -DCMAKE_BUILD_TYPE=Debug \

pushd ../bindings/python


# no static library
rm %{buildroot}%{_libdir}/libunicorn.a

pushd bindings/python
%python_expand %fdupes %{buildroot}%{$python_sitelib}


%ldconfig_scriptlets -n lib%{name}%{_lver}

%files devel

%files -n lib%{name}%{_lver}
%license COPYING

%files %{python_files %{name}}
%doc ChangeLog COPYING CREDITS.TXT bindings/python/README.TXT

openSUSE Build Service is sponsored by