File kseg.spec of Package kseg

# spec file for package kseg
# Copyright (c) 2011 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

Name:           kseg
Version:        0.403
Release:        70
License:        GPL
Summary:        A Simulator of Euclidean Geometry
Group:          Productivity/Scientific/Math
Source0:        %name-%version.tar.bz2
Source1:        %name.desktop
Source2:        %name.xpm
Source10:       kseg_mn.qm
# PATCH-FIX-UPSTREAM add missing include
Patch0:         kseg-assert.patch
# PATCH-FIX-UPSTREAM use the home directory for locale and examples
Patch1:         kseg-KSEG_HOME.patch
# PATCH-FIX-UPSTREAM use the language specific locale for helps
Patch2:         kseg-setFilePath.patch
BuildRequires:  libdrm-devel
BuildRequires:  libjpeg-devel
BuildRequires:  qt3-devel
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define         kseg_home %{_datadir}/%name

KSEG is a program for exploring Euclidean geometry. You can create a
construction, such as a triangle with a circumcenter, then, as you drag
verteces of the triangle, you can see the circumcenter moving in real
time. KSEG is very fast even in big and recursive constructions and may
well be used in math lessons in school.

%setup  -q -n %name
%patch0 -p1
%patch1 -p1
%patch2 -p1
# fix home path
sed -i "s|@KSEG_HOME@|%{kseg_home}|g" main.cpp

export QTDIR=/usr/lib/qt3
qmake QTDIR=$QTDIR LIBS=" -lm -L$QTDIR/%{_lib} -lqt-mt -lz"
make QTDIR=$QTDIR LIBS=" -lm -L$QTDIR/%{_lib} -lqt-mt -lz" KSEG_HOME="%{kseg_home}"

mkdir -p %{buildroot}%{kseg_home}/{examples,pics,locale}
install -Dm755 kseg          %{buildroot}%{_bindir}/%name
install -p -m644 *.qm *.html %{buildroot}%{kseg_home}/locale/
install -p -m644 examples/*  %{buildroot}%{kseg_home}/examples/
install -p -m644 pics/*      %{buildroot}%{kseg_home}/pics/
# install additional locales
install -m644 %{SOURCE10} %{buildroot}%{_datadir}/%name/locale/

# install desktop icon and entry
install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/%name.xpm
%suse_update_desktop_file -i %name Edutainment Math

rm -rf %{buildroot}

%doc README.translators VERSION

openSUSE Build Service is sponsored by