File mail-notification.spec of Package mail-notification

#
# spec file for package mail-notification
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2008 James Ogley
#
# 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/
#



Name:           mail-notification
Version:        5.4
Release:        4
License:        GPL
Summary:        Status icon checking for new mail
Url:            http://www.nongnu.org/mailnotify/
Group:          Productivity/Networking/Email/Utilities
Source:         %{name}-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM mail-notification-5.4-evo2.29.patch lp501624 fcrozat@novell.com -- Fix build with recent Evolution (from Fedora)
Patch1:         mail-notification-5.4-evo2.29.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-evo2.29.patch lp501624 fcrozat@novell.com -- Fix build with recent Evolution (from Fedora) gob2 part, only for 11.3 and later
Patch8:         mail-notification-5.4-evo2.29-gob2.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-missing-icons.patch lp557137 fcrozat@novell.com -- fix incorrect stock icons being used
Patch2:         mail-notification-5.4-missing-icons.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-gmime.patch lp297094 fcrozat@novell.com -- Fix build with gmime 2.4
Patch3:         mail-notification-5.4-gmime.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-eds-2.32.patch fcrozat@novell.com -- Fix build with evolution 2.32
Patch4:         mail-notification-5.4-eds-2.32.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-gob2-2.0.16.patch deb#580886 fcrozat@novell.com -- Fix build with gob2 2.0.16 
Patch5:         mail-notification-5.4-gob2-2.0.16.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-evolution-gtkhtml.patch lp#458882 fcrozat@novell.com -- Fix build with recent gtkhtml (Fedora)
Patch6:         mail-notification-5.4-evolution-gtkhtml.patch
# PATCH-FIX-UPSTREAM mail-notification-5.4-sasl_encode64.patch lp#602623 fcrozat@novell.com -- Fix buffer overflow (Fedora)
Patch7:         mail-notification-5.4-sasl_encode64.patch 
BuildRequires:  evolution-data-server-devel
BuildRequires:  evolution-devel
BuildRequires:  gconf2-devel
%if 0%{?suse_version} <= 1110 && ! 0%{?sles_version}
BuildRequires:  gmime-devel
%else
BuildRequires:  gmime-2_4-devel
%endif
BuildRequires:  gnome-vfs2-devel
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  libglade2-devel
%if 0%{?suse_version} >= 1130
BuildRequires:  libgnome-keyring-devel
%else
BuildRequires:  gnome-keyring-devel
%endif
BuildRequires:  libgnomeui-devel
BuildRequires:  libnotify-devel
BuildRequires:  libxml2-devel
BuildRequires:  openssl-devel
BuildRequires:  scrollkeeper
BuildRequires:  startup-notification-devel
BuildRequires:  update-desktop-files
%if %suse_version >= 1130
BuildRequires:  gob2 >= 2.0.16
%endif
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%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
%if %suse_version >= 1120
%patch1 -p1 -b .evolution-2.29
%endif
%if %suse_version >= 1130
%patch8 -p1 -b .evolution-2.29-gob2
%patch4 -p1 -b .eds-2.32
%patch5 -p1 -b .gob2.0.16
%patch2 -p1 -b .incorrect-icons
%endif
%if 0%{?suse_version} > 1110 || 0%{?sles_version}
%patch3 -p1 -b .gmime24
%endif
%if %suse_version < 1140
%patch6 -p1 -b .gtkhtml
%endif
%patch7 -p1 -b .sasl_encode64

#  Drop #line statements in C sources generated bu .gob,
#  for the proper debuginfo package
pushd build/src
for f in *.c *.h
do
	sed -i '/^#line / d' $f
done
popd

%build
# See http://en.opensuse.org/Packaging/Fixing.
%if %suse_version >= 1120
export SUSE_ASNEEDED=0
%endif

./jb configure prefix=%{_prefix} \
     sysconfdir=%{_sysconfdir} \
     cc="%{__cc}" \
     cflags="%{optflags}" \
     cppflags="-D_GNU_SOURCE" \
     destdir=%{buildroot} \
     gconf-schemas-dir=%{_sysconfdir}/gconf/schemas \
     install-gconf-schemas=no

./jb build

%install
./jb install
# jb doesn't allow disabling scrollkeeper
rm -fr %{buildroot}%{_localstatedir}/lib/scrollkeeper
# sr@latin is the right locale name
mv %{buildroot}%{_datadir}/locale/sr@Latn %{buildroot}%{_datadir}/locale/sr@latin
%find_gconf_schemas
%find_lang %{name} %{?no_lang_C}
%suse_update_desktop_file mail-notification
%suse_update_desktop_file mail-notification-properties

%pre -f %{name}.schemas_pre

%preun -f %{name}.schemas_preun

%posttrans -f %{name}.schemas_posttrans

%if 0%{?suse_version} > 1130

%post
%desktop_database_post
%icon_theme_cache_post
%endif

%if 0%{?suse_version} > 1130

%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif

%clean
rm -rf %{buildroot}

%files -f %{name}.schemas_list
%defattr(-, root, root)
%doc AUTHORS COPYING COPYING-DOCS NEWS README TODO TRANSLATING
%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}/*
%{_libdir}/evolution/*/plugins/*.eplug
%{_libdir}/evolution/*/plugins/*.so
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/mail-notification.*
%{_datadir}/mail-notification/
%{_sysconfdir}/xdg/autostart/*.desktop

%files lang -f %{name}.lang

%changelog