File fltk.spec of Package fltk
#
# spec file for package fltk (Version 1.1.9)
#
# Copyright (c) 2009 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/
#
# norootforbuild
Name: fltk
# Build Requires: freeglut-devel gcc-c++ libdrm-devel libjpeg-devel libpng-devel libxml2
BuildRequires: Mesa-devel gcc-c++ libjpeg-devel libpng-devel xorg-x11-devel
License: LGPL v2.1 or later
Group: Development/Libraries/X11
AutoReqProv: on
# some of files were updated from CinePaint CVS:
# http://cinepaint.cvs.sourceforge.net/cinepaint/cinepaint-project/fltk/
Version: 1.1.9
Release: 35
Summary: Free C++ GUI Toolkit for the X Window System, OpenGL, and WIN32
Url: http://www.fltk.org/
Source: %{name}-%{version}-source.tar.bz2
Patch1: %{name}-delete-fix.patch
Patch2: %{name}-%{version}-intptr_t.patch
Patch3: %{name}-%{version}-libdir.patch
Patch4: %{name}-%{version}-cast.patch
# Took from Gentoo
Patch5: %{name}-%{version}-as_needed.patch
Patch6: %{name}-%{version}-link_gl.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%package devel
License: LGPL v2.1 or later
Summary: Include Files and Libraries mandatory for Development.
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
AutoReqProv: on
%if "%(xft-config --prefix)" == "/usr"
%define _xorg7libs %_lib
%define _xorg7bin bin
%define _xorg7_mandir %_mandir
%define _xorg7pixmaps include
%define _xorg7libshare share
#%define _xorg7_config /usr/share/X11/config #use libshare macro
%define _xorg7_prefix /usr
%else
%define _xorg7libs X11R6/%_lib
%define _xorg7bin X11R6/bin
%define _xorg7_mandir /usr/X11R6/man
%define _xorg7pixmaps X11R6/include
%define _xorg7libshare X11R6/lib/
#%define _xorg7_config /usr/X11R6/lib/X11/config #use libshare macro
%define _xorg7_prefix /usr/X11R6
%endif
%description devel
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a C++
graphical user interface toolkit for the X Window System (UNIX(r)),
OpenGL(r), and Microsoft(r) Windows(r) NT 4.0, 95, or 98). Installation
of this package requires you to install a 3D library. If you do not
have 3D hardware you can use the software OpenGL library in the
mesasoft package (series x3d). The library can be recompiled without 3D
support.
%description
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a C++
graphical user interface toolkit for the X Window System (UNIX(r)),
OpenGL(r), and Microsoft(r) Windows(r) NT 4.0, 95, or 98. The
installation of this package requires you to install a 3D library. If
you do not have hardware 3D, you can use the software OpenGL library in
the mesasoft package (series x3d). The library can be recompiled
without 3D support.
%prep
%setup -q
%patch1
%patch2
%if "%{_lib}" == "lib64"
%patch3
# renaming on 64bit archs due to fixed libdir in variable called by ranlib
mv lib lib64
%endif
%patch4
%patch5 -p1
%patch6
%build
%{?suse_update_config:%{suse_update_config}}
./configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
--prefix=%{_xorg7_prefix} \
--bindir=%{_xorg7_prefix}/bin \
--libdir=%{_xorg7_prefix}/%{_lib} \
--includedir=%{_xorg7_prefix}/include \
--enable-shared --enable-threads
make glflags="-L/usr/%{_lib}/ -lGL" \
fltkflags="-L%{_xorg7_prefix}/%{_lib}/ -lfltk"
%install
make install libdir=${RPM_BUILD_ROOT}%{_xorg7_prefix}/%{_lib}/ \
includedir=${RPM_BUILD_ROOT}%{_xorg7_prefix}/include \
bindir=${RPM_BUILD_ROOT}%{_xorg7_prefix}/bin/ \
docdir=${RPM_BUILD_ROOT}/%{_docdir}/fltk \
mandir=${RPM_BUILD_ROOT}%{_xorg7_mandir} STRIP=true
rm -rf ${RPM_BUILD_ROOT}%{_xorg7_mandir}/cat*
rm -r test
cp -a CHANGES COPYING README ${RPM_BUILD_ROOT}%{_docdir}/fltk/
cp makeinclude ${RPM_BUILD_ROOT}/usr/share/doc/packages/fltk
chmod a-x ${RPM_BUILD_ROOT}%{_libdir}/libfltk*.a
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc %dir %{_docdir}/fltk
%doc %{_docdir}/fltk/CHANGES
%doc %{_docdir}/fltk/COPYING
%doc %{_docdir}/fltk/README
%{_xorg7_prefix}/%{_lib}/*.so.*
%files devel
%defattr(-,root,root)
%dir %{_docdir}/fltk
%doc %{_docdir}/fltk/examples
%doc %{_docdir}/fltk/*.gif
%doc %{_docdir}/fltk/*.jpg
%doc %{_docdir}/fltk/*.html
%doc %{_docdir}/fltk/makeinclude
%doc %{_xorg7_mandir}/man*/*
%{_xorg7_prefix}/%{_lib}/*.a
%{_xorg7_prefix}/%{_lib}/*.so
%{_xorg7_prefix}/include/*
%{_xorg7_prefix}/bin/*
%changelog