File fltk.spec of Package fltk2

#
# "$Id: fltk.spec 8500 2011-03-03 09:20:46Z bgbnbigben $"
#
# RPM spec file for FLTK.
#
# Copyright 1998-2003 by Bill Spitzak and others.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
#
# Please report all bugs and problems to the following page:
#
#    http://www.fltk.org/str.php
#

%define prefix /usr
%define svn r8518
%define realversion 2.0.x-%{svn}
%define version 2.0.x.%{svn}

Summary: 	Fast Light Tool Kit (FLTK)
Name: 		fltk2
Version: 	%{version}
Release: 	23.1
License: 	LGPL
Group: 		System/Libraries
Source: 	ftp://ftp.fltk.org/pub/fltk/%{version}/fltk-%{realversion}.tar.bz2
URL: 		http://www.fltk.org
# use BuildRoot so as not to disturb the version already installed
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

%if 0%{?suse_version}
BuildRequires:  gcc-c++ pkg-config libpng12-devel libpng12-compat-devel 
BuildRequires: 	xorg-x11-util-devel xorg-x11-devel xorg-x11-libXext-devel Mesa-devel
%if 0%{?suse_version} > 1130
BuildRequires:  libjpeg62-devel
%else
BuildRequires:  libjpeg-devel
%endif
%endif

%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
BuildRequires:  gcc-c++ pkgconfig libpng-devel libjpeg-devel
BuildRequires: 	libX11-devel xorg-x11-proto-devel libXft-devel
BuildRequires: 	mesa-libGLU-devel mesa-libGL-devel libXext-devel
BuildRequires:  desktop-file-utils makedepend
BuildRequires:  zlib-devel libXi-devel freetype-devel 
BuildRequires:  autoconf libGL-devel libGLU-devel
%endif

%if 0%{?mandriva_version}
BuildRequires:  gcc-c++ pkgconfig png-devel jpeg-devel
BuildRequires:	X11-devel mesaglu-devel GL-devel
BuildRequires:	zlib-devel makedepend man
%endif

%description
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a
cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11),
Microsoft(r) Windows(r), and MacOS(r) X.  FLTK provides modern
GUI functionality without the bloat and supports 3D graphics via
OpenGL(r) and its built-in GLUT emulation.

%package devel
Summary: FLTK - development environment
Group: Development/Libraries/Other

%description devel
Install fltk-devel if you need to develop FLTK applications. 
You'll need to install the fltk package if you plan to run
dynamically linked applications.

%prep
%setup -q -n fltk-%{realversion}

%build
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" LIBS="-lstdc++ -lXrender -lfontconfig -lfreetype" ./configure  \
--prefix=%{prefix} \
--mandir=%{_mandir} \
--enable-shared \
--enable-xft \
--enable-xdbe \
--enable-png \
--enable-jpeg \
--enable-zlib

# If we got this far, all prerequisite libraries must be here.
make

%install
%{__mkdir_p} %{buildroot}
%makeinstall

%if 0%{?suse_version}
%ifarch x86_64
mv %{buildroot}%{prefix}/lib %{buildroot}%{_libdir}
%endif
rm -r %{buildroot}%{_libdir}/*.a
%endif

%post
/sbin/ldconfig

%post devel
/sbin/ldconfig

%postun
/sbin/ldconfig

%postun devel
/sbin/ldconfig

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README* COPYING CREDITS CHANGES TODO documentation

%files devel
%defattr(-,root,root,-)
%{_bindir}/*
%dir %{_includedir}/fltk
%{_includedir}/fltk/*
%{_libdir}/*
%exclude %{_mandir}/*

%changelog
* Mon Mar 21 2011 Agnelo de la Crotche <agnelo@unixversal.com>
- version  2.0.x r8518 packaged for openSUSE 11.3, 11.4

#
# End of "$Id: fltk.spec 8500 2011-03-03 09:20:46Z bgbnbigben $".
#
openSUSE Build Service is sponsored by