File verilator.spec of Package verilator

%define Name verilator
%define Version 4.106

Name:           %{Name}
Version:        %{Version}
Release:        c4m.1.<CI_CNT>.<B_CNT>
Summary:        A fast simulator for synthesizable Verilog
License:        LGPLv3 or Artistic 2.0
URL:            http://www.veripool.com/%{Name}.html
Source0:        %{Name}-%{Version}.tar.gz
Requires:       zlib-devel
BuildRequires:  gdb
BuildRequires:  coreutils, findutils
BuildRequires:  flex, bison
BuildRequires:  gcc-c++
BuildRequires:  perl, perl(Data::Dumper), perl(Getopt::Long), perl(IO::File), perl(Pod::Usage)
BuildRequires:  sed

%description
Verilator is the fastest free Verilog HDL simulator. It compiles
synthesizable Verilog, plus some PSL, SystemVerilog and Synthesis
assertions into C++ or SystemC code. It is designed for large projects
where fast simulation performance is of primary concern, and is
especially well suited to create executable models of CPUs for
embedded software design teams.

%prep
%setup -q -n %{Name}-%{Version}
find . -name .gitignore -delete
find . -name .gitattributes -delete
export VERILATOR_ROOT=%{_datadir}
autoconf
%{configure} \
    --disable-ccwarn \
    --enable-defenv \
    --disable-longtests
# We cannot run autoreconf because upstream uses unqualifed stdlib identifiers
# that are included by autoconf-generated header files.
find -name Makefile_obj -exec sed -i \
    -e 's|^\(COPT = .*\)|\1 %{optflags}|' \
    -e 's|^#LDFLAGS += .*|LDFLAGS += %{__global_ldflags}|' \
    {} \;

%build
make %{?_smp_mflags}

# disable tests due lack of SystemC
# Skip: vlt/t_a_first_sc: Test requires SystemC
# %check
# make test

%install
make DESTDIR=$RPM_BUILD_ROOT install

# move the examples out of the datadir so that we can later include
# them in the doc dir
mv %{buildroot}%{_datadir}/verilator/examples examples

# verilator installs verilator.pc under ${datadir}
# but for consistency we want it under ${libdir}
mkdir -p %{buildroot}%{_libdir}/pkgconfig
mv %{buildroot}%{_datadir}/pkgconfig/verilator.pc %{buildroot}%{_libdir}/pkgconfig


%files
%license Artistic LICENSE
#%%doc Changes README README.html README.pdf
#%%doc verilator.pdf verilator.html
%doc examples/

%{_mandir}/man1/verilator.1.gz
%{_mandir}/man1/verilator_coverage.1.gz
%{_mandir}/man1/verilator_profcfunc.1.gz
%{_mandir}/man1/verilator_gantt.1.gz

%{_datadir}/verilator

%{_bindir}/verilator
%{_bindir}/verilator_bin
%{_bindir}/verilator_bin_dbg
%{_bindir}/verilator_profcfunc
%{_bindir}/verilator_coverage
%{_bindir}/verilator_coverage_bin_dbg
%{_bindir}/verilator_gantt

%{_libdir}/pkgconfig/verilator.pc
openSUSE Build Service is sponsored by