Blob Blame History Raw
%global git_revision eab5c13

Name:           mail-notification
Version:        5.4
Release:        64.git.%{git_revision}%{?dist}
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

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-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

# needed for the gtk-builder-convert tool
BuildRequires:  gtk2-devel

# needed for the GConf RPM macros
BuildRequires:  GConf2

Requires:         hicolor-icon-theme

Requires(pre):    GConf2
Requires(post):   GConf2, scrollkeeper
Requires(preun):  GConf2
Requires(postun): scrollkeeper


%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.


%package        evolution-plugin
Summary:        Evolution plugin for Mail Notification
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}

%description	evolution-plugin
Evolution support for Mail Notification.


%prep
%setup -q -n epienbroek-%{name}-%{git_revision}


%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 \
  cc="%{__cc}" \
  cflags="$CFLAGS" \
  cppflags="-D_GNU_SOURCE" \
  destdir=$RPM_BUILD_ROOT \
  prefix=%{_prefix} \
  bindir=%{_bindir} \
  libdir=%{_libdir} \
  libexecdir=%{_libexecdir} \
  datadir=%{_datadir} \
  sysconfdir=%{_sysconfdir} \
  localstatedir=%{_localstatedir} \
  install-gconf-schemas=no

./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

desktop-file-install --vendor fedora                   \
  --dir ${RPM_BUILD_ROOT}%{_datadir}/gnome/autostart/  \
  --delete-original                                    \
  ${RPM_BUILD_ROOT}%{_sysconfdir}/xdg/autostart/mail-notification.desktop

desktop-file-install --vendor fedora                   \
  --dir ${RPM_BUILD_ROOT}%{_datadir}/applications      \
  --delete-original                                    \
  --add-category X-GNOME-NetworkSettings               \
  ${RPM_BUILD_ROOT}%{_datadir}/applications/mail-notification-properties.desktop

%find_lang %{name}


%pre
%gconf_schema_prepare %{name}


%post
%gconf_schema_upgrade %{name}

/usr/bin/scrollkeeper-update -q -o %{_datadir}/omf/%{name} || :

touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%preun
%gconf_schema_remove %{name}


%postun
/usr/bin/scrollkeeper-update -q ||:

touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%files -f %{name}.lang
%doc AUTHORS COPYING NEWS README TODO
%{_sysconfdir}/gconf/schemas/mail-notification.schemas
%{_bindir}/*
%{_datadir}/%{name}
%{_datadir}/gnome/autostart/fedora-mail-notification.desktop
%{_datadir}/applications/fedora-mail-notification-properties.desktop
%{_datadir}/gnome/help/mail-notification/
%dir %{_datadir}/omf/mail-notification/
%{_datadir}/omf/mail-notification/mail-notification-C.omf
%{_datadir}/icons/hicolor/*/apps/mail-notification.*


%files evolution-plugin
%{_libdir}/evolution/*/plugins/*


%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