#
# spec file for package dconf
#
# Copyright (c) 2011 SUSE LINUX Products 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/
#



Name:           dconf
Version:        0.10.0
Release:        1
# FIXME: remove sed hack to remove icon from desktop file when there's an icon in the tarball
License:        LGPLv2.1+
Summary:        Simple key-based configuration system
Group:          System/Libraries
Url:            http://live.gnome.org/dconf
Source:         http://download.gnome.org/sources/dconf/0.10/%{name}-%{version}.tar.bz2
Source99:       baselibs.conf
# For directory ownership
BuildRequires:  dbus-1
BuildRequires:  update-desktop-files
BuildRequires:  vala-devel
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(gio-2.0) >= 2.29.90
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libxml-2.0)
%if 0%{?BUILD_FROM_VCS}
BuildRequires:  gtk-doc
%endif
# dconf provides a dbus service, but has no dependency on dbus in any way
# (because it uses gdbus), so we need an explicit Requires
Requires:       dbus-1

%description
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

%package -n libdconf0
License:        LGPLv2.1+
Summary:        Simple key-based configuration system -- Library
Group:          System/Libraries
# The library doesn't really work if the dconf service is not reachable, so we
# need a Requires
Requires:       %{name} = %{version}

%description -n libdconf0
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

%package -n libdconf-dbus-1-0
License:        LGPLv2.1+
Summary:        Simple key-based configuration system -- Library for D-Bus
Group:          System/Libraries
# The library doesn't really work if the dconf service is not reachable, so we
# need a Requires
Requires:       %{name} = %{version}

%description -n libdconf-dbus-1-0
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

%package -n gsettings-backend-dconf
License:        LGPLv2.1+
Summary:        Simple key-based configuration system -- GSettings Backend
Group:          System/Libraries
Requires:       %{name} = %{version}
# We really want this to be used as the default GSettings backend
Supplements:    libgio-2_0-0
%glib2_gio_module_requires

%description -n gsettings-backend-dconf
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

This package provides a GSettings backend that uses dconf to store
the settings.

%package editor
License:        LGPLv2.1+
Summary:        Simple key-based configuration system -- Graphical Editor
Group:          System/GUI/GNOME
Requires:       %{name} = %{version}
%glib2_gsettings_schema_requires

%description editor
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

This package provides a graphical editor for dconf database.

%package devel
License:        LGPLv2.1+
Summary:        Simple key-based configuration system -- Development Files
Group:          Development/Libraries/GNOME
Requires:       libdconf0 = %{version}

%description devel
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

%package -n libdconf-dbus-devel
License:        LGPLv2.1+
Summary:        Simple key-based configuration system -- Development Files
Group:          Development/Libraries/GNOME
Requires:       libdconf-dbus-1-0 = %{version}

%description -n libdconf-dbus-devel
dconf is a low-level configuration system. Its main purpose is to
provide a backend to GSettings on platforms that don't already
have configuration storage systems.

%prep
%setup -q

%if 0%{?BUILD_FROM_VCS}
[ -x ./autogen.sh ] && NOCONFIGURE=1 ./autogen.sh
%endif

%build
%configure \
%if 0%{?BUILD_FROM_VCS}
    --enable-gtk-doc
%endif

%__make V=1 %{?_smp_mflags}

%install
%makeinstall
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
%suse_update_desktop_file %{buildroot}%{_datadir}/applications/dconf-editor.desktop SystemSetup
# FIXME: temporary hack to make the build not fail while we have no icon
sed -i "s/^Icon=dconf-editor/#Icon=dconf-editor/" %{buildroot}%{_datadir}/applications/dconf-editor.desktop
mkdir -p %{buildroot}%{_sysconfdir}/dconf/{profile,db}

%post -n libdconf0 -p /sbin/ldconfig

%postun -n libdconf0 -p /sbin/ldconfig

%post -n libdconf-dbus-1-0 -p /sbin/ldconfig

%postun -n libdconf-dbus-1-0 -p /sbin/ldconfig

%post -n gsettings-backend-dconf
%glib2_gio_module_post

%postun -n gsettings-backend-dconf
%glib2_gio_module_postun

%post editor
%desktop_database_post
%glib2_gsettings_schema_post

%postun editor
%desktop_database_postun
%glib2_gsettings_schema_postun

%files
%defattr(-, root, root)
%doc COPYING NEWS
# small utility to read values in the database
%{_bindir}/dconf
# service is needed for write
%{_libexecdir}/dconf-service
%{_datadir}/dbus-1/services/ca.desrt.dconf.service
%{_datadir}/dbus-1/system-services/ca.desrt.dconf.service
# Bash completion helper
%{_sysconfdir}/bash_completion.d/dconf-bash-completion.sh
# alternative databases
%{_sysconfdir}/dconf/

%files -n libdconf0
%defattr(-, root, root)
%{_libdir}/libdconf.so.*

%files -n libdconf-dbus-1-0
%defattr(-, root, root)
%{_libdir}/libdconf-dbus-1.so.*

%files -n gsettings-backend-dconf
%defattr(-, root, root)
%{_libdir}/gio/modules/libdconfsettings.so

%files editor
%defattr(-, root, root)
%{_bindir}/dconf-editor
%{_datadir}/applications/dconf-editor.desktop
%{_datadir}/dconf-editor/
%{_datadir}/glib-2.0/schemas/ca.desrt.dconf-editor.gschema.xml

%files devel
%defattr(-, root, root)
%doc %{_datadir}/gtk-doc/html/dconf/
%{_includedir}/dconf/
%{_libdir}/libdconf.so
%{_libdir}/pkgconfig/dconf.pc
%dir %{_datadir}/vala
%dir %{_datadir}/vala/vapi
%{_datadir}/vala/vapi/dconf.*

%files -n libdconf-dbus-devel
%defattr(-, root, root)
%{_includedir}/dconf-dbus-1/
%{_libdir}/libdconf-dbus-1.so
%{_libdir}/pkgconfig/dconf-dbus-1.pc

%changelog