fd59d4f
%global commit 2a58d7fb349de3062dea61b0fb072f8e7370dde6
fd59d4f
%global shortcommit %(c=%{commit}; echo ${c:0:7})
fd59d4f
fd59d4f
Name:           atanua
fd59d4f
Version:        1.3.141220
fd59d4f
Release:        1%{?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
fd59d4f
Source3:        x-atanua-simulation.xml
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++
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
fd59d4f
fd59d4f
install atanua %{buildroot}%{_bindir}
fd59d4f
cp -a data %{buildroot}%{_datadir}/atanua
fd59d4f
cp -a data/icon.png %{buildroot}%{_datadir}/pixmaps/atanua.png
fd59d4f
fd59d4f
install -pm644 %{SOURCE3} %{buildroot}%{_datadir}/mime/packages/
fd59d4f
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
fd59d4f
fd59d4f
fd59d4f
%post
fd59d4f
/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
fd59d4f
    
fd59d4f
    
fd59d4f
%postun
fd59d4f
if [ $1 -eq 0 ]
fd59d4f
then
fd59d4f
        /usr/bin/update-mime-database %{_datadir}/mime &> /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
fd59d4f
%doc readme.md
fd59d4f
%license LICENSE
fd59d4f
%license data/vera_copyright.txt
fd59d4f
fd59d4f
fd59d4f
%changelog
fd59d4f
* Sat Nov 14 2015 Lubomir Rintel <lkundrak@v3.sk> - 1.3.141220-1
fd59d4f
- Initial packaging