%global pkgvers 0 %global scdate0 20231212 %global schash0 1a40ae75d4eebee9cce73a2c4d634fd42ed0110f %global branch0 master %global source0 https://github.com/YosysHQ/icestorm.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: icestorm Version: 0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Lattice iCE40 FPGA bitstream creation/analysis/programming tools License: ISC URL: http://bygone.clairexen.net/icestorm # Fedora-specific patch for datadir Patch1: %{name}-datadir.patch BuildRequires: git gcc-c++ BuildRequires: python3-devel libftdi-devel %description Project IceStorm aims at documenting the bitstream format of Lattice iCE40 FPGAs and providing simple tools for analyzing and creating bitstream files. %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 %patch1 -p1 -b .datadir # fix shebang lines in Python scripts find . -name \*.py -exec sed -i 's|/usr/bin/env python3|/usr/bin/python3|' {} \; # get rid of .gitignore files in examples find . -name \.gitignore -delete %build %global moreflags -I/usr/include/libftdi1 make %{?_smp_mflags} \ CFLAGS="%{optflags} %{moreflags}" \ CXXFLAGS="%{optflags} %{moreflags}" \ PREFIX="%{_prefix}" \ CHIPDB_SUBDIR="%{name}" \ LDFLAGS="$RPM_LD_FLAGS" %install %make_install PREFIX="%{_prefix}" chmod +x %{buildroot}%{_bindir}/icebox.py mv %{buildroot}%{_datarootdir}/icebox %{buildroot}%{_datarootdir}/%{name} mkdir -p %{buildroot}%{python3_sitelib} mv %{buildroot}%{_bindir}/iceboxdb.py %{buildroot}%{python3_sitelib}/ install -pm644 icefuzz/timings_*.txt %{buildroot}%{_datarootdir}/%{name} # We could do a minimal check section by running make in the example # directories, but that depends on arachne-pnr, which depends on this # package, so it would create a circular dependency. %files %license README %doc examples %{_bindir}/* %{python3_sitelib}/* %{_datarootdir}/%{name} %changelog * Sat Feb 06 2021 Cristian Balint 0.0-1 initial release