File easystroke.spec of Package easystroke

#
# spec file for package easystroke
#
# Copyright (c) 2014 SUSE LINUX Products 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/
#

%if 0%{?suse_version} == 1315 && !0%{?is_opensuse}
%define is_sle_12 1
%else
%define is_sle_12 0
%endif

Name: 		easystroke
Version: 	0.6.0
Release: 	1
Summary:	Gesture-recognition application for X11
License: 	ISC
Group: 		Hardware/Mobile
URL: 		http://easystroke.sourceforge.net/
Source0:        http://downloads.sourceforge.net/easystroke/%{name}-%{version}.tar.gz
Source1:	https://raw.githubusercontent.com/thjaeger/easystroke/master/easystroke.appdata.xml
Patch0:		easystroke-fix-desktop-file.patch
# https://github.com/thjaeger/easystroke/commit/d14b2740bf3b0ec867d7a0abe4e1f64fb6687aba
Patch1:		easystroke-gnome3-fix.patch
# Fix build with lambda (now that sigc++ dropped sigc::group)
Patch2:		easystroke-lambda.patch
# Fix compilation with GCC 7.
Patch3:		easystroke-0.6.0-gcc7-build-fix.patch
BuildRoot: 	%{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: 	make
BuildRequires: 	gcc
BuildRequires: 	gcc-c++
BuildRequires: 	glib2-devel
BuildRequires: 	dbus-1-glib-devel
%if 0%{?suse_version} < 1500
BuildRequires: 	boost-devel
%else
BuildRequires: 	libboost_headers-devel
BuildRequires: 	libboost_system-devel
BuildRequires: 	libboost_serialization-devel
%endif
BuildRequires: 	intltool
BuildRequires: 	help2man
BuildRequires:	gtkmm3-devel
BuildRequires:	libXtst-devel
BuildRequires:	xorg-x11-server-sdk
BuildRequires: 	update-desktop-files

%description
Easystroke is a gesture-recognition application for X11. Gestures or strokes 
are movements that you make with you mouse (or your pen, finger etc.) while 
holding down a specific mouse button. Easystroke will execute certain actions 
if it recognizes the stroke; currently easystroke can emulate key presses, 
execute shell commands, hold down modifiers and emulate a scroll wheel.

%prep
%setup -q
%patch -P 0 -p1 -b .fixme
%patch -P 1 -p1 -b .gnome3fix
%if ( 0%{?suse_version} > 1320 || 0%{?leap_version} == 420200 || 0%{?leap_version} == 420300 )
%patch -P 2 -p1 -b .lambda
%endif
%patch -P 3 -p1 -b .0.6.0-gcc7-build-fix
cp -a %{SOURCE1} .

%build
make %{?_smp_mflags} CXX="g++ %{optflags}" CC="gcc -std=c99 %{optflags}" PREFIX=/usr
make man

%install
make DESTDIR=%buildroot PREFIX=/usr install

mkdir -p %{buildroot}/%{_datadir}/appdata
cp -a %{name}.appdata.xml %{buildroot}/%{_datadir}/appdata/

mkdir -p %{buildroot}%{_mandir}/man1
cp %{name}.1 %{buildroot}%{_mandir}/man1

%suse_update_desktop_file -i %name Utility

%find_lang %name


%clean
rm -fr %buildroot

%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/%{name}
%doc LICENSE changelog
%{_mandir}/man1/easystroke.1.gz
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%if %{is_sle_12}
%dir %{_datadir}/appdata
%endif
%{_datadir}/appdata/%{name}.appdata.xml

%changelog

openSUSE Build Service is sponsored by