%global pkgvers 0
%global scdate0 20231230
%global schash0 ad182e79524e20d2e0ee091922084b1104455581
%global branch0 main
%global source0 https://github.com/pygame/pygame.git

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

Name:           pygame
Version:        2.5.2
Release:        %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist}
Summary:        Multimedia applications like video games using Python
License:        Apache

URL:            https://github.com/pygame/pygame

BuildRequires:  git gcc python3 python3-setuptools python3-devel
BuildRequires:  python3-Cython python3-numpy freetype-devel portmidi-devel
BuildRequires:  libjpeg-turbo-devel SDL2-devel SDL2_image-devel SDL2_mixer-devel SDL2_ttf-devel

%description
Free and open-source cross-platform library for the
development of multimedia applications like video games
using Python.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name} = %{version}-%{release}

%description    devel
This package contains development files for %{name}.

%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
%py3_build


%install
%py3_install

mv -f %{buildroot}/%{_includedir}/python*/%{name} \
      %{buildroot}/%{_includedir}/

%files
%doc README.rst
%doc docs
%{python3_sitearch}/*

%files devel
%{_includedir}/%{name}


%changelog
* Thu Apr 14 2022 Cristian Balint <cristian.balint@gmail.com>
- git update releases