%define gituser barsnick %define gitname guitar-tools %global gitdate 20260426 %global commit 3874bb8cd75fe1024c4b9a3f55f6cf860f8b636a %global shortcommit %(c=%{commit}; echo ${c:0:7}) # Build source is tarball release = 1 or git commit = 0 %global build_release 0 # Force use of Qt5 = 1 (testing only) %global force_qt5 0 %global vers 0.1.0 %global rel 0.1 %global distsuffix .1sunshine # determine Qt version to use # dist Qt5? Qt6? # Epel 7 yes no # Epel 8 yes no # Epel 9 yes yes # Rhel 8 yes no # Rhel 9 yes no # Centos-stream 8 yes no # Centos-stream 9 yes no # Centos-stream 10 no yes # Fedora 42+ yes yes # # i.e. # - Centos behaves like Rhel # - Epel is different %if 0%{?force_qt5} || (0%{?rhel} && 0%{?rhel} < 10) || (0%{?centos} && 0%{?centos} < 10) || (0%{?rhel} && 0%{?rhel} < 9) %global qt_ver 5 %else %global qt_ver 6 %endif Name: %{gitname} Version: %{vers} Summary: Tool collection for guitar players and musicians. %if 0%{?build_release} > 0 # build from the tarball release Release: %{rel}%{?dist}%{?distsuffix} Source0: %{url}/archive/refs/tags/%{vers}.tar.gz#/%{gitname}-%{shortcommit}.tar.gz %else # build from the git commit snapshot Release: %{rel}.%{gitdate}git%{shortcommit}%{?dist}%{?distsuffix} Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{gitname}-%{shortcommit}.tar.gz %endif #build_release License: GPL-3.0-only URL: https://github.com/t-mon/guitar-tools VCS: https://github.com/barsnick/guitar-tools.git Source1: %{name}.desktop BuildRequires: make BuildRequires: desktop-file-utils BuildRequires: qt%{qt_ver}-qtbase-devel BuildRequires: qt%{qt_ver}-qtdeclarative-devel BuildRequires: qt%{qt_ver}-qtmultimedia-devel BuildRequires: soundtouch-devel %description Guitar Tools is collection of useful tools for guitar players. Features: * Guitar tuner * Guitar * Metronome * Chords * Scales * Recorder * Drum loops * Compose tool %prep %if 0%{?build_release} > 0 %setup -q %else %setup -q -n %{gitname}-%{commit} %endif # do not default to in-tree relative path sed -i -e 's|\.\./\.\./\.\./guitar-tools/data/|/usr/share/guitar-tools/data/|' apps/generic/main.cpp %build %{expand:%{qmake_qt%{qt_ver}}} PREFIX=%{_prefix} make %{?_smp_mflags} %install rm -rf %{buildroot} make INSTALL_ROOT=%{buildroot} install desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} sed -i -e 's/env python$/env python3/' %{buildroot}%{_datadir}/%{name}/data/scales/generate-scale.py install -d %{buildroot}%{_datadir}/pixmaps/ install -p -m 644 icons/%{gitname}-48x48.png %{buildroot}%{_datadir}/pixmaps/%{name}.png %files %license LICENSE %doc README.md %{_bindir}/* %{_datadir}/%{name} %{_datadir}/pixmaps/* %{_datadir}/applications/* %changelog * Sun Apr 26 2026 Moritz Barsnick 0.1.0-0.1.20260422git3874bb8.1sunshine - update to latest commit with support for EPEL7 * Sun Apr 26 2026 Moritz Barsnick 0.1.0-0.20260422git9788902.1sunshine - initial RPM