%global pkgvers 0 %global scdate0 20241221 %global schash0 69bec22582d87389dc2945bfa51d1d9c87fb1d06 %global branch0 master %global source0 https://github.com/f4pga/prjxray.git %global scdate1 20211214 %global schash1 0a0addedd73e7e4139d52a6d8db4258763e0f1f3 %global branch1 master %global source1 https://github.com/f4pga/prjxray-db.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: prjxray Version: %(curl -s https://raw.githubusercontent.com/f4pga/prjxray/%{schash0}/setup.py | grep version | cut -d'"' -f2 | sed 's|.[a-z,A-Z]||') Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Documenting the Xilinx 7-series bit-stream format License: ISC URL: https://github.com/f4pga/prjxray BuildRequires: cmake gcc-c++ git python3-devel python3-setuptools BuildRequires: yaml-cpp-devel gtest-devel gflags-devel %if ! 0%{?rhel} BuildRequires: cctz-devel %endif Requires: %{name}-data = %{version}-%{release} Requires: %{name}-python3 = %{version}-%{release} %global __cmake_in_source_build 1 %description Tools and scripts which allow you to document the bit-stream format of Xilinx 7-series FPGAs. %package python3 Summary: Development files for Project Xray Requires: %{name} = %{version}-%{release} Requires: %{name}-data = %{version}-%{release} %description python3 Development files to build packages using Project Xray %package data Summary: Project Xray - Xilinx 7 Series Bitstream Database BuildArch: noarch %description data This package contains the bitstream documentation database for format of Xilinx 7-series FPGAs. %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 submodule update --init --depth 1 third_party/sanitizers-cmake git submodule update --init --depth 1 third_party/abseil-cpp %if 0%{?rhel} git submodule update --init --depth 1 third_party/cctz %endif git log --format=fuller rm -rf database git clone --depth 1 -n -b %{branch1} %{source1} database pushd database git fetch --depth 1 origin %{schash1} git reset --hard %{schash1} git log --format=fuller popd # static abseil sed -i '1i set(BUILD_SHARED_LIBS OFF)' third_party/abseil-cpp/CMakeLists.txt sed -i 's| SHARED| STATIC|g' third_party/abseil-cpp/CMake/AbseilDll.cmake %build %global optflags $(echo "%{optflags} -fPIC") sed -i '/third_party\/googletest/d' CMakeLists.txt sed -i '/third_party\/gflags/d' CMakeLists.txt %if ! 0%{?rhel} sed -i '/third_party\/cctz/d' CMakeLists.txt %endif sed -i '/third_party\/yaml-cpp/d' CMakeLists.txt #sed -i 's|add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)|find_package(absl REQUIRED)|g' CMakeLists.txt sed -i '/(yaml-cpp/,/)/d' CMakeLists.txt sed -i '/target_include_directories*/a set_target_properties(libprjxray PROPERTIES PREFIX "")' lib/CMakeLists.txt mkdir -p build pushd build %cmake .. \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo make %{?_smp_mflags} #make -C docs latexpdf popd %py3_build %install pushd build %make_install PREFIX="%{_prefix}" popd %{__python3} setup.py install -O1 --skip-build --root %{buildroot} --install-lib=%{python3_sitearch} # install database mkdir -p %{buildroot}/%{_datadir}/xray/database cp -Rp database/* %{buildroot}/%{_datadir}/xray/database/ # workaround kintex timings cp -Rp database/artix7/timings \ %{buildroot}/%{_datadir}/xray/database/kintex7/ mkdir -p %{buildroot}/%{_libdir} pushd %{buildroot}/%{_libdir} ln -sf %{python3_sitearch}/libprjxray.so libprjxray.so popd # requirements sed -i '/pyjson5/d' %{buildroot}%{python3_sitearch}/*.egg-info/* %files %license LICENSE %doc README.md %{_bindir}/* %{_libdir}/*.so* %files python3 %{python3_sitearch}/* %files data %dir %{_datadir}/xray %{_datadir}/xray/database %changelog * Mon Mar 28 2022 Cristian Balint - github upstream releases