File yosys.spec of Package yosys

#
# spec file for package yosys
#
# 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 http://bugs.opensuse.org/
#


Name:           yosys
Version:        1487863999.00dba4c
Release:        0
Summary:        Yosys open synthesis suite
License:        GPL-2.0
Group:          Productivity/Scientific/Electronics
Url:            http://www.clifford.at/yosys/
Source0:		%{name}-%{version}.tar.bz2
Source1:		alanmi-abc-e9544c9f6c15.tar.bz2
Patch0:			yosys_patch1.diff

BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  tcl-devel
Requires:       tcl
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  libffi-devel

#%if 0%{?el7}
#%endif

%if 0%{?suse_version}
BuildRequires:  python3
BuildRequires:  llvm-clang
%else
BuildRequires:  python34
BuildRequires:  clang
%endif

%package devel
Summary:        Yosys open synthesis development files
Group:          Development/Languages/C and C++

%description devel
Yosys is a synthesis suite for FPGAs and ASICs.
It includes a verilog parser and the logic synthetizer ABC.

%description
Yosys is a synthesis suite for FPGAs and ASICs.
It includes a verilog parser and the logic synthetizer ABC.

%prep
%setup -q -n %{name}-%{version}
mkdir abc
tar xfj %{SOURCE1} --strip-components=1 -C abc

%build
patch -p1 < %{PATCH0}

#%if 0%{?rhel}
#patch -p1 < %{PATCH1}
#%endif

%__make CONFIG=gcc ABCREV=default PREFIX="/usr" 

%install
%make_install ABCREV=default PREFIX=%{_prefix} LIBDIR=%{_libdir} DATDIR=%{_datadir}/%{name} PREFIX="/usr"

%post -p /sbin/ldconfig
%post devel -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc CHANGELOG
%{_bindir}/yosys
%{_bindir}/yosys-abc
%{_bindir}/yosys-config
%{_bindir}/yosys-filterlib
%{_bindir}/yosys-smtbmc

%files devel
%defattr(-,root,root,-)
%{_datadir}/yosys

%changelog
* Wed Feb 22 2017 David Lanzendörfer <david.lanzendoerfer@lanceville.cn> - yosys 
Fixing the issue with the prefix