File libfirm.spec of Package libfirm

#
# spec file for package libfirm
#
# Copyright (c) 2013 Huaren Zhong <huaren.zhong@gmail.com>
# Copyright (c) 2018 Yakov Markovitch
#
# 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/
#

Name:         libfirm
Summary:      A Completely Graph Based SSA Intermediate Representation Library for Compilers.
URL:          https://pp.ipd.kit.edu/firm/
Group:        Compiler
License:      LGPL-2.1
Version:      1.22.1
Release:      0
Source:       %{name}-%{version}.tar.gz

Patch0:       0001-cmake-detect-lib64-install-dir.patch
Patch1:       0002-cmake-remove-irarch-h-include-install.patch

BuildRequires:  cmake >= 3.0.0
BuildRequires:  gcc
BuildRequires:  python >= 2.7
BuildRequires:  perl

%description
libFirm is a C library that provides a graph-based intermediate representation,
optimizations, and assembly code generation suitable for use in compilers.

Implements completely graph-based, source- and target-independent intermediate
representation in SSA form, extensive set of optimizations, high-quality register
allocation, mature code generation support for x86 (32-bit) and SPARC, and much more.

%package -n libfirm-devel
Summary: Development files for %{name}
Group:	 Development/Languages/C and C++
Requires: %{name} = %{version}
Requires: glibc-devel

%description -n libfirm-devel
Header files and libraries for the package %{name}.

%prep
%setup -q

%patch0 -p1
%patch1 -p1

%build
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO -DCMAKE_INSTALL_PREFIX=%{_prefix} ..
make %{?_smp_mflags}
popd

%install
pushd build
%make_install
popd

%files -n libfirm-devel
%{_includedir}/*
%{_libdir}/lib*.a
%{_libdir}/pkgconfig/*
%{_libdir}/cmake/*

%changelog
* Sat Jul  7 2018 Yakov Markovitch <yakov.spare@yandex.ru> 1.22.0
- Rebuild for openSUSE Leap
* Wed Sep 25 2013 Huaren Zhong <huaren.zhong@gmail.com> 1.21.0
- Rebuild for Fedora