%global debug_package %{nil}
%global source_ver source_v2-1-0
Name: tipp10
Version: 2.1.0
Release: 27%{?dist}
Summary: Educational typing tutor
License: GPLv2+
Group: Applications/Text
Url: https://www.tipp10.com/en/
Source0: https://github.com/samoht0/TIPP10-Source-Package/raw/main/tipp10_source_v2-1-0.zip
BuildRequires: qt-devel sqlite-devel libpng-devel
BuildRequires: devscripts
%description
TIPP10 is an educational typing tutor which automatically adapts the
lesson to the typing failures of of the student.
%prep
%setup -q -n %{name}_%{source_ver}
find -name Thumbs.db |xargs rm -fv
%build
%set_build_flags
CXXFLAGS=$(echo "$CXXFLAGS -fdata-sections -ffunction-sections -std=gnu++98" | sed -e 's| -g | |')
export CXXFLAGS
LDFLAGS=$(echo "$LDFLAGS -Wl,-s,--gc-sections")
export LDFLAGS
qmake-qt4
sed -i 's|= -pipe -O2 -D_REENTRANT -Wall|+= -D_REENTRANT -fpermissive|' Makefile
sed -i 's|(LFLAGS)|(LDFLAGS)|' Makefile
%make_build
%install
mkdir -p %buildroot{%_bindir,%_datadir/%name,%_datadir/pixmaps,%_datadir/applications}
cp -a tipp10 license_de.txt license_en.txt error.wav metronome.wav release/tipp10v2.template %buildroot%_datadir/%name
cp -ar release/help %buildroot%_datadir/%name
cp -a tipp10.png %buildroot%_datadir/pixmaps/%name.png
cp -a tipp10.desktop %buildroot%_datadir/applications/%name.desktop
hardening-check -fv %{name}
cat > %buildroot%_bindir/%name << EOF
#!/bin/bash
cd %_datadir/%name
./tipp10 "\$@"
EOF
%files
%defattr(644, root, root, 755)
%_datadir/%name/*
%attr(755,root,root) %_bindir/%name
%attr(755,root,root) %_datadir/%name/%name
%_datadir/pixmaps/%name.png
%_datadir/applications/%name.desktop
%changelog
* Fri Feb 26 2021 samoht0 2.1.0
- source package now on my own repository
* Sun May 24 2020 samoht0 2.1.0
- spec cleanup
* Wed May 06 2020 samoht0 2.1.0
- remove "-g" flag testing (causes extreme binary bloat with GCC 10)