File capstone.spec of Package capstone

#
# spec file for package capstone.spec
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#


%define		apiver	5
Name:           capstone
Version:        5.0.6
Release:        0
Summary:        A lightweight multi-platform, multi-architecture disassembly framework
License:        MIT
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group:          Development/Tools
Url:            http://www.capstone-engine.org
Source:         %{name}-%{version}.tar.gz
BuildRequires:  pkgconfig
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libffi-devel
BuildRequires:  python3-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Capstone is a disassembly framework with the target of becoming the ultimate
disasm engine for binary analysis and reversing in the security community.

%package -n libcapstone%{apiver}
Summary:        A lightweight multi-platform, multi-architecture disassembly framework
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group:          Development/Tools

%description -n libcapstone%{apiver}
Capstone is a disassembly framework with the target of becoming the ultimate
disasm engine for binary analysis and reversing in the security community.

%package -n libcapstone-devel
Summary:        Development files to build upon libcapstone
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group:          Development/Tools
Requires:       libcapstone%{apiver}

%description -n libcapstone-devel
Development files to build upon libcapstone, C language only.

%package -n capstone%{apiver}-bindings
Summary:        Capstone bindings for various languages
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group:          Development/Tools

%description -n capstone%{apiver}-bindings
Capstone bindings for various languages -- Java and Python are included here.

%prep
%setup -q -n %{name}-%{version}

%build
#./make.sh gcc
%cmake \
  -DFIND_LIBRARY_USE_LIB64_PATHS=true \
  -DCMAKE_BUILD_TYPE="RelWithDebugInfo" \
  -DCAPSTONE_BUILD_STATIC_RUNTIME=off \
  -DCAPSTONE_BUILD_STATIC=off \
  -DCAPSTONE_BUILD_TESTS=off
#-ffat-lto-objects
  
%cmake_build

%install
#env DESTDIR=%{buildroot} ./make.sh install
%cmake_install
#cd bindings/python
#python3 setup.py install

%post -n libcapstone%{apiver} -p /sbin/ldconfig
%postun -n libcapstone%{apiver} -p /sbin/ldconfig

%files -n libcapstone%{apiver}
%defattr(-,root,root)
%{_libdir}/lib%{name}.so.%{apiver}*
%{_bindir}/cstool

%files -n libcapstone-devel
%defattr(-,root,root)
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%dir %{_libdir}/cmake/capstone
%{_libdir}/cmake/capstone/*.cmake

%files -n capstone%{apiver}-bindings
%defattr(-,root,root)
%doc ChangeLog README.md LICENSE*.TXT COMPILE*.TXT CREDITS.TXT RELEASE_NOTES SPONSORS.TXT HACK.TXT

%changelog
openSUSE Build Service is sponsored by