File mail-notification.spec of Package mail-notification

%global git_revision 9ae8768

Name:           mail-notification
Version:        5.4
Release:        66.git.%{git_revision}
Summary:        Status icon that informs you if you have new mail

Group:          Applications/Internet
License:        GPLv3+
URL:            http://www.nongnu.org/mailnotify/
#Source0:        http://savannah.nongnu.org/download/mailnotify/mail-notification-%{version}.tar.bz2
# Upstream isn't alive any more, use a github forked copy which contains all patches which
# have been collected over the past years: https://github.com/epienbroek/mail-notification
#
# To regenerate source tarball:
# wget https://github.com/epienbroek/mail-notification/tarball/$git_revision -O mail-notification-$git_revision.tar.gz
Source0:        mail-notification-%{git_revision}.tar.gz
Patch0:		osc-fixes.diff
Patch1:		update-for-evolution-3.12.patch
Patch3:		mail-notification-dont-link-against-bsd-compat.patch
Patch4:		more-fixes-for-3.12.patch
Patch5:		fix-64bit-portability.patch

BuildRequires:  gettext
BuildRequires:  desktop-file-utils, scrollkeeper
BuildRequires:  openssl-devel >= 0.9.6
BuildRequires:  cyrus-sasl-devel >= 2.0
BuildRequires:  glib2-devel >= 2.14
BuildRequires:  gtk3-devel
BuildRequires:  gconf2-devel, libgnome-devel
BuildRequires:  dbus-1-glib-devel
BuildRequires:  libnotify-devel >= 0.4.1
BuildRequires:  gmime-devel >= 2.4
BuildRequires:  gnome-keyring-devel
BuildRequires:  perl-XML-Parser
BuildRequires:  gob2 >= 2.0.17
BuildRequires:  evolution-devel 
BuildRequires:  evolution-data-server-devel >= 1.5
BuildRequires:	update-desktop-files
BuildRequires:	libgnomeui-devel
BuildRequires:	enchant-devel
# needed for the gtk-builder-convert tool
BuildRequires:  gtk2-devel

# needed for the GConf RPM macros
BuildRequires:  gconf2

Requires:         hicolor-icon-theme

Autoreqprov:  on
Requires: %{name}-lang = %{version}
%gconf_schemas_prereq

%description
Mail Notification is a status icon (aka tray icon) that informs you if you
have new mail. It works with system trays implementing the freedesktop.org
System Tray Specification, such as the GNOME Panel Notification Area, the
Xfce Notification Area and the KDE System Tray.

%lang_package

%prep
%setup -q -n epienbroek-%{name}-%{git_revision}
%patch0 -p1
%patch1 -p1
%patch3 -p0
%patch4 -p1
%patch5 -p1

%build
# Temporary build without any optimalisations so we
# can get better stacktraces for RHBZ #531088
CFLAGS=$(echo $RPM_OPT_FLAGS | sed s/O2/O0/)

./jb configure \
  destdir=$RPM_BUILD_ROOT \
  prefix=%{_prefix} \
  bindir=%{_bindir} \
  libdir=%{_libdir} \
  libexecdir=%{_libexecdir} \
  datadir=%{_datadir} \
  sysconfdir=%{_sysconfdir} \
  localstatedir=%{_localstatedir}

./jb build

# The build command above hides away all gcc commands and their warnings
# As they can be interesting show the build log manually
cat build/build.log


%install
# For GConf apps: prevent schemas from being installed at this stage
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1

./jb install

#  clear /var/lib/scrollkeeper stuff here
rm -rf $RPM_BUILD_ROOT%{_localstatedir}

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

chmod +x $RPM_BUILD_ROOT%{_libdir}/evolution/plugins/*.so

mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/gnome/autostart
mv $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/mail-notification.desktop $RPM_BUILD_ROOT%{_prefix}/share/gnome/autostart
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart
%find_gconf_schemas
%find_lang %{name}
%suse_update_desktop_file mail-notification-properties Network Email
# jb doesn't allow for disabling scrollkeeper
rm -fr $RPM_BUILD_ROOT/var/lib/scrollkeeper

%pre -f %{name}.schemas_pre

%preun -f %{name}.schemas_preun

%post
%posttrans -f %{name}.schemas_posttrans


%files -f %{name}.schemas_list
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING-DOCS NEWS README TODO TRANSLATING
#%{_sysconfdir}/gconf/schemas/mail-notification.schemas
%{_bindir}/*
%{_datadir}/%{name}
%{_datadir}/gnome/autostart/*
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*/apps/mail-notification.*
#%{_libdir}/evolution/*/plugins/*
%{_libdir}/evolution/plugins/*

%files lang -f %{name}.lang
%{_datadir}/omf

%changelog
* Wed Nov 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4.64.git.eab5c13
- Update to eab5c13 snapshot
- Fixes new e-mail detection in evolution 3.6
- Use a more efficient method to retrieve unread mails from
  evolution as suggested by Milan Crha (GNOME BZ #688429)
- Replaced the patch with a sed call to avoid multiple gcc -O optimalisation flags being used

* Tue Nov 20 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-63.git72ad191
- Update to 72ad191 snapshot
- Fixes compatibility with GLib 2.35 (deprecated g_type_init)
- Fixes location of tooltip
- Trimmed old changelog entries from the .spec file

* Tue Nov 20 2012 Milan Crha <mcrha@redhat.com> - 5.4-62.gitb4ca832
- Rebuild against newer evolution-data-server

* Thu Oct 25 2012 Milan Crha <mcrha@redhat.com> - 5.4-61.gitb4ca832
- Rebuild against newer evolution-data-server

* Wed Aug 22 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-60.gitb4ca832
- Switch to using a GitHub fork of mail-notification as upstream is dead:
  https://github.com/epienbroek/mail-notification
- Removed (almost) all patches as they're now part of the GitHub fork
- Removed hack to link against libX11 as a proper fix was applied in the GitHub fork
- Fixes compatibility with evolution 3.5.3 and higher
- Re-added the BR: gob2
- Removed ancient obsoletes tag
- Fixed mixed-use-of-spaces-and-tabs rpmlint warning

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.4-59
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jun 15 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-58
- Drop Fedora >= 15 conditionals as older Fedora versions aren't supported any more
- Don't crash when the system tray manager (like gnome-shell) is restarted
  Patch created by Julien Danjou, http://bugs.debian.org/500880
- Fix segfault when the Polish translation is used
  Patch created by Przemysław, http://bugs.debian.org/523873

* Sun Jun 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-57
- Another rebuild against the latest evolution

* Wed May  9 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-56
- Fix compatibility with latest evolution (again..)

* Mon Apr  9 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-55
- Adding mailboxes was broken with evolution 3.4. Fixed
- Various minor improvements in the gtk3 user interface

* Thu Apr  5 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-54
- Fixed a stack overflow which occured while verifying SSL certificates
  for POP3 and IMAP mailboxes. RHBZ #810054

* Wed Mar 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 5.4-53
- Fixed a posible segfault in the evolution plugin

* Wed Feb 22 2012 Milan Crha <mcrha@redhat.com> - 5.4-52
- Rebuild against newer evolution-data-server

* Wed Feb 08 2012 Milan Crha <mcrha@redhat.com> - 5.4-51
- Rebuild against newer evolution-data-server
- Add patch to build with evolution-3.3.5's libemail

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.4-50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Dec 20 2011 Milan Crha <mcrha@redhat.com> - 5.4-49
- Rebuild against newer evolution-data-server

openSUSE Build Service is sponsored by