# Created by pyp2rpm-3.3.2 %global pypi_name cocotb # cocotb isn't really a library-- it's a framework/application. # I don't think it should be called "python-cocotb". Name: %{pypi_name} Version: 1.2.0 Release: 1%{?dist} Summary: Coroutine Co-simulation Test Bench License: BSD URL: https://github.com/cocotb/cocotb Source0: https://github.com/cocotb/cocotb/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: python3-devel BuildRequires: python3dist(setuptools) Requires: python3dist(setuptools) BuildRequires: gcc, gcc-c++, make # iverilog and ghdl are the FOSS simulators. cocotb supports both. # We need them to run the tests. # It isn't *strictly* necessary to have them installed, though, especially # since cocotb also supports non-FOSS simulators. Thus, use a weak dep to # pull them in (but allow someone to remove them if necessary). Recommends: iverilog, ghdl BuildRequires: iverilog, ghdl # So this package doesn't actually contain compiled code (at the moment). # But it does contain source code that users compile when running a # simulator. So maybe arguably it should be arched. # Future versions of cocotb may contain the option to have precompiled # libraries. BuildArch: noarch %{?python_provide:%python_provide python3-%{pypi_name}} %description cocotb is a coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python. %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # Only run the tests, not the examples. # Examples require /usr/bin/cocotb-config already installed. sed "/\$(MAKE) -k -C examples/d" -i Makefile # Fix the 'combine_results.py' script to use python3. sed 's/python/python3/g' -i bin/combine_results.py # Should remove chbangs from non-script library files. sed "/env python/d" -i cocotb/*.py sed "/env python/d" -i cocotb/drivers/*.py sed "/env python/d" -i cocotb/generators/*.py sed "/env python/d" -i cocotb/monitors/*.py %build %py3_build %install %py3_install %check # Run tests with the FOSS simulators. export PYTHON_BIN=python3 make SIM=icarus %files -n %{pypi_name} %doc README.md %license LICENSE %{_bindir}/cocotb-config %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Fri Jul 26 2019 Ben Rosser - 1.2.0-1 - Initial package.