Name:		gnome-phone-manager
Summary:	Gnome Phone Manager
Summary(ja): Gnome Phone マネージャー
Version: 	0.68
Release: 	1%{?_dist_release}
License: 	GPLv2+
Group: 		Applications/System
Source:		http://ftp.gnome.org/pub/GNOME/sources/gnome-phone-manager/%{version}/%{name}-%{version}.tar.xz
URL: 		http://usefulinc.com/software/phonemgr/
#----------------------------------------------------------------------------

BuildRoot:	%{_tmppath}/%{name}-%{version}-root

#----------------------------------------------------------------------------

BuildRequires:	gtk3-devel >= 3.0.0
BuildRequires: 	gnome-bluetooth-devel >= 3.0.0
BuildRequires:	bluez-libs-devel

BuildRequires:	gnokii-devel >= 0.6.28

BuildRequires:	gstreamer-devel >= 0.10
BuildRequires:	gnome-icon-theme >= 2.19.1
# For libebook (evolution address book)
BuildRequires:	evolution-data-server-devel >= 3.0.0
BuildRequires:	gtkspell-devel
BuildRequires:	telepathy-glib-devel
BuildRequires:	libcanberra-gtk3-devel

# search telepathy
# empathy - GNOME インスタントメッセージクラアイント
# libtelepathy - Telepathy クライアントを簡単に記述するための GLibライブラリ
# libtelepathy-devel - Development files for libtelepathy
# telepathy-filesystem - Telepathy ファイルシステムレイアウト
# telepathy-gabble - Jabber/XMPP 接続マネージャ
# telepathy-glib - Telepathy の GLib バインディング
# telepathy-glib-devel - Development files for telepathy-glib
# telepathy-haze - マルチプロトコル Libpurple 接続マネージャ
# telepathy-mission-control - Central control for Telepathy connection manager
# telepathy-mission-control-devel - Development files for telepathy-mission-control
# telepathy-salut - Link-local XMPP telepathy 接続マネージャ
# telepathy-stream-engine - メディアストリーミングを扱うための Telepathy クライア ント

BuildRequires:	perl(XML::Parser)
BuildRequires:	gettext
BuildRequires:	desktop-file-utils


# https://bugzilla.redhat.com/show_bug.cgi?id=436773
Patch0:		gpm-telepathy-workaround.patch

#----------------------------------------------------------------------------
%description
This program will connect to your mobile phone over a serial port,
either via a cable, infrared (IrDA) or Bluetooth connection.

For example it listens for text messages, and when they arrive, 
displays them on the desktop. A visual indicator is displayed in 
the notification area, if one is presently added to the panel.

#----------------------------------------------------------------------------
%package telepathy
Summary: Telepathy connection manager to send and receive SMSes
Group: Applications/System

%description telepathy
This program will connect to your mobile phone over a serial port,
either via a cable, infrared (IrDA) or Bluetooth connection.

This plugin to Telepathy allows you to send and receive messages using any
Instant Messaging application that uses Telepathy, such as Empathy.

#----------------------------------------------------------------------------
%prep
%setup -q
## %patch0 -p0

%build
%configure
make %{?_smp_mflags}

#----------------------------------------------------------------------------
%install
%{__rm} -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

# This should be in empathy instead
install -m0644 -D telepathy/sms.profile $RPM_BUILD_ROOT%{_datadir}/mission-control/profiles/sms.profile

find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';'
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'

desktop-file-install \
  --delete-original \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  --add-category X-VineLinux \
  $RPM_BUILD_ROOT%{_datadir}/applications/gnome-phone-manager.desktop

%find_lang %{name}

%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
        %{_sysconfdir}/gconf/schemas/gnome-phone-manager.schemas 	\
	>& /dev/null || :

%pre
if [ "$1" -gt 1 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule 				\
        %{_sysconfdir}/gconf/schemas/gnome-phone-manager.schemas 	\
	>& /dev/null || :
fi

%preun
if [ "$1" -eq 0 ]; then
    export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
    gconftool-2 --makefile-uninstall-rule 				\
        %{_sysconfdir}/gconf/schemas/gnome-phone-manager.schemas 	\
	>& /dev/null || :
fi

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-, root, root, -)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{_sysconfdir}/gconf/schemas/gnome-phone-manager.schemas
%{_bindir}/gnome-phone-manager
%{_libdir}/gnome-bluetooth/plugins/libphonemgr.so
%{_datadir}/applications/*.desktop
%{_datadir}/gnome-phone-manager/
%{_mandir}/man1/gnome-phone-manager.1.gz

%files telepathy
%{_libexecdir}/telepathy-phoney
%{_datadir}/telepathy/managers/*
%{_datadir}/dbus-1/services/*
%{_datadir}/mission-control/profiles/*

#----------------------------------------------------------------------------
# Maintainers: babasaki@mindgear.org
#
#----------------------------------------------------------------------------
%changelog
* Sat Oct 22 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.68-1
- new upstream release

* Sun Sep 04 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.67-2
- rebuild with evolution-data-server-3.1.90

* Sun Aug 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.67-1
- new upstream release
- change BuildRequires: gtk3-devel instead of gtk2-devel
- change BuildRequires: libcanberra-gtk3-devel instead of libcanberra-devel

* Wed Nov 03 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.65-2
- rebuils with evolution-data-server-2.32.0 and gnome-bluetooth-2.32.0

* Sat Jul 24 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.65-1
- new upstream release
- add BuildRequires: libcanberra-devel
- drop Patch0

* Mon Oct 27 2008 Seiichirou Babasaki - 0.60-4
- Import gnome-phone-manager - Packager: Babasaki
- Updated specfile

#----------------------------------------------------------------------------
* Tue Oct 07 2008 - Bastien Nocera <bnocera@redhat.com> - 0.60-3
- Rebuild for new libgnokii

* Thu Sep 11 2008  Matthias Clasen  <mclasen@redhat.com>
- Rebuild

* Wed Jun 11 2008 - Bastien Nocera <bnocera@redhat.com> - 0.60-1
- Update to 0.60
- Remove vendor from desktop file

* Wed May 14 2008 - Bastien Nocera <bnocera@redhat.com> - 0.51-2
- Rebuild

* Fri Mar 21 2008 - Bastien Nocera <bnocera@redhat.com> - 0.51-1
- Update to 0.51

* Fri Mar 14 2008 - Bastien Nocera <bnocera@redhat.com> - 0.50-3
- Add a patch from upstream to fix connection to serial devices (#356861)

* Mon Mar 10 2008 - Bastien Nocera <bnocera@redhat.com> - 0.50-2
- Work-around for telepathy brokeness

* Mon Mar 10 2008 - Bastien Nocera <bnocera@redhat.com> - 0.50-1
- Update to 0.50

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.40-3
- Autorebuild for GCC 4.3

* Wed Dec 12 2007 - Bastien Nocera <bnocera@redhat.com> - 0.40-2
- Rebuild against new release of gnokii

* Wed Nov 14 2007 - Bastien Nocera <bnocera@redhat.com> - 0.40-1
- Update to 0.40
- Add experimental telepathy backend in a subpackage

* Mon Oct 29 2007 - Bastien Nocera <bnocera@redhat.com> - 0.30-1
- Update to 0.30
- Fix sending non-ASCII texts (for real)
- Add debugging improvements

* Wed Oct 17 2007 - Bastien Nocera <bnocera@redhat.com> - 0.20-1
- Update to 0.20

* Sun Aug 19 2007 - Bastien Nocera <bnocera@redhat.com> - 0.10-1
- Update to 0.10 (#253400)
- Remove obsolete work-arounds and dependencies
- Update BRs
- Add GConf scriptlets

* Fri Aug 17 2007 Linus Walleij <triad@df.lth.se> 0.8-6
- Update license field from GPL to GPLv2+

* Sun Nov 15 2006 Linus Walleij <triad@df.lth.se> 0.8-5
- Rebuild to pick up libbtctl i/f bump.

* Sun Oct 29 2006 Linus Walleij <triad@df.lth.se> 0.8-4
- Rebuild to pick up libedataserver i/f bump.

* Sun Oct 8 2006 Linus Walleij <triad@df.lth.se> 0.8-3
- Pick up intltool.

* Sun Oct 8 2006 Linus Walleij <triad@df.lth.se> 0.8-2
- Pick up libtool.

* Sun Oct 8 2006 Linus Walleij <triad@df.lth.se> 0.8-1
- New upstream version including patch.
- The icon is an an even weirder place now!
- Have to run som autotools on this one to get it working.

* Tue Sep 5 2006 Linus Walleij <triad@df.lth.se> 0.7-5
- Patch to compile with new version of E-D-S.

* Thu Aug 10 2006 Linus Walleij <triad@df.lth.se> 0.7-4
- Missing BR

* Thu Aug 3 2006 Linus Walleij <triad@df.lth.se> 0.7-3
- Updated after feedback from Chris Weyl
- Bogus problem with cellphone.png icon image

* Sat Jul 29 2006 Linus Walleij <triad@df.lth.se> 0.7-2
- Updated after feedback from Parag and Paul

* Tue Jun 27 2006 Linus Walleij <triad@df.lth.se> 0.7-1
- 0.7 Release
- Took Matthews nrpm package and Fedora Extrasificated it

* Fri Sep 09 2005 Matthew Hall <matt@nrpms.net> 0.6-1
- 0.6 Release

* Mon Jun 20 2005 Matthew Hall <matt@nrpms.net> 0.4-1
- 0.4 Release
