File k3dsurf.spec of Package k3dsurf

#
# spec file for package k3dsurf
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#



Name:           k3dsurf
Summary:        Visualize and manipulate multidimensional surfaces
Version:        0.6.2
Release:        1
License:        GPL-2.0
Group:          Productivity/Scientific/Math  
Url:            http://k3dsurf.sourceforge.net/
Vendor:         openSUSE-Education
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xmu)
BuildRequires:  pkgconfig(glu)
BuildRequires:  Mesa-devel
BuildRequires:  pkgconfig(gl)
BuildRequires:  dos2unix
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRequires:  kdelibs3-devel
%endif
%if 0%{?fedora_version}
BuildRequires:  desktop-file-utils
BuildRequires:  kdelibs-devel
%endif
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}.xpm
Patch1:         k3dsurf-0.6.2-includes.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
K3DSurf is a program for visualizing and manipulating multidimensional
surfaces by using Mathematical equations. It's also a "modeler" for
POV-Ray in the area of parametric surfaces. It features 3D, 4D, 5D,
and 6D HyperObjects visualization, full support for all functions
(like the C language), support for mouse events in the drawing area,
animation and morph effects, Povscript and mesh file generation, and
support for VRML2 and OBJ files. More than 100 examples are provided.

Author:
-------
    Abderrahman Taha (taha_ab@yahoo.fr)


%prep
%setup -q
%patch1 -p1
dos2unix copying

%build
qmake
%{__make} %{?_smp_mflags}

%install
%makeinstall
%{__install} -D -m0755 bin/k3dsurf %{buildroot}%{_bindir}/k3dsurf

# icons
install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/%name.xpm
pushd icon 1>/dev/null
for i in 16x16 32x32 64x64; do
	mkdir -p %buildroot%_datadir/icons/hicolor/$i/apps 
	install -m644 catenoid_mini_$i.png %buildroot%_datadir/icons/hicolor/$i/apps/%name.png
done
popd 1>/dev/null

# desktop file stuff
%{__mkdir_p} %{buildroot}%{_datadir}/applications/
%{__cat} <<EOF >%{name}.desktop
[Desktop Entry]
Name=k3dsurf
Comment=manipulate multidimensional surfaces
Exec=k3dsurf
Icon=k3dsurf
Terminal=false
Type=Application
StartupNotify=true
Categories=Application;Education;Science;
EOF
%if 0%{?fedora_version}
desktop-file-install --vendor rpmforge             \
	--add-category X-Red-Hat-Base              \
	--dir %{buildroot}%{_datadir}/applications \
	%{name}.desktop
%endif
%if 0%{?suse_version}
%suse_update_desktop_file -n -i %name Education Math
%endif

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc copying readme
%{_bindir}/k3dsurf
%{_datadir}/applications/*k3dsurf.desktop
%{_datadir}/pixmaps/%name.xpm
%{_datadir}/icons/hicolor/*/apps/%name.png

%changelog
openSUSE Build Service is sponsored by