File xournal.spec of Package xournal

#
# spec file for package xournal
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           xournal
Url:            http://math.mit.edu/~auroux/software/xournal/
Version:        0.4.8
Release:        0
Summary:        An application for notetaking, sketching, and keeping a journal using a stylus
License:        GPL-2.0+
Group:          Productivity/Office/Other
Source:         %{name}-%{version}.tar.gz
Patch0:         %{name}-implicit-funcs.patch
#reported already upstream -> is fixed in git
Patch1:         %{name}-german-translation.patch
Patch2:         %{name}-Improve-window-title.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  automake >= 1.11.2
BuildRequires:  fdupes
BuildRequires:  gtk2-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  inkscape
BuildRequires:  libgnomecanvas-devel
%if 0%{?suse_version}
BuildRequires:  libpoppler-glib-devel
BuildRequires:  update-desktop-files
%else
# E.g. Fedora etc. use other package name
BuildRequires:  poppler-glib-devel
%endif

%description
Xournal is an application for notetaking, sketching, keeping a journal
using a stylus. It is free software (GNU GPL) and runs on Linux (recent
distributions) and other GTK+/Gnome platforms. It is similar to
Microsoft Windows Journal or to other alternatives such as Jarnal and
Gournal.

%prep
%setup
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
autoreconf -fi
%configure
make %{_smp_mflags}

%install
make DESTDIR=%{buildroot} install
make DESTDIR=%{buildroot} desktop-install

# GENERATE AND INSTALL HIRES ICONS IN HICOLOR ICON DIR
for i in 24 32 48 64 128 256
do
  mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
  mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/mimetypes
  inkscape -w ${i} -C pixmaps/%{name}.svg \
           -e %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
  inkscape -w ${i} -C pixmaps/xoj.svg \
           -e %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/mimetypes/application-x-xoj.png
done

%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%endif
%find_lang %{name}

install -D -m 0644 %{name}.xml %{buildroot}%{_datadir}/mime/application/x-xoj.xml

%fdupes %{buildroot}%{_datadir}

%post
%desktop_database_post
%icon_theme_cache_post
%mime_database_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun

%files -f %{name}.lang
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/icons/hicolor/*/mimetypes/*.png
%{_datadir}/icons/hicolor/scalable/mimetypes/*.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/xoj.svg
%{_datadir}/mime/packages/*.xml
%{_datadir}/mime/application/*.xml
%dir %{_datadir}/mimelnk
%dir %{_datadir}/mimelnk/application
%{_datadir}/mimelnk/application/*.desktop

%changelog
openSUSE Build Service is sponsored by