Blob Blame History Raw
Name:           mailnag
Version:        0.4.4
Release:        1%{?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

# python3 won't work (as of 0.4.2)
Requires:       python2  
Requires:       pygobject2
Requires:       python-httplib2
Requires:       gnome-python2-gnomekeyring
Requires:       gstreamer-python
Requires:       notify-python
Requires:       pyxdg

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 -c %{name}-%{version}
%patch0 -b .patch0

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