Blob Blame Raw
%bcond_without check

Name:           gplugin
Version:        0.27.0
Release:        10%{?dist}
Summary:        GObject based library that implements a reusable plugin system

License:        LGPLv2+
URL:            https://bitbucket.org/gplugin/main/wiki/Home
Source0:        https://bitbucket.org/gplugin/main/downloads/%{name}-%{version}.tar.bz2

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  %{_bindir}/help2man
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(gmodule-2.0)
%if %{with check}
BuildRequires:  %{_bindir}/gtester
BuildRequires:  %{_bindir}/xsltproc
%endif
BuildRequires:  %{_bindir}/xgettext
BuildRequires:  %{_bindir}/msgfmt
BuildRequires:  %{_bindir}/msgmerge
Requires:       %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description
GPlugin is a GObject based library that implements a reusable plugin system
which supports loading plugins in other languages via loaders.
It relies heavily on GObjectIntrospection to expose its API to the other
languages.

It has a very simple API which makes it very simple to use in your application.

%package        libs
Summary:        Library for %{name}

%description    libs
%{summary}.

%package        gtk
Summary:        GTK+ applications for %{name}
BuildRequires:  pkgconfig(gtk+-3.0)
Requires:       %{name}-gtk-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description    gtk
%{summary}.

%package        gtk-libs
Summary:        GTK+ libraries for %{name}
Requires:       %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description    gtk-libs
%{summary}.

%package        loader-python
Summary:        Python loader for %{name}
BuildRequires:  pkgconfig(python3)
BuildRequires:  pkgconfig(pygobject-3.0)
Requires:       %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description    loader-python
%{summary}.

%package        loader-lua
Summary:        Lua loader for %{name}
BuildRequires:  pkgconfig(lua)
BuildRequires:  lua-lgi
Requires:       %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description    loader-lua
%{summary}.

%package        devel
Summary:        Development libraries and header files for %{name}-libs
Requires:       %{name}-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description    devel
%{summary}.

%package        gtk-devel
Summary:        Development libraries and header files for %{name}-gtk-libs
Requires:       %{name}-gtk-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}

%description    gtk-devel
%{summary}.

%prep
%autosetup
# Pretty much not interested in automatically installed docs
sed -i -e "/CMAKE_INSTALL_DOCDIR/d" CMakeLists.txt

%build
mkdir %{_target_platform}
pushd %{_target_platform}
  %cmake .. \
    -DTESTING_ENABLED=%{?with_check:ON}%{!?with_check:OFF} \
    %{nil}
popd
%make_build -C %{_target_platform}

%install
%make_install -C %{_target_platform}

%if %{with check}
%check
# Everything is tested during build process...
%endif

# Remove unnecessary library search path.
sed -i 's/-L\${libdir} //g' %{buildroot}%{_libdir}/pkgconfig/%{name}.pc
sed -i 's/-L\${libdir} //g' %{buildroot}%{_libdir}/pkgconfig/%{name}-gtk.pc

%files
%{_bindir}/%{name}-query
%{_mandir}/man1/%{name}-query.1*

%ldconfig_scriptlets libs

%files libs
%license COPYING
%doc ChangeLog README
%{_libdir}/lib%{name}.so.*
%dir %{_libdir}/%{name}/
%{_libdir}/%{name}/%{name}-license-check.so
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/GPlugin-0.0.typelib

%files gtk
%{_bindir}/%{name}-gtk-viewer
%{_mandir}/man1/%{name}-gtk-viewer.1*

%ldconfig_scriptlets gtk-libs

%files gtk-libs
%{_libdir}/lib%{name}-gtk.so.*

%files loader-python
%{_libdir}/%{name}/%{name}-python.so

%files loader-lua
%{_libdir}/%{name}/%{name}-lua.so

%files devel
%{_libdir}/lib%{name}.so
%dir %{_includedir}/%{name}-1.0/
%{_includedir}/%{name}-1.0/%{name}/
%{_includedir}/%{name}-1.0/%{name}.h
%{_includedir}/%{name}-1.0/%{name}-native.h
%{_libdir}/pkgconfig/%{name}.pc
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/GPlugin-0.0.gir

%files gtk-devel
%{_libdir}/lib%{name}-gtk.so
%{_includedir}/%{name}-1.0/%{name}-gtk/
%{_includedir}/%{name}-1.0/%{name}-gtk.h
%{_libdir}/pkgconfig/%{name}-gtk.pc
%{_datadir}/%{name}/

%changelog
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.27.0-7
- Switch to %%ldconfig_scriptlets

* Fri Aug 11 2017 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.27.0-6
- Remove extraneous pkgconfig library path.

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jan 10 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.27.0-2
- Add missing ldconfig scriptlets

* Mon Jan 09 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.27.0-1
- Initial package