%define _name fltk
-%define _snap r6671
+%define _snap r6793
%define _version 2.0
+# Conditional build:
+%bcond_with cairo # without cairo support
+#
Summary: Fast Light Tool Kit 2.x
Summary(pl.UTF-8): FLTK - "lekki" X11 toolkit wersja 2.x
-Summary(pt_BR.UTF-8): Interface gráfica em C++ para X, OpenGL e
-Windows
+Summary(pt_BR.UTF-8): Interface gráfica em C++ para X, OpenGL e Windows
Name: fltk2
-Version: 2.0.%{_snap}
-Release: 1
+Version: 2.0
+Release: 0.%{_snap}.1
License: LGPL with amendments (see COPYING)
Group: X11/Libraries
-Source0:
-http: //ftp.easysw.com/pub/fltk/snapshots/%{_name}-%{_version}.x-%{_snap}.tar.bz2
-# Source0-md5: 6bcef5fd51eb3bc4dd0702f3ae6da6ba
+Source0: http://ftp.easysw.com/pub/fltk/snapshots/%{_name}-%{_version}.x-%{_snap}.tar.bz2
+# Source0-md5: 3e413b2063bdb3d1a6ad4832458d885d
+Patch0: %{name}-rpath.patch
+Patch1: %{name}-soname.patch
+Patch2: %{name}-gcc43.patch
+Patch3: %{name}-glibc2.10-scandir.patch
URL: http://www.fltk.org/
BuildRequires: autoconf
-BuildRequires: cairo-devel
+BuildRequires: Mesa-libGLU-devel
+# don't build with cairo support if you're planning to use fltk2 with
+# dillo 2.x
+%{?with_cairo:BuildRequires: cairo-devel}
BuildRequires: libstdc++-devel
BuildRequires: rpmbuild(macros) >= 1.315
BuildRequires: xorg-lib-libX11-devel
%prep
%setup -q -n %{_name}-%{_version}.x-%{_snap}
+%patch0 -p0
+%patch1 -p0
+%patch2 -p1
+%patch3 -p0
%build
%{__sed} -i -e '/fltk2-config/s/^\t/\t$(DESTDIR)/' fluid/Makefile
%{__autoconf}
%configure \
- --enable-cairo \
+ --%{?with_cairo:en}%{!?with_cairo:dis}able-cairo \
--enable-shared \
--enable-threads \
--enable-xinerama \
%install
rm -rf $RPM_BUILD_ROOT
+
install -d $RPM_BUILD_ROOT%{_mandir}/man{1,3}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
# install man by hand
-%{__mv} documentation/fltk2-config.man
-%$RPM_BUILD_ROOT%{_mandir}/man1/fltk2-config.1
+%{__mv} documentation/fltk2-config.man $RPM_BUILD_ROOT%{_mandir}/man1/fltk2-config.1
%{__mv} documentation/fluid.man $RPM_BUILD_ROOT%{_mandir}/man1/fluid.1
%{__mv} documentation/fltk.man $RPM_BUILD_ROOT%{_mandir}/man3/fltk.3
+# broken so linking, the idea stolen from
+# https://bugzilla.redhat.com/show_bug.cgi?id=477683
+ln -fs $(basename $RPM_BUILD_ROOT%{_libdir}/libfltk2.so.*.*) $RPM_BUILD_ROOT%{_libdir}/libfltk2.so
+ln -fs $(basename $RPM_BUILD_ROOT%{_libdir}/libfltk2.so.*.*) $RPM_BUILD_ROOT%{_libdir}/libfltk2.so
+ln -fs $(basename $RPM_BUILD_ROOT%{_libdir}/libfltk2_gl.so.*.*) $RPM_BUILD_ROOT%{_libdir}/libfltk2_gl.so
+ln -fs $(basename $RPM_BUILD_ROOT%{_libdir}/libfltk2_glut.so.*.*) $RPM_BUILD_ROOT%{_libdir}/libfltk2_glut.so
+ln -fs $(basename $RPM_BUILD_ROOT%{_libdir}/libfltk2_images.so.*.*) $RPM_BUILD_ROOT%{_libdir}/libfltk2_images.so
+
%clean
rm -rf $RPM_BUILD_ROOT