File fltk.spec of Package fltk
#
# spec file for package fltk (Version 1.1.10)
#
# Copyright (c) 2010 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
License: LGPLv2.1+
Group: Development/Libraries/X11
AutoReqProv: on
Version: 1.1.10
Release: 1
Summary: Free C++ GUI Toolkit for the X Window System, OpenGL, and WIN32
Url: http://www.fltk.org/
# some of files were updated from CinePaint CVS:
# http://cinepaint.cvs.sourceforge.net/cinepaint/cinepaint-project/fltk/
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
Patch7: %{name}-%{version}-varargs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: libfltk1 >= %{version}
BuildRequires: pkgconfig
BuildRequires: gcc-c++
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
%if 0%{?rhel_version} && 0%{?rhel_version} < 501
BuildRequires: xorg-x11-devel
BuildRequires: xorg-x11-libs
BuildRequires: xorg-x11-Mesa-libGL
BuildRequires: xorg-x11-Mesa-libGLU
%else
BuildRequires: libX11-devel
BuildRequires: libXext-devel
BuildRequires: libXinerama-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLU-devel
%endif
BuildRequires: libjpeg
BuildRequires: libjpeg-devel
BuildRequires: libpng
BuildRequires: libpng-devel
%endif
%if 0%{?suse_version}
BuildRequires: Mesa-devel
BuildRequires: xorg-x11-devel
%if 0%{?suse_version} > 1120
BuildRequires: libjpeg8
%else
BuildRequires: libjpeg
%endif
BuildRequires: libjpeg-devel
BuildRequires: libpng
BuildRequires: libpng-devel
%endif
%if 0%{?mandriva_version}
%ifarch x86_64
BuildRequires: lib64x11_6-devel
BuildRequires: lib64xext6-devel
BuildRequires: lib64xinerama1-devel
BuildRequires: lib64mesagl1-devel
BuildRequires: lib64mesaglu1-devel
%if 0%{?mandriva_version} < 201000
BuildRequires: lib64jpeg62
BuildRequires: lib64jpeg62-devel
%else
BuildRequires: lib64jpeg7
BuildRequires: lib64jpeg-devel
%endif
BuildRequires: lib64png3
BuildRequires: lib64png-devel
%else
BuildRequires: libx11_6-devel
BuildRequires: libxext6-devel
BuildRequires: libxinerama1-devel
BuildRequires: libmesagl1-devel
BuildRequires: libmesaglu1-devel
%if 0%{?mandriva_version} < 201000
BuildRequires: libjpeg62
BuildRequires: libjpeg62-devel
%else
BuildRequires: libjpeg7
BuildRequires: libjpeg-devel
%endif
BuildRequires: libpng3
BuildRequires: libpng-devel
%endif
%endif
%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.
%package devel
License: LGPLv2.1+
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Requires: libfltk1 = %{version}
AutoReqProv: on
%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.
%package -n libfltk1
License: LGPLv2.1+
Summary: FLTK Library
Group: Development/Libraries/C and C++
AutoReqProv: on
%description -n libfltk1
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
%if 0%{?fedora} < 11 || 0%{?rhel_version} || 0%{?centos_version} || 0%{?sles_version}
%else
%patch4
%endif
%patch5 -p1
%patch6
%patch7
%build
%{?suse_update_config:%{suse_update_config}}
./configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--includedir=%{_includedir} \
--enable-shared --enable-threads
make glflags="-L%{_libdir} -lGL" \
fltkflags="-L%{_libdir} -lfltk" \
%{?jobs:-j%jobs};
%install
make install libdir=${RPM_BUILD_ROOT}%{_libdir}/ \
includedir=${RPM_BUILD_ROOT}%{_includedir} \
bindir=${RPM_BUILD_ROOT}%{_bindir} \
docdir=${RPM_BUILD_ROOT}/%{_docdir}/fltk \
mandir=${RPM_BUILD_ROOT}%{_mandir} STRIP=true
rm -rf ${RPM_BUILD_ROOT}%{_mandir}/cat*
rm -r test
cp -a CHANGES COPYING README ${RPM_BUILD_ROOT}%{_docdir}/%{name}
cp makeinclude ${RPM_BUILD_ROOT}%{_docdir}/%{name}
rm ${RPM_BUILD_ROOT}%{_libdir}/libfltk*.a
%post -n libfltk1 -p /sbin/ldconfig
%postun -n libfltk1 -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
%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 %{_mandir}/man*/*
%{_libdir}/*.so
%{_includedir}/*
%{_bindir}/*
%files -n libfltk1
%defattr(-,root,root)
%{_libdir}/*.so.*
%changelog