File keystone.spec of Package keystone
#
# spec file for package keystone
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define sover 0
Name: keystone
Version: 0.9.2
Release: 0
Summary: A lightweight multi-architecture assembler framework
License: GPL-2.0-only
Group: Development/Tools/Other
URL: https://www.keystone-engine.org
#Git-Clone: https://github.com/keystone-engine/keystone.git
Source: %{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libffi-devel
BuildRequires: llvm-devel
BuildRequires: pkgconfig
Requires: llvm10
%description
Multi-architecture, with support for Arm, Arm64 (AArch64/Armv8),
Hexagon, Mips, PowerPC, Sparc, SystemZ, & X86 (include 16/32/64bit).
%package -n libkeystone%{sover}
Summary: A lightweight multi-architecture assembler framework
Group: System/Libraries
%description -n libkeystone%{sover}
Multi-architecture, with support for Arm, Arm64 (AArch64/Armv8),
Hexagon, Mips, PowerPC, Sparc, SystemZ, & X86 (include 16/32/64bit).
This subpackage contains shared library part of libkeystone.
%package devel
Summary: Development files for keystone engine
Group: Development/Libraries/C and C++
Requires: libkeystone%{sover} = %{version}
%description devel
Multi-architecture, with support for Arm, Arm64 (AArch64/Armv8),
Hexagon, Mips, PowerPC, Sparc, SystemZ, & X86 (include 16/32/64bit).
This subpackage contains libraries and header files for developing
applications that want to make use of libkeystone.
%prep
%setup -q
%build
%cmake \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_TARGETS_TO_BUILD="all"
%make_jobs
%install
%cmake_install
%post -n libkeystone%{sover} -p /sbin/ldconfig
%postun -n libkeystone%{sover} -p /sbin/ldconfig
%files
%license COPYING
%doc ChangeLog README.md AUTHORS.TXT CREDITS.TXT SPONSORS.TXT RELEASE_NOTES
%{_bindir}/kstool
%files -n libkeystone%{sover}
%{_libdir}/libkeystone.so.%{sover}*
%files devel
%{_includedir}/keystone
%{_libdir}/libkeystone.so
%{_libdir}/pkgconfig/keystone.pc
%changelog