## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           syncplay
Version:        1.7.3
Release:        %autorelease
Summary:        Synchronize playback of various video players via internet

License:        Apache-2.0 AND MIT AND BSD-3-Clause AND CC-BY-3.0
URL:            https://syncplay.pl
Source0:        https://github.com/Syncplay/syncplay/archive/refs/tags/v%{version}/syncplay-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  desktop-file-utils
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Requires:       hicolor-icon-theme
Requires:       python3-certifi
Requires:       python3-pyside6
Requires:       python3-twisted+tls

%description
Solution to synchronize video playback across multiple instances of mpv, VLC,
MPC-HC and MPC-BE over the Internet.
Syncplay synchronizes the position and play state of multiple media players so
that the viewers can watch the same thing at the same time. This means that
when one person pauses/unpauses playback or seeks (jumps position) within their
media player then this will be replicated across all media players connected to
the same server and in the same 'room' (viewing session). When a new person
joins they will also be synchronised. Syncplay also includes text-based chat so
you can discuss a video as you watch it (or you could use third-party Voice
over IP software to talk over a video).


%prep
%autosetup -p1


%build
%py3_build


%install
%py3_install

# Install desktop files
desktop-file-install \
  --dir %{buildroot}%{_datadir}/applications \
  syncplay/resources/*.desktop

# Install icons
for size in 256 128 96 64 48 32 24 16; do
  install -Dpm 0644 \
    syncplay/resources/hicolor/${size}x${size}/apps/syncplay.png \
    %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/syncplay.png
done

# Install man pages
install -Dpm 0644 docs/syncplay.1 %{buildroot}/%{_mandir}/man1/syncplay.1
install -Dpm 0644 docs/syncplay-server.1 %{buildroot}/%{_mandir}/man1/syncplay-server.1


%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/syncplay.desktop


%files
%license LICENSE syncplay/resources/third-party-notices.txt
%doc README.md
%{_bindir}/syncplay
%{_bindir}/syncplay-server
%{_datadir}/applications/syncplay.desktop
%{_datadir}/applications/syncplay-server.desktop
%{_datadir}/icons/hicolor/*/apps/syncplay.png
%{_mandir}/man1/syncplay.1.*
%{_mandir}/man1/syncplay-server.1.*
%{python3_sitelib}/syncplay-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/syncplay


%changelog
## START: Generated by rpmautospec
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1.7.3-2
- Rebuilt for Python 3.13

* Wed May 01 2024 LuK1337 <priv.luk@gmail.com> - 1.7.3-1
- Update to 1.7.3

* Sat Apr 06 2024 LuK1337 <priv.luk@gmail.com> - 1.7.2-1
- Update to 1.7.2

* Wed Mar 06 2024 LuK1337 <priv.luk@gmail.com> - 1.7.1-1
- Initial import into Fedora (#2266590)
## END: Generated by rpmautospec