#
# Conditional build:
-# _without_gl - without OpenGL support
+# _without_gl - without OpenGL libraries
+# _without_xft - without Xft support
#
Summary: Fast Light Tool Kit
Summary(pl): FLTK - "lekki" X11 toolkit
Summary(pt_BR): Interface gráfica em C++ para X, OpenGL e Windows
Name: fltk
-Version: 1.0.11
-Release: 7
+Version: 1.1.3
+Release: 1
License: LGPL with amendments (see COPYING)
Group: X11/Libraries
Source0: ftp://ftp.easysw.com/pub/%{name}/%{version}/%{name}-%{version}-source.tar.bz2
-Source1: http://www.fltk.org/doc/%{name}.ps.gz
-Patch0: %{name}-fluid-shared.patch
+Source1: http://www.fltk.org/doc-1.1/%{name}.ps.gz
+Patch0: %{name}-link.patch
+Patch1: %{name}-acfix.patch
URL: http://www.fltk.org/
%{!?_without_gl:BuildRequires: OpenGL-devel}
BuildRequires: XFree86-devel >= 3.3.6
-BuildRequires: gcc-c++
-%{!?_without_gl:Requires: OpenGL}
+BuildRequires: autoconf
+BuildRequires: libstdc++-devel
+%{!?_without_xft:BuildRequires: xft-devel}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Obsoletes: libfltk1.1
-
%define _noautoreqdep libGL.so.1 libGLU.so.1
%description
%description static -l pt_BR
Bibliotecas estáticas para o FLTK.
+%package gl
+Summary: FLTK GL library
+Summary(pl): Biblioteka FLTK GL
+Group: X11/Libraries
+Requires: %{name} = %{version}
+Requires: OpenGL
+
+%description gl
+FLTK GL library.
+
+%description gl -l pl
+Biblioteka FLTK GL.
+
+%package gl-devel
+Summary: Header files for FLTK GL library
+Summary(pl): Pliki nag³ówkowe biblioteki FLTK GL
+Group: X11/Development/Libraries
+Requires: %{name}-devel = %{version}
+Requires: %{name}-gl = %{version}
+
+%description gl-devel
+Header files for FLTK GL library.
+
+%description gl-devel -l pl
+Pliki nag³ówkowe biblioteki FLTK GL.
+
+%package gl-static
+Summary: FLTK GL static library
+Summary(pl): Statyczna biblioteka FLTK GL
+Group: X11/Development/Libraries
+Requires: %{name}-gl-devel = %{version}
+Requires: %{name}-static = %{version}
+
+%description gl-static
+FLTK GL static library.
+
+%description gl-static -l pl
+Statyczna biblioteka FLTK GL.
+
%prep
%setup -q
-%patch -p1
+%patch0 -p1
+%patch1 -p1
install %{SOURCE1} .
%build
-CPPFLAGS="-I/usr/X11R6/include"; export CPPFLAGS
-%configure2_13 \
- --libdir=$RPM_BUILD_ROOT%{_libdir} \
- --includedir=$RPM_BUILD_ROOT%{_includedir} \
- --bindir=$RPM_BUILD_ROOT%{_bindir} \
+CPPFLAGS="-I/usr/X11R6/include"
+CXXFLAGS="%{rpmcflags} -I/usr/include/freetype2"
+# no "-s" in LDFLAGS, they are propagated to fltk-config
+# (together with -L/usr/X11R6/lib, so cannot be removed)
+LDFLAGS=" "
+%{__autoconf}
+%configure \
--enable-shared \
--with-x \
- %{?_without_gl:--disable-gl}
+ %{?_without_gl:--disable-gl} \
+ %{!?_without_xft:--enable-xft}
%{__make} depend
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/FL,%{_libdir},%{_mandir}/man1}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/FL,%{_libdir},%{_mandir}/man{1,3}}
-cd fluid
-%{__make} install
-cd ../src
-%{__make} install
-cd ..
+%{__make} install \
+ libdir=$RPM_BUILD_ROOT%{_libdir} \
+ includedir=$RPM_BUILD_ROOT%{_includedir} \
+ bindir=$RPM_BUILD_ROOT%{_bindir}
-rm -f $RPM_BUILD_ROOT%{_libdir}/*.so
-mv -f $RPM_BUILD_ROOT%{_libdir}/libfltk.so.1 \
- $RPM_BUILD_ROOT%{_libdir}/libfltk.so.%{version}
-ln -sf libfltk.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libfltk.so
-mv -f documentation/fltk.man $RPM_BUILD_ROOT%{_mandir}/man1/fltk.1
-mv -f documentation/fluid.man $RPM_BUILD_ROOT%{_mandir}/man1/fluid.1
+install documentation/fltk-config.man $RPM_BUILD_ROOT%{_mandir}/man1/fltk-config.1
+install documentation/fluid.man $RPM_BUILD_ROOT%{_mandir}/man1/fluid.1
+install documentation/fltk.man $RPM_BUILD_ROOT%{_mandir}/man3/fltk.3
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
# note: COPYING contains amendments to LGPL, so don't remove!
-%doc CHANGES COPYING README
-%attr(755,root,root) %{_libdir}/*.so.*.*.*
+%doc CHANGES COPYING CREDITS README
+%attr(755,root,root) %{_libdir}/libfltk.so.*.*
+%attr(755,root,root) %{_libdir}/libfltk_forms.so.*.*
+%attr(755,root,root) %{_libdir}/libfltk_images.so.*.*
%files devel
%defattr(644,root,root,755)
-%doc documentation/* fltk.ps.gz
-%attr(755,root,root) %{_libdir}/libfltk.so
+%doc documentation/*.{html,gif,jpg} fltk.ps.gz
+%attr(755,root,root) %{_bindir}/fltk-config
%attr(755,root,root) %{_bindir}/fluid
+%attr(755,root,root) %{_libdir}/libfltk.so
+%attr(755,root,root) %{_libdir}/libfltk_forms.so
+%attr(755,root,root) %{_libdir}/libfltk_images.so
%{_includedir}/FL
-%{_mandir}/man1/*
+%exclude %{_includedir}/FL/Fl_Gl_Window.*
+%exclude %{_includedir}/FL/gl*
+%{_mandir}/man[13]/*
%files static
%defattr(644,root,root,755)
-%attr(644,root,root) %{_libdir}/*.a
+%attr(644,root,root) %{_libdir}/libfltk.a
+%attr(644,root,root) %{_libdir}/libfltk_forms.a
+%attr(644,root,root) %{_libdir}/libfltk_images.a
+
+%if 0%{!?_without_gl:1}
+%files gl
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libfltk_gl.so.*.*
+
+%files gl-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libfltk_gl.so
+%{_includedir}/FL/Fl_Gl_Window.*
+%{_includedir}/FL/gl*
+
+%files gl-static
+%defattr(644,root,root,755)
+%attr(644,root,root) %{_libdir}/libfltk_gl.a
+%endif