Name: planner
Summary: A graphical project management tool.
Summary(ja): グラフィカルなプロジェクト管理ツール
Version: 0.14.6
Release: 1%{?_dist_release}

Group: Applications/Productivity
License: GPLv2+
URL:http://live.gnome.org/Planner

Source0: %{name}-%{version}.tar.xz
Patch1:  planner-gnome596173-xdg.patch
Patch2:  planner-gnome596966-editoninsert.patch
Patch3:  planner-gnome550559-fitzoom.patch
Patch4:  planner-gnome603693-planner-calendar-for-edittask.patch
Patch5:  planner-gnome604169-comboboxentry.patch
Patch6:  planner-gnome604510.calcolors.patch
Patch7:  planner-gnome604531-tooltips.patch
Patch8:  planner-gnome581282-printpreview.patch
Patch9:  planner-gnome606824-notecolumn.patch
Patch10: planner-gnome341504-paste.tasks.patch
Patch11: planner-gnome615641-multiselect.patch
Patch12: planner-gnome655803-bad-LC_TIME.patch
Patch13: planner-desktop-warnings.patch
Patch14: planner-aarch64.patch
Patch15: planner-rhbz1141479-paste.tasks.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires:	autoconf
BuildRequires:  automake
BuildRequires:	glib2-devel
BuildRequires:	gnome-vfs2-devel >= 2.10.0
BuildRequires:	gtk-doc
BuildRequires:	gtk2-devel >= 2.6.0
BuildRequires:	libICE-devel
BuildRequires:	libSM-devel
BuildRequires:	libglade2-devel >= 2.4.0
BuildRequires:	libgnomecanvas-devel >= 2.10.0
BuildRequires:	libgnomeui-devel >= 2.10.0
BuildRequires:	libgsf-devel >= 1.6
BuildRequires:  libtool >= 0.35.5
BuildRequires:	libxml2-devel >= 2.6.0
BuildRequires:	libxslt-devel >= 1.1.23
BuildRequires:  popt-devel
BuildRequires:	pygtk2-devel >= 2.6.0
BuildRequires:	python-devel
BuildRequires:  scrollkeeper
BuildRequires:  valgrind-devel 

Obsoletes: planner-eds < 0.14.6
Obsoletes: mrproject <= 0.11
Obsoletes: libmrproject <= 0.11
Provides: libplanner = %{version}-%{release}

Requires(post,postun): scrollkeeper >= 0.3.10
Requires(post,postun): shared-mime-info
Requires(post,postun): GConf2

Vendor: Project Vine
Distribution: Vine Linux
Packager: inagaki

%description
Planner is a visual project management application which allows users to
manage several aspects of a project, including schedule tracking using
Gantt charts.

You should install Planner if you wish to manage schedules, allocate
resources, and track the progress of your projects.

%description -l ja
Planner はプロジェクトをさまざまな視点から管理することができる
グラフィカルなプロジェクト管理ツールで，ガントチャートを使った
スケジュール追跡などを行うことができます．


%package devel
Summary: Libraries and include files for developing with planner
Summary(ja): Planner の開発用ファイル
Group: Development/Libraries
Requires: %{name} = %{version}
Requires: glib2-devel
Requires: libgsf-devel
Requires: libxml2-devel
Obsoletes: libmrproject-devel <= 0.11
Provides: libplanner-devel = %{version}

%description devel
This package provides the necessary development libraries and include
files to allow you to develop with planner.


#%package database
#Summary:     Planner database support
#Summary(ja): Planner データベースサポート
#Group:       Applications/Productivity
#Requires:    %{name} = %{version}
#Requires:    libgda
#
#%description database
#Database support for Planner, this plugin can be used to store 
#projects in a PostgreSQL database.
#
#%description -l ja database
#Planner のデータベースサポートです．このプラグインを使うことで
#プロジェクトを PostgreSQL データベースに保存することができます．

#%package eds
#Summary:    Planner integration with evolution
#Summary(ja): Planner の evolution 用プラグイン
#Group:      Applications/Productivity
#Requires:  %{name} = %{version}-%{release}
#
#%description eds
#This package provides a plugin to integration planner and evolution.
#
#%description eds -l ja
#このパッケージは planner と evolution を連携できるようにする
#プラグインを提供します。

%prep
%setup -q
%patch1  -p1 -b .xdg
%patch2  -p1 -b .editoninsert
%patch3  -p1 -b .fitzoom
%patch4  -p1 -b .edittask
%patch5  -p1 -b .combobox
%patch6  -p1 -b .calcolors
%patch7  -p1 -b .tooltips
%patch8  -p1 -b .printpreview
%patch9  -p1 -b .notecolumn
%patch10 -p1 -b .copypaste
%patch11 -p1 -b .multiselect
%patch12 -p1 -b .gnome655803
%patch13 -p1 -b .desktop-warnings
%patch14 -p1 -b .aarch64
%patch15 -p1 -b .systemvalgrind

%build
rm -rf libegg
autoreconf -f -i

%configure \
    --enable-python \
    --disable-gtk-doc \
    --disable-update-mimedb \
    --disable-eds \
    --disable-eds-backend \
    --disable-static

make

%install
rm -rf $RPM_BUILD_ROOT

export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
make DESTDIR=$RPM_BUILD_ROOT install
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

#desktop-file-install --vendor imendio --delete-original       \
#  --dir %{buildroot}%{_datadir}/applications             \
#  --add-category X-Red-Hat-Base                             \
#  %{buildroot}%{_datadir}/applications/planner.desktop

rm -rf $RPM_BUILD_ROOT/var/scrollkeeper
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/file-modules/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/storage-modules/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/plugins/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/views/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/gtk-2.0/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/*.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/storage-modules/libstorage-sql*
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/plugins/libsql-plugin*

rm -f $RPM_BUILD_ROOT/%{_datadir}/mime/XMLnamespaces
rm -f $RPM_BUILD_ROOT/%{_datadir}/mime/globs
rm -f $RPM_BUILD_ROOT/%{_datadir}/mime/magic
rm -f $RPM_BUILD_ROOT/%{_datadir}/mime/application/*
rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/%{name}/*.sql
rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/%{name}/*.planner

#rhbz#1053553 wrong glibc locale name for sr-Latn
mv $RPM_BUILD_ROOT/%{_datadir}/locale/sr@Latn $RPM_BUILD_ROOT/%{_datadir}/locale/sr@latin

%find_lang %{name} 

%post 
/sbin/ldconfig
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
touch --no-create %{_datadir}/mime/packages &>/dev/null || :
scrollkeeper-update > /dev/null 2>&1 || :
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/planner.schemas > /dev/null

%postun
/sbin/ldconfig
scrollkeeper-update > /dev/null 2>&1 || :
if [ $1 -eq 0 ] ; then
  touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
  gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
  /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
update-mime-database %{_datadir}/mime &> /dev/null || :

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root)
%doc ChangeLog NEWS README COPYING examples/*.planner
%{_sysconfdir}/gconf/schemas/*.schemas
%{_bindir}/planner
%{_libdir}/planner
%{_libdir}/libplanner*.so.*
%{_libdir}/python*/site-packages/*.so
%{_datadir}/applications/*
%{_datadir}/mime/packages/*
%{_datadir}/pixmaps/*
%{_datadir}/icons/*
%{_datadir}/planner
%{_datadir}/gnome/help/planner
%{_datadir}/omf/planner
%{_mandir}/man1/planner*
%exclude %{_datadir}/planner/glade/sql.glade
%exclude %{_datadir}/planner/ui/sql-plugin.ui
%exclude %{_datadir}/planner/sql

%files devel
%defattr(-, root, root, 0755)
%{_includedir}/*
%{_libdir}/libplanner*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/gtk-doc/html/libplanner

#%files database
#%defattr(-,root,root)
#%doc docs/sql/README.sql
#%{_libdir}/planner/storage-modules/libstorage-sql*
#%{_libdir}/planner/plugins/libsql-plugin*
#%{_datadir}/planner/glade/sql.glade
#%{_datadir}/planner/ui/sql-plugin.ui
#%{_datadir}/planner/sql

#files eds
#defattr(-,root,root,-)
#dir %{_libdir}/%{name}/plugins
#dir %{_libdir}/evolution-data-server-1.2
#dir %{_libdir}/evolution-data-server-1.2/extensions
#{_libdir}/evolution-data-server-1.2/extensions/libecalbackendplanner.so
#{_libdir}/evolution/*/plugins/liborg-gnome-planner-source.so
#{_libdir}/evolution/*/plugins/org-gnome-planner-source.eplug

%changelog
* Sun Oct  5 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 0.14.6-1
- updated to 0.14.6
- removed eds subpackages
- added Patches from FC

* Sat Jun 18 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 0.14.4-2
- rebuild for Vine Linux 6
- add BuildRequires: libSM-devel, libICE-devel, python-devel
- add Patch0 to fix build error
- import Patch1 from fedora development (to follow eds api change)

* Mon May 25 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 0.14.4-1
- new upstream release
- update URL
- update configure option
  change --enable-eds to --enable-eds-backend (upstream change)
  change --enable-database to --with-database (upstream change)
  set --with-database=no (drop database support)
  add --disable-static
- add BuildRequies: evolution-devel

* Mon Jul 21 2008 Shu KONNO <owa@bg.wakwak.com> 0.14.3-2
- rebuilt with python-2.5.2

* Mon Jun 23 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.14.3-1
- new upstream release
- using --enable-eds
- spec in UTF-8

* Wed Sep 27 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.14.1-0vl1
- new upstream release
- using --enable-database 

* Sat Apr 16 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.14-0vl1
- new upstream release
- using --disable-database 
- run update-mime-database on %post and %postun

* Sat Apr 16 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.13-0vl1
- new upstream release
- added examples
- split devel package

* Sat Feb 12 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.12.1-0vl2
- rebuild with new libgdb

* Wed Oct  6 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.12.1-0vl1
- new upstream release
- add Japanese summary and description
- update URL

* Sat Jul 10 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.12-0vl1
- new upstream release
- new planner-database subpackage 
- fixed typo at changelog

* Tue Apr 27 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.11-1vl1
- rebuild for Vine
- disable postgres option

* Thu Apr 8 2004 Dan Williams <dcbw@redhat.com> 0.11-1
- Initial Release of 0.11 RPMs
