File planner.spec of Package planner

#
# spec file for package planner
#
# Copyright (c) 2013 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/
#


%define build_eds 0%{?suse_version} <= 1220
%define build_eds_backend 0%{?suse_version} <= 1130

Name:           planner
Version:        0.14.6
Release:        0
# FIXME: on update to new version, check if we can reenable eds and the eds backend
Summary:        Project Management Application for GNOME
License:        GPL-2.0+
Group:          Productivity/Office/Management
Url:            http://live.gnome.org/Planner
Source:         http://download.gnome.org/sources/planner/0.14/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM planner-cmdline.patch bnc#774972 bgo#656372 dimstar@opensuse.org -- Fix for broken "open file on startup" behaviour
Patch0:         planner-cmdline.patch
# PATCH-FIX-UPSTREAM planner-libgnome.patch bgo#681497 bnc#775189 dimstar@opensuse.org -- Link libsql-plugin to libgnome.
Patch1:         planner-libgnome.patch
%if %build_eds
BuildRequires:  evolution-data-server-devel
%if %build_eds_backend
BuildRequires:  evolution-devel
%endif
%endif
BuildRequires:  fdupes
BuildRequires:  gnome-common
BuildRequires:  gtk-doc
BuildRequires:  intltool
BuildRequires:  libglade2-devel
BuildRequires:  libgnomecanvas-devel
BuildRequires:  libgnomeui-devel
BuildRequires:  libxslt-devel >= 1.1.23
BuildRequires:  python-devel
BuildRequires:  python-gtk-devel
BuildRequires:  rarian-scrollkeeper-compat
# We need the %%mime_database_* macros
BuildRequires:  shared-mime-info
BuildRequires:  translation-update-upstream
BuildRequires:  update-desktop-files
Requires:       gnome-icon-theme
Requires:       python-gtk
Recommends:     %{name}-lang
Provides:       mrproject
Obsoletes:      mrproject <= 0.10
%if ! (%build_eds)
# In case we don't build the evolution sub-package, we need to obsolete it for clean upgrade paths.
Obsoletes:      %{name}-evolution <= %{version}
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%gconf_schemas_prereq
%py_requires

%description
Planner is a project management tool for the GNOME desktop, for
planning, scheduling and tracking projects.

%if %build_eds
%package evolution
Summary:        Planner integration with Evolution
Group:          Productivity/Office/Management
Requires:       %{name} = %{version}
Supplements:    packageand(planner:evolution)

%description evolution
Planner is a project management tool for the GNOME desktop, for
planning, scheduling and tracking projects.
%endif

%package devel
Summary:        Project Management Application for GNOME
Group:          Productivity/Office/Management
Requires:       %{name} = %{version}
Provides:       %{name}-doc = %{version}
Obsoletes:      %{name}-doc < %{version}

%description devel
Planner is a project management tool for the GNOME desktop, for
planning, scheduling and tracking projects.

%lang_package
%prep
%setup -q
%patch0 -p1
%patch1 -p1
translation-update-upstream

%build
NOCONFIGURE=1 gnome-autogen.sh
%configure --disable-static --with-pic \
    --disable-schemas-install \
    --disable-scrollkeeper \
    --disable-update-mimedb \
    --enable-gtk-doc \
    --with-database=no \
    --enable-python \
    --enable-python-plugin \
%if %build_eds
    --enable-eds \
%else
    --disable-eds \
%endif
%if %build_eds_backend
    --enable-eds-backend
%else
    --disable-eds-backend
%endif
make %{?jobs:-j%jobs} sqldocdir=%{_docdir}/%{name} sampledir=%{_docdir}/%{name}

%install
%makeinstall sqldocdir=%{_docdir}/%{name} sampledir=%{_docdir}/%{name}
find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
cp AUTHORS COPYING ChangeLog NEWS README COPYING $RPM_BUILD_ROOT%{_docdir}/%{name}
%find_lang %{name} %{?no_lang_C}
%find_gconf_schemas
%suse_update_desktop_file -N "Planner" -G "Project Management" -C "" planner
%fdupes -s $RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%pre -f %{name}.schemas_pre

%post
/sbin/ldconfig
%if 0%{?suse_version} > 1130
%desktop_database_post
%icon_theme_cache_post
%mime_database_post
%else
if test -x usr/bin/update-mime-database ; then
  usr/bin/update-mime-database usr/share/mime >/dev/null
fi
%endif

%postun
/sbin/ldconfig
%if 0%{?suse_version} > 1130
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun
%else
if test -x usr/bin/update-mime-database ; then
  usr/bin/update-mime-database usr/share/mime >/dev/null
fi
%endif

%posttrans -f %{name}.schemas_posttrans

%preun -f %{name}.schemas_preun

%files -f %{name}.schemas_list
%defattr(-, root, root)
%doc %{_docdir}/%{name}
%dir %{_datadir}/gnome/
%dir %{_datadir}/gnome/help/
%dir %{_datadir}/gnome/help/%{name}/
%doc %{_datadir}/gnome/help/%{name}/C/
%dir %{_datadir}/omf/
%dir %{_datadir}/omf/%{name}/
%doc %{_datadir}/omf/%{name}/%{name}-C.omf
%{_bindir}/*
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/48x48/mimetypes/*.png
%{_datadir}/mime/packages/planner.xml
%{_datadir}/pixmaps/*.png
%{_libdir}/*.so.*
%{_libdir}/planner
%{_datadir}/planner
%{py_sitedir}/*.so
%doc %{_mandir}/man1/planner.1*
%exclude %{_libdir}/planner/plugins/libeds-plugin.so

%if %build_eds
%files evolution
%defattr(-, root, root)
%if %build_eds_backend
%{_libdir}/evolution-data-server-*/extensions/*.so*
%{_libdir}/evolution/*/plugins/*.so
%{_libdir}/evolution/*/plugins/*.eplug
%endif
%{_libdir}/planner/plugins/libeds-plugin.so
%endif

%files lang -f %{name}.lang

%files devel
%defattr(-, root, root)
%{_libdir}/pkgconfig/*.pc
%{_includedir}/planner-1.0
%{_libdir}/*.so
%{_datadir}/gtk-doc/html/libplanner
# Own these repositories to not depend on gtk-doc while building:
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html

%changelog
openSUSE Build Service is sponsored by