%global pkgvers 1
%global scdate0 20210731
%global schash0 b2a64abcc8561d758c0bcb3945117dcb13bd9dca
%global branch0 master
%global source0 https://github.com/donn/padring.git

%global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}}

Name:           padring
Version:        0
Release:        %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist}
Summary:        A padring generator for ASICs
License:        BSD

URL:            https://github.com/YosysHQ/padring

BuildRequires:  gcc-c++ cmake doxygen git

%global __cmake_in_source_build 1

%description
This tool makes padrings for ASICs using a LEF
file and a placement/configuration file.

%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
mkdir build
pushd build
%cmake .. \
       -DCMAKE_SKIP_RPATH=ON \
       -DCMAKE_VERBOSE_MAKEFILE=OFF \
       -DCMAKE_BUILD_TYPE=RelWithDebInfo
%cmake_build
popd


%install
mkdir -p %{buildroot}%{_bindir}
install -p -m 0755 build/padring %{buildroot}%{_bindir}/


%files
%license License.txt
%doc README.md
%doc doc example
%{_bindir}/*


%changelog
* Thu Dec 23 2021 Cristian Balint <cristian.balint@gmail.com>
- github update releases