%global pkgvers 0 %global scdate0 20241106 %global schash0 b4922eb53938feddb5189617c6359c1c057ae9ca %global branch0 master %global source0 https://github.com/Xilinx/RapidWright.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: rapidwright Version: %(curl -s https://raw.githubusercontent.com/Xilinx/RapidWright/%{schash0}/.github/workflows/build.yml | grep -m1 RAPIDWRIGHT_VERSION | awk '{print $2}' | sed "s|[^[:digit:].]||g") Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Xilinx RapidWright framework BuildArch: noarch License: Apache 2.0 URL: https://www.rapidwright.io BuildRequires: gcc-c++ git wget java-11-openjdk-devel %description Xilinx RapidWright framework %package data Summary: Xilinx RapidWright framework data BuildArch: noarch %description data RapidWright is an open source project from Xilinx Research Labs that provides a new bridge to Vivado through reading and writing design checkpoint (DCP) 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 %build make update_jars make compile if [ ! -d data ] then curl --progress-bar --retry 10 --retry-delay 10 \ https://api.github.com/repos/Xilinx/RapidWright/releases/latest | grep "browser_download_url.*_data.zip" | cut -d : -f 2,3 | tr -d \" \ | wget --progress=bar --retry-connrefused -i - unzip rapidwright_data.zip rm -rf rapidwright_data.zip fi %install mkdir -p %{buildroot}/usr/lib/java/%{name} mkdir -p %{buildroot}%{_datadir}/%{name}/bin mkdir -p %{buildroot}%{_datadir}/%{name}/scripts # jars pushd jars for f in `find . -name '*.jar'`; do install -D -pm 644 $f %{buildroot}/usr/lib/java/%{name}/$f done popd # class cp -R bin/com %{buildroot}/usr/lib/java/%{name}/ # data cp -R data %{buildroot}%{_datadir}/%{name}/ find %{buildroot}%{_datadir}/%{name}/ -type d -exec chmod 755 {} + find %{buildroot}%{_datadir}/%{name}/ -type f -exec chmod 644 {} + install -p -m 0755 bin/*.sh %{buildroot}%{_datadir}/%{name}/bin/ install -p -m 0755 scripts/*.sh %{buildroot}%{_datadir}/%{name}/scripts/ # fix classpath sed -i 's|%{_builddir}/%{name}/bin|/usr/lib/java/%{name}|g' %{buildroot}%{_datadir}/%{name}/bin/*.sh sed -i 's|%{_builddir}/%{name}/jars|/usr/lib/java/%{name}|g' %{buildroot}%{_datadir}/%{name}/bin/*.sh %files %doc README.md %license LICENSE.TXT /usr/lib/java/* %files data %{_datadir}/* %changelog * Fri Jul 02 2021 Cristian Balint - github upstream releases