File aiksaurus.spec of Package aiksaurus
#
# spec file for package aiksaurus
#
# Copyright (c) 2023 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/
#
Name: aiksaurus
Version: 1.2.1
Release: 51%{?dist}
Summary: An English-language thesaurus library
License: GPL-2.0-or-later
URL: https://aiksaurus.sourceforge.net/
Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1: %{name}.png
Source2: %{name}.desktop
Patch0: %{name}-1.2.1-gcc43.patch
Patch1: %{name}-security.patch
Patch2: %{name}-configure.c99.patch
BuildRequires: desktop-file-utils
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gtk2-devel
BuildRequires: make
%description
Aiksaurus is an English-language thesaurus library that can be
embedded in word processors, email composers, and other authoring
software to provide thesaurus capabilities. A basic command line
thesaurus program is also included.
%package devel
Summary: Files for developing with aiksaurus
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description devel
Includes and definitions for developing with aiksaurus.
%package gtk
Summary: A GTK+ interface for aiksaurus
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description gtk
AiksaurusGTK is a GTK+ interface to the Aiksaurus library.
It provides an attractive thesaurus interface, and can be embedded
in GTK+ projects, notably AbiWord.
%package gtk-devel
Summary: Files for developing with aiksaurus-gtk
Requires: %{name}-devel = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}-gtk = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: gtk2-devel
%description gtk-devel
gtk includes and definitions for developing with aiksaurus.
%package thesaurus
Summary: A GTK+ frontend to aiksaurus
Requires: %{name}-gtk = %{?epoch:%{epoch}:}%{version}-%{release}
%description thesaurus
A standalone thesaurus program base on aiksaurus-gtk.
%prep
%autosetup -p1
%build
export CXXFLAGS="-std=c++14 %{optflags}"
%configure
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
%install
%make_install
# Remove libtool archives and static libs
find %{buildroot} -type f -name "*.la" -delete -print
# Add the desktop icon.
install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/%{name}.png
# Add desktop file.
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE2}
%ldconfig_scriptlets
%ldconfig_scriptlets gtk
%files
%license COPYING
%doc ChangeLog README AUTHORS
%{_bindir}/%{name}
%{_bindir}/caiksaurus
%{_libdir}/*Aiksaurus-*.so.*
%{_datadir}/%{name}/
%files devel
%dir %{_includedir}/Aiksaurus
%{_includedir}/Aiksaurus/Aiksaurus.h
%{_includedir}/Aiksaurus/AiksaurusC.h
%{_libdir}/*Aiksaurus.so
%{_libdir}/pkgconfig/%{name}-1.0.pc
%files gtk
%{_libdir}/*GTK*.so.*
%files gtk-devel
%{_includedir}/Aiksaurus/AiksaurusGTK*.h
%{_libdir}/*GTK*.so
%{_libdir}/pkgconfig/gaiksaurus-1.0.pc
%files thesaurus
%{_bindir}/gaiksaurus
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%changelog