%global pkgvers 0 %global scdate0 20221212 %global schash0 b1ae6d720ff81296dca409ab4a7a3d4866b3bd20 %global branch0 main %global source0 https://github.com/google/bigspicy.git %global scdate1 20221103 %global schash1 0ad86f1d40beb86d81f2bd43fed89b6ed5137add %global branch1 main %global source1 https://github.com/vlsir/schema-proto.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: bigspicy Version: 0.0.1 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Big SPICE tools License: Apache 2.0 BuildArch: noarch URL: https://github.com/google/bigspicy BuildRequires: git python3-devel python3-setuptools BuildRequires: /usr/bin/protoc Requires: xdm iverilog xyce %{name}-python3 /usr/bin/protoc %description Bigspicy is a tool for merging circuit descriptions (netlists), generating Spice decks modeling those circuits, generating Spice tests to measure those models, and analyzing the results of running Spice on those tests. %package python3 Summary: %{summary} Provides: bigspicy %description python3 Bigspicy is a tool for merging circuit descriptions (netlists), generating Spice decks modeling those circuits, generating Spice tests to measure those models, and analyzing the results of running Spice on those tests. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller git clone --depth 1 -n -b %{branch1} %{source1} vlsir git -C vlsir fetch --depth 1 origin %{schash1} git -C vlsir reset --hard %{schash1} git -C vlsir log --format=fuller # fixes %if 0%{?rhel} == 8 sed -i "s|print(f'{row=}')|print('row=%s' % row)|" spice_analyser.py %endif %build %py3_build protoc --proto_path vlsir vlsir/*.proto vlsir/*/*.proto --python_out=. protoc proto/*.proto --python_out=. %install rm -rf %{buildroot} %py3_install sed -i 's|[<=>].*||g' %{buildroot}%{python3_sitelib}/*.egg-info/requires.txt install -D proto/* -t %{buildroot}/%{python3_sitelib}/py%{name}/proto install -D layout/* -t %{buildroot}/%{python3_sitelib}/py%{name}/layout install -m644 $(ls *.py | grep -v -e bigspicy.py -e setup.py) \ -t %{buildroot}/%{python3_sitelib}/py%{name}/ mkdir -p %{buildroot}%{_bindir} install -m755 bigspicy.py -t %{buildroot}%{_bindir} echo '' > %{buildroot}/%{python3_sitelib}/py%{name}/__init__.py echo '' > %{buildroot}/%{python3_sitelib}/py%{name}/proto/__init__.py echo '' > %{buildroot}/%{python3_sitelib}/py%{name}/layout/__init__.py # fix path find %{buildroot} -name '*.py' -exec sed -i 's|import spice|from py%{name} import spice|g' {} + find %{buildroot} -name '*.py' -exec sed -i 's|import circuit|from py%{name} import circuit|g' {} + find %{buildroot} -name '*.py' -exec sed -i 's|import utils_pb2|from py%{name} import utils_pb2|g' {} + find %{buildroot} -name '*.py' -exec sed -i 's|import proto.|import py%{name}.proto.|g' {} + find %{buildroot} -name '*.py' -exec sed -i 's|import spef|import py%{name}.spef|g' {} + find %{buildroot} -name '*.py' -exec sed -i 's|from design import|from py%{name}.design import|g' {} + find %{buildroot} -name '*.py' -exec sed -i 's|from spice_util import|from py%{name}.spice_util import|g' {} + %files %doc docs %doc README.md %{_bindir}/* %files python3 %license LICENSE %{python3_sitelib}/* %changelog * Thu Nov 18 2021 Cristian Balint - initial release