fd59d4f
%global commit 2a58d7fb349de3062dea61b0fb072f8e7370dde6
fd59d4f
%global shortcommit %(c=%{commit}; echo ${c:0:7})
fd59d4f
fd59d4f
Name:           atanua
fd59d4f
Version:        1.3.141220
7f61cff
Release:        5%{?dist}
fd59d4f
Summary:        Real Time Logic Simulator
fd59d4f
fd59d4f
Group:          Applications/Engineering
fd59d4f
License:        zlib and Bitstream Vera
fd59d4f
# atanua: zlib
fd59d4f
# vera fonts: Bitstream Vera
fd59d4f
URL:            http://sol.gfxile.net/atanua/
fd59d4f
Source0:        https://github.com/jarikomppa/atanua/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
fd59d4f
Source1:        http://sol.gfxile.net/zip/atanua141220.zip
fd59d4f
Source2:        atanua.desktop
7f61cff
Source3:        icon.png
7f61cff
Source4:        x-atanua-simulation.xml
7f61cff
Source5:        atanua.appdata.xml
7f61cff
Source6:        atanua.png
7f61cff
Source7:        atanua-2.png
fd59d4f
fd59d4f
# https://github.com/jarikomppa/atanua/pull/4
fd59d4f
Patch1:         0001-Don-t-crash-on-file-open-failures.patch
fd59d4f
Patch2:         0002-Check-the-correct-pointer-for-NULL.patch
fd59d4f
Patch3:         0003-A-bit-better-error-handling.patch
fd59d4f
Patch4:         0004-Fix-Linux-build.patch
fd59d4f
Patch5:         0005-Allow-builds-without-bundling-the-libraries.patch
fd59d4f
Patch6:         0006-Allow-overriding-the-data-directory-on-build.patch
fd59d4f
Patch7:         0007-Rename-TiXmlNode-ELEMENT-and-TEXT.patch
fd59d4f
Patch8:         atanua-fix-build.patch
fd59d4f
fd59d4f
BuildRequires:  desktop-file-utils
fd59d4f
BuildRequires:  pkgconfig(gtk+-3.0)
fd59d4f
BuildRequires:  pkgconfig(glib-2.0)
fd59d4f
BuildRequires:  pkgconfig(sdl)
fd59d4f
BuildRequires:  mesa-libGL-devel
fd59d4f
BuildRequires:  mesa-libGLU-devel
fd59d4f
BuildRequires:  tinyxml-devel
fd59d4f
BuildRequires:  stbi-devel
fd59d4f
BuildRequires:  GLee-devel
fd59d4f
BuildRequires:  gcc-c++
81fd631
BuildRequires:  libappstream-glib
fd59d4f
fd59d4f
%description
fd59d4f
Atanua is a real-time logic simulator, designed to help in learning of basic 
fd59d4f
boolean logic and electronics. It uses OpenGL hardware-accelerated rendering 
fd59d4f
and a custom UI designed for a fast workflow and a very low learning curve, 
fd59d4f
letting the students concentrate on learning the subject instead of spending 
fd59d4f
time learning the tool.
fd59d4f
fd59d4f
fd59d4f
%prep
fd59d4f
%setup -q -n %{name}-%{commit} -a1
fd59d4f
%patch1 -p1
fd59d4f
%patch2 -p1
fd59d4f
%patch3 -p1
fd59d4f
%patch4 -p1
fd59d4f
%patch5 -p1
fd59d4f
%patch6 -p1
fd59d4f
%patch7 -p1
fd59d4f
%patch8 -p1
fd59d4f
fd59d4f
fd59d4f
%build
fd59d4f
make %{?_smp_mflags} CFLAGS='%{optflags} -DDATADIR=\"%{_datadir}/atanua\"' \
fd59d4f
        CC=%{__cc} CXX=%{__cxx} UNBUNDLE=1
fd59d4f
fd59d4f
fd59d4f
%install
fd59d4f
install -d %{buildroot}%{_bindir}
fd59d4f
install -d %{buildroot}%{_datadir}
fd59d4f
install -d %{buildroot}%{_datadir}/mime/packages
fd59d4f
install -d %{buildroot}%{_datadir}/pixmaps
81fd631
install -d %{buildroot}%{_datadir}/appdata
fd59d4f
fd59d4f
install atanua %{buildroot}%{_bindir}
fd59d4f
cp -a data %{buildroot}%{_datadir}/atanua
7f61cff
install -pm644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/atanua.png
fd59d4f
7f61cff
install -pm644 %{SOURCE4} %{buildroot}%{_datadir}/mime/packages/
fd59d4f
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
fd59d4f
7f61cff
install -pm644 %{SOURCE5} %{buildroot}%{_datadir}/appdata/
81fd631
81fd631
81fd631
%check
81fd631
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml
81fd631
fd59d4f
fd59d4f
%post
fd59d4f
/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
761bd4b
/usr/bin/update-desktop-database &> /dev/null || :
761bd4b
761bd4b
fd59d4f
%postun
fd59d4f
if [ $1 -eq 0 ]
fd59d4f
then
761bd4b
	/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
761bd4b
	/usr/bin/update-desktop-database &> /dev/null || :
fd59d4f
fi
fd59d4f
fd59d4f
fd59d4f
%posttrans
fd59d4f
/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
fd59d4f
fd59d4f
fd59d4f
%files
fd59d4f
%{_bindir}/atanua
fd59d4f
%{_datadir}/atanua
fd59d4f
%{_datadir}/applications/atanua.desktop
fd59d4f
%{_datadir}/mime/packages/x-atanua-simulation.xml
fd59d4f
%{_datadir}/pixmaps/atanua.png
81fd631
%{_datadir}/appdata/atanua.appdata.xml
fd59d4f
%doc readme.md
fd59d4f
%license LICENSE
fd59d4f
%license data/vera_copyright.txt
fd59d4f
fd59d4f
fd59d4f
%changelog
7f61cff
* Fri Apr 29 2016 Lubomir Rintel <lkundrak@v3.sk> - 1.3.141220-5
7f61cff
- Use a bigger icon for appstream
7f61cff
fe66ff8
* Fri Apr 29 2016 Lubomir Rintel <lkundrak@v3.sk> - 1.3.141220-4
fe66ff8
- Correct AppStream component type
fe66ff8
81fd631
* Fri Apr 29 2016 Lubomir Rintel <lkundrak@v3.sk> - 1.3.141220-3
81fd631
- Add AppStream metadata
81fd631
5a922d3
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.141220-2
5a922d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
5a922d3
fd59d4f
* Sat Nov 14 2015 Lubomir Rintel <lkundrak@v3.sk> - 1.3.141220-1
fd59d4f
- Initial packaging