Name: mailnag
Version: 0.5.2
Release: 4%{?dist}
Summary: Mail notification daemon for GNOME 3
License: GPLv2
URL: https://github.com/pulb/mailnag
Source0: https://github.com/downloads/pulb/%{name}/%{name}-%{version}.tar.gz
# submitted during review; will send it upstream soon
Patch0: mailnag-imaplib2.patch
# backgroud: https://bugzilla.redhat.com/show_bug.cgi?id=1015900
# based on upstream patch https://github.com/pulb/mailnag/commit/8661a7236a791255bc379a106eed52cf55471845
Patch1: mailnag-addaction_apichange.patch
# backgroud: https://bugzilla.redhat.com/show_bug.cgi?id=1015900#4
# upstream is working on a rewrite, no need to sent it there
Patch2: mailnag-sound.patch
# python3 won't work (as of 0.4.2)
Requires: python2
Requires: pygobject2
Requires: python-httplib2
Requires: gstreamer-python
Requires: notify-python
Requires: pyxdg
Requires: gnome-keyring
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: gettext
BuildRequires: desktop-file-utils
%description
Mailnag checks POP3 and IMAP servers for new mail and when it finds one
creates a proper GNOME 3 notification that mentions sender and subject.
%prep
%setup -q
%patch0 -b .patch0
%patch1 -b .patch1 -p1
%patch2 -b .patch2 -p1
# avoid rpmlint error wrong-script-end-of-line-encoding for these files
sed -i -e 's/\r//' Mailnag/{config,mailnag,configuration/accountdialog}.py
# sooner or later python3 might be the default in Fedora; be prepared
sed -i 's_#!.*/usr/bin/env.*python_#!%{_bindir}/env python2_' $(find . -name '*.py')
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/mailnag_config.desktop
%find_lang %{name}
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
%files -f %{name}.lang
%doc AUTHORS LICENSE NEWS README.md
%{_bindir}/%{name}*
%{_datadir}/%{name}
%{python_sitelib}/Mailnag
%{python_sitelib}/%{name}-%{version}-*.egg-info
%{_datadir}/applications/*
%changelog
* Wed Nov 06 2013 Thorsten Leemhuis <fedora@leemhuis.info> - 0.5.2-4
- add patch to fix sound problem (rhbz #1015900 comment 4)
* Sun Nov 03 2013 Thorsten Leemhuis <fedora@leemhuis.info> - 0.5.2-3
- add patch to work around a API change in NotifyNotification (rhbz #1015900)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sun Nov 25 2012 Thorsten Leemhuis <fedora@leemhuis.info> - 0.5.2-1
- update to 0.5.2
* Sun Nov 25 2012 Thorsten Leemhuis <fedora@leemhuis.info> - 0.4.4-1
- update to 0.4.4
* Sun Oct 07 2012 Thorsten Leemhuis <fedora@leemhuis.info> - 0.4.3-1
- update to 0.4.3
- use the newly added setup.py for install, which simplifies the spec file
a lot
* Mon Aug 13 2012 Thorsten Leemhuis <fedora@leemhuis.info> - 0.4.2-2
- apply patch that fixes a issue found during review #847512
* Sat Aug 11 2012 Thorsten Leemhuis <fedora@leemhuis.info> - 0.4.2-1
- initial build