File fltk.spec of Package fltk

#
# spec file for package fltk
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%define libname libfltk1_4
Name:           fltk
Version:        1.4.4
Release:        0
Summary:        C++ GUI Toolkit for the X Window System, OpenGL, and WIN32
License:        LGPL-2.1-or-later
Group:          Development/Libraries/X11
URL:            https://www.fltk.org/
Source0:        https://github.com/fltk/fltk/releases/download/release-%{version}/fltk-%{version}-source.tar.bz2
Source1:        baselibs.conf
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  texlive-latex
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(egl)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(libdecor-0)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(pango)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-cursor)
BuildRequires:  pkgconfig(wayland-egl)
BuildRequires:  pkgconfig(wayland-protocols)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xft)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xkbcommon)
BuildRequires:  pkgconfig(zlib)

%description
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a C++
graphical user interface toolkit for the X Window System,
OpenGL, and Microsoft Windows NT 4.0, 95, or 98. The
installation of this package requires a 3D library such as Mesa.

%package devel
Summary:        Development files for the FLTK GUI toolkit
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}

%description devel
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a C++
graphical user interface toolkit for the X Window System,
OpenGL, and Microsoft Windows NT 4.0, 95, or 98. The
installation of this package requires a 3D library such as Mesa.

%package -n %{libname}
Summary:        The FLTK GUI toolkit library
Group:          System/Libraries

%description -n %{libname}
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a C++
graphical user interface toolkit for the X Window System,
OpenGL, and Microsoft Windows NT 4.0, 95, or 98. The
installation of this package requires a 3D library such as Mesa.

%package devel-static
Summary:        Static libraries for the FLTK GUI toolkit
Group:          Development/Libraries/C and C++
Requires:       fltk-devel = %{version}

%description devel-static
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a C++
graphical user interface toolkit for the X Window System,
OpenGL, and Microsoft Windows NT 4.0, 95, or 98. The
installation of this package requires a 3D library such as Mesa.

%package fluid
Summary:        Fast Light User Interface Designer
Requires:       %{libname} = %{version}

%description fluid
%{summary}, an interactive GUI designer for %{name}.

%package options
Summary:        Fast Light User Interface Options

%description options
%{summary}.

%prep
%autosetup -p1

%build
%cmake \
  -DCMAKE_DOC_PATH="%_docdir" \
  -DFLTK_BUILD_SHARED_LIBS=ON \
  -DFLTK_OPTION_OPTIM="%{_lto_cflags} -ffat-lto-objects" \
  -DFLTK_BUILD_HTML_DOCS=ON \
  -DFLTK_BUil_PDF_DOCS=OFF \
  -DFLTK_INSTALL_HTML_DOCS=ON \
  -DFLTK_BUILD_TEST=OFF

%cmake_build
cd documentation
%cmake_build html

%install
%cmake_install

%fdupes %{buildroot}%{_datadir}/doc

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%files devel
%doc %{_datadir}/doc/fltk
%{_bindir}/fltk-config
%{_libdir}/libfltk.so
%{_libdir}/libfltk_forms.so
%{_libdir}/libfltk_gl.so
%{_libdir}/libfltk_images.so
%{_includedir}/FL
%{_datadir}/fltk
%{_mandir}/man1/fltk-config.1*
%{_mandir}/man3/fltk.3*

%files -n %{libname}
%license COPYING
%doc CHANGES.txt README.md
%{_libdir}/libfltk.so.*
%{_libdir}/libfltk_forms.so.*
%{_libdir}/libfltk_gl.so.*
%{_libdir}/libfltk_images.so.*

%files devel-static
%{_libdir}/libfltk*.a

%files fluid
%{_bindir}/fluid
%{_bindir}/fluid-shared
%{_mandir}/man1/fluid.1*
%{_datadir}/applications/fluid.desktop
%{_datadir}/mime/packages/fluid.xml
%{_datadir}/icons/hicolor/*/*/*

%files options
%{_bindir}/fltk-options
%{_bindir}/fltk-options-shared
%{_mandir}/man1/fltk-options.1*
%{_datadir}/applications/fltk-options.desktop
%{_datadir}/mime/packages/fltk-options.xml

%changelog
openSUSE Build Service is sponsored by