6954e50
Name:           free42
b6dd4fd
Epoch:          1
74cf5b8
Version:        3.1.7
d6cbbcc
Release:        %autorelease
0b1b116
License:        GPL-2.0-only AND BSD-3-Clause
6954e50
Summary:        42S Calculator Simulator
417e22e
URL:            https://www.thomasokken.com/free42/
417e22e
Source:         https://www.thomasokken.com/free42/upstream/free42-nologo-%{version}.tgz
0b1b116
Patch0:         free42-makefile.patch
0b1b116
Patch1:         free42-intel-lib-arches.patch
6954e50
2badb19
BuildRequires:  gcc-c++
0b1b116
BuildRequires:  gtk3-devel
0b1b116
BuildRequires:  alsa-lib-devel
6954e50
BuildRequires:  ImageMagick
6954e50
BuildRequires:  desktop-file-utils
0b1b116
BuildRequires:  libappstream-glib
813d659
BuildRequires:  make
6954e50
0b1b116
Provides:       bundled(IntelRDFPMathLib) = 2.1
0b1b116
182c371
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
182c371
ExcludeArch:    %{ix86}
182c371
6954e50
%description
6954e50
Free42 is a complete re-implementation of the 42S calculator and the
6954e50
82240 printer.  It was written from scratch, without using any HP code.
6954e50
6954e50
%prep
0b1b116
%autosetup -p1 -n free42-nologo-%{version}
6954e50
6954e50
%build
6954e50
cd gtk
0b1b116
# inteldecimal F128_CFLAGS uses this instead of CFLAGS
0b1b116
export CFLAGS_OPT="%{optflags}"
6954e50
# make fails when using %{?_smp_mflags}
0b1b116
make BCD_MATH=1 AUDIO_ALSA=1
0b1b116
0b1b116
convert icon-48x48.xpm icon-48x48.png
0b1b116
sed -i -e 's/IvoryBlack/#231F20/' icon-128x128.xpm
0b1b116
convert icon-128x128.xpm icon-128x128.png
0b1b116
6954e50
cat <<EOF >free42.desktop
6954e50
[Desktop Entry]
0b1b116
Name=Free42
6954e50
GenericName=Free42 calculator simulator
6954e50
Exec=free42dec
6954e50
Icon=free42
6954e50
Terminal=false
6954e50
Type=Application
6954e50
Categories=Utility;Calculator;
6954e50
EOF
6954e50
0b1b116
cat <<EOF >free42.appdata.xml
0b1b116
0b1b116
<component type="desktop-application">
0b1b116
    <id>com.thomasokken.free42</id>
0b1b116
    <name>Free42</name>
0b1b116
    <summary>42S Calculator Simulator</summary>
0b1b116
    <metadata_license>FSFAP</metadata_license>
0b1b116
    <project_license>GPL-2.0</project_license>
0b1b116
    <description>
0b1b116
        

0b1b116
            Free42 is a complete re-implementation of the 42S calculator and the
0b1b116
            82240 printer.  It was written from scratch, without using any HP code.
0b1b116
        

0b1b116
    </description>
0b1b116
    <launchable type="desktop-id">free42.desktop</launchable>
0b1b116
    <provides>
0b1b116
        <binary>free42dec</binary>
0b1b116
    </provides>
0b1b116
    <content_rating type="oars-1.1"/>
0b1b116
    <developer_name>Thomas Okken</developer_name>
0b1b116
    <releases>
0b1b116
        <release version="%{version}" date="%(date +%F -r %{SOURCE0})" />
0b1b116
    </releases>
0b1b116
    <url type="homepage">https://www.thomasokken.com/free42/</url>
0b1b116
</component>
0b1b116
EOF
0b1b116
6954e50
%install
6954e50
install -D -p -m 755 gtk/free42dec %{buildroot}%{_bindir}/free42dec
0b1b116
install -D -p -m 644 gtk/icon-48x48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
0b1b116
install -D -p -m 644 gtk/icon-128x128.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
0b1b116
install -D -p -m 644 gtk/free42.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
0b1b116
install -D -p -m 644 gtk/free42.appdata.xml %{buildroot}%{_metainfodir}/%{name}.appdata.xml
0b1b116
0b1b116
%check
6954e50
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
0b1b116
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}.appdata.xml
6954e50
6954e50
%files
0b1b116
%doc CREDITS HISTORY README
0b1b116
%license COPYING gtk/IntelRDFPMathLib20U1/eula.txt
a265a08
%{_bindir}/free42dec
6954e50
%{_datadir}/applications/%{name}.desktop
0b1b116
%{_datadir}/icons/hicolor/*/*/%{name}.png
0b1b116
%{_metainfodir}/%{name}.appdata.xml
6954e50
6954e50
%changelog
d6cbbcc
%autochangelog