+# TODO: enable cairo support?
#
# Conditional build:
%bcond_without opengl # without OpenGL libraries
Summary(pl.UTF-8): FLTK - "lekki" X11 toolkit
Summary(pt_BR.UTF-8): Interface gráfica em C++ para X, OpenGL e Windows
Name: fltk
-Version: 1.1.7
-Release: 1
+Version: 1.3.2
+Release: 2
License: LGPL with amendments (see COPYING)
Group: X11/Libraries
-Source0: http://ftp.easysw.com/pub/fltk/1.1.7/%{name}-%{version}-source.tar.bz2
-# Source0-md5: 2e29319119adc9d63b2f26b72cae0a88
-Source1: http://www.fltk.org/doc-1.1/%{name}.pdf
-# Source1-md5: d3a073741c94d532ec7af9d96c138ea3
-Patch0: %{name}-link.patch
-Patch1: %{name}-cxx.patch
+Source0: http://fltk.org/pub/fltk/%{version}/%{name}-%{version}-source.tar.gz
+# Source0-md5: 9f7e707d4fb7a5a76f0f9b73ff70623d
+Patch0: %{name}-desktop.patch
+Patch1: %{name}-1.3.0-as-needed.patch
+Patch2: %{name}-link.patch
+Patch3: %{name}-libjpeg.patch
URL: http://www.fltk.org/
%{?with_opengl:BuildRequires: OpenGL-GLU-devel}
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.50
+BuildRequires: doxygen
+BuildRequires: groff
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
BuildRequires: libstdc++-devel
BuildRequires: rpmbuild(macros) >= 1.315
-BuildRequires: xorg-lib-libX11-devel
BuildRequires: xorg-lib-libXext-devel
%{?with_xft:BuildRequires: xorg-lib-libXft-devel}
+BuildRequires: xorg-lib-libXinerama-devel
BuildRequires: xorg-util-makedepend
Obsoletes: libfltk1.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary(pt_BR.UTF-8): Arquivos de inclusão para o FLTK
Group: X11/Development/Libraries
Requires: %{name} = %{version}-%{release}
+Requires: libjpeg-devel
+Requires: libpng-devel
Requires: libstdc++-devel
+%{?with_xft:Requires: xorg-lib-libXft-devel}
+Requires: xorg-lib-libXinerama-devel
Obsoletes: libfltk1.1-devel
%description devel
%description gl-static -l pl.UTF-8
Statyczna biblioteka FLTK GL.
+%package games
+Summary: FLTK Games
+Summary(pl.UTF-8): Gry FLTK
+Group: X11/Applications/Games
+Requires: %{name} = %{version}-%{release}
+
+%description games
+FLTK games: Block Attack!, Checkers, or Sudoku on your computer.
+
+%description games -l pl.UTF-8
+Gry FLTK: Atak Klocków!, Warcaby, Sudoku.
+
%prep
%setup -q
%patch0 -p1
%patch1 -p1
-
-install %{SOURCE1} .
+%patch2 -p1
+%patch3 -p1
%build
%{__autoconf}
%configure \
+ --enable-largefile \
--enable-shared \
+ --enable-threads \
+ --enable-xinerama \
--with-x \
+ --with-optim="%{rpmcxxflags}" \
%{!?with_opengl:--disable-gl} \
%{?with_xft:--enable-xft}
-%{__make} depend
%{__make}
+cd documentation
+%{__make} html
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}/FL,%{_libdir},%{_mandir}/man{1,3}}
-
-if [ "%{_lib}" != "lib" ] ; then
- ln -sf $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_prefix}/lib
-fi
%{__make} install \
- libdir=$RPM_BUILD_ROOT%{_libdir} \
- includedir=$RPM_BUILD_ROOT%{_includedir} \
- bindir=$RPM_BUILD_ROOT%{_bindir}
+ install-desktop \
+ DESTDIR=$RPM_BUILD_ROOT
-if [ "%{_lib}" != "lib" ] ; then
- rm $RPM_BUILD_ROOT%{_prefix}/lib
-fi
+# less generic games' names
+for f in blocks checkers sudoku ; do
+mv -f $RPM_BUILD_ROOT%{_bindir}/{,fltk-}${f}
+mv -f $RPM_BUILD_ROOT%{_mandir}/man6/{,fltk-}${f}.6
+done
-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
+# add link to documentation for fluid help; remove /usr/share/doc/fltk contents - it is installed during make install
+rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}
+ln -sf %{name}-devel-%{version} $RPM_BUILD_ROOT%{_datadir}/doc/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%files devel
%defattr(644,root,root,755)
-%doc documentation/*.{html,gif,jpg} fltk.pdf
+%doc documentation/html/*.{html,jpg,png}
+%doc %{_datadir}/doc/%{name}
%attr(755,root,root) %{_bindir}/fltk-config
%attr(755,root,root) %{_bindir}/fluid
%attr(755,root,root) %{_libdir}/libfltk.so
%{_includedir}/FL
%exclude %{_includedir}/FL/Fl_Gl_Window.*
%exclude %{_includedir}/FL/gl*
-%{_mandir}/man[13]/*
+%{_iconsdir}/*/*/*/fluid.png
+%{_desktopdir}/fluid.desktop
+# move to some KDE package?
+#%{_datadir}/mimelnk/application/x-fluid.desktop
+%{_mandir}/man1/fltk-config.1*
+%{_mandir}/man1/fluid.1*
+%{_mandir}/man3/fltk.3*
%files static
%defattr(644,root,root,755)
%defattr(644,root,root,755)
%{_libdir}/libfltk_gl.a
%endif
+
+%files games
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/%{name}-blocks
+%attr(755,root,root) %{_bindir}/%{name}-checkers
+%attr(755,root,root) %{_bindir}/%{name}-sudoku
+%{_iconsdir}/*/*/*/blocks.png
+%{_iconsdir}/*/*/*/checkers.png
+%{_iconsdir}/*/*/*/sudoku.png
+%{_desktopdir}/blocks.desktop
+%{_desktopdir}/checkers.desktop
+%{_desktopdir}/sudoku.desktop
+%{_mandir}/man6/%{name}-blocks.6*
+%{_mandir}/man6/%{name}-checkers.6*
+%{_mandir}/man6/%{name}-sudoku.6*