File devhelp.spec of Package devhelp

#
# spec file for package devhelp
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%define vimplugin_dir %{_datadir}/vim/site

Name:           devhelp
Version:        3.26.1
Release:        0
Summary:        Developer's Help Program for GNOME
License:        GPL-2.0+
Group:          Development/Tools/Other
Url:            https://live.gnome.org/devhelp
Source:         http://download.gnome.org/sources/devhelp/3.26/%{name}-%{version}.tar.xz
BuildRequires:  fdupes
# For directory ownership of the plugins:
BuildRequires:  gedit
BuildRequires:  gobject-introspection-devel >= 1.30.0
BuildRequires:  intltool
BuildRequires:  translation-update-upstream
BuildRequires:  update-desktop-files
BuildRequires:  vim
BuildRequires:  pkgconfig(gio-2.0) >= 2.38
BuildRequires:  pkgconfig(gsettings-desktop-schemas)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.22
BuildRequires:  pkgconfig(webkit2gtk-4.0) >= 2.6
Recommends:     %{name}-lang
Suggests:       gedit-plugin-devhelp
Suggests:       vim-plugin-devhelp
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Devhelp is an API documentation browser for GTK+ and GNOME.

%package -n typelib-1_0-Devhelp-3_0
Summary:        Introspection bindings for the GNOME Developer Help program
Group:          System/Libraries

%description -n typelib-1_0-Devhelp-3_0
Devhelp is an API documentation browser for GTK+ and GNOME.

This package contains the gobject introspection based typelib library.

%package devel
Summary:        Development files for the GNOME Developer Help program
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       typelib-1_0-Devhelp-3_0 = %{version}

%description devel
Devhelp is an API documentation browser for GTK+ and GNOME.

%package -n gedit-plugin-devhelp
Summary:        Devhelp plugin for Gedit
Group:          Development/Tools/Other
Requires:       gedit

%description -n gedit-plugin-devhelp
Devhelp is an API documentation browser for GTK+ and GNOME.

%package -n vim-plugin-devhelp
Summary:        Devhelp plugin for Vim
Group:          Development/Tools/Other
Requires:       vim

%description -n vim-plugin-devhelp
Devhelp is an API documentation browser for GTK+ and GNOME.

%lang_package
%prep
%setup -q
translation-update-upstream

%build
%configure \
    --disable-static
make %{?_smp_mflags} V=1

%install
%make_install
# glibmm2 needs this
mkdir -p %{buildroot}%{_datadir}/devhelp/books
# install vim plugin
mkdir -p %{buildroot}%vimplugin_dir/plugin
cp -a misc/devhelp.vim %{buildroot}%vimplugin_dir/plugin
# FIXME: there's also an emacs plugin: misc/devhelp.el
%suse_update_desktop_file -G "Developer Help" org.gnome.Devhelp Documentation
%find_lang %{name} %{?no_lang_C}
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
%fdupes %{buildroot}/%{_prefix}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-, root, root)
%doc AUTHORS COPYING NEWS README
%{_bindir}/devhelp
%dir %{_datadir}/metainfo
%{_datadir}/metainfo/org.gnome.Devhelp.appdata.xml
%{_datadir}/applications/org.gnome.Devhelp.desktop
%{_datadir}/devhelp
%{_datadir}/GConf/gsettings/devhelp.convert
%{_datadir}/glib-2.0/schemas/org.gnome.devhelp.gschema.xml
%{_datadir}/icons/hicolor/*/apps/*
%{_libdir}/*.so.*
%{_datadir}/dbus-1/services/org.gnome.Devhelp.service
%{_mandir}/man1/devhelp.1%{?ext_man}

%files lang -f %{name}.lang

%files -n typelib-1_0-Devhelp-3_0
%defattr(-,root,root)
%{_libdir}/girepository-1.0/Devhelp-3.0.typelib

%files devel
%defattr(-, root, root)
%{_datadir}/gtk-doc/html/devhelp-3/
%{_datadir}/gir-1.0/Devhelp-3.0.gir
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%files -n gedit-plugin-devhelp
%defattr(-,root,root,0755)
%{_libdir}/gedit/plugins/*

%files -n vim-plugin-devhelp
%defattr(-,root,root,0755)
%vimplugin_dir/plugin/devhelp.vim

%changelog