Blob Blame History Raw
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif

%global majorversion 1.9

Name:           nfoview
Version:        1.9.1
Release:        1%{?dist}
Summary:        Viewer for NFO files

Group:          Applications/File
License:        GPLv3+
URL:            http://home.gna.org/nfoview/
Source0:        http://download.gna.org/nfoview/%{majorversion}/%{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

BuildRequires:  python-devel
BuildRequires:  python-setuptools

BuildRequires:  desktop-file-utils
BuildRequires:  intltool

Requires:       pygtk2
Requires:       shared-mime-info
Requires:       hicolor-icon-theme

%if 0%{?fedora} >= 11
Requires:       terminus-fonts
%else
Requires:       terminus-font-x11
%endif


%description
NFO Viewer is a simple viewer for NFO files, which are "ASCII" art in
the CP437 codepage. The advantages of using NFO Viewer instead of a
text editor are preset font and encoding settings, automatic window
size and clickable hyperlinks.


%prep
%setup -q


%build
%{__python} setup.py build


%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
%find_lang %{name}
desktop-file-install                                        \
    --add-category="TextTools;"                             \
    --remove-category="Viewer;"                             \
    --delete-original                                       \
    --dir=%{buildroot}%{_datadir}/applications              \
    %{buildroot}%{_datadir}/applications/%{name}.desktop


%clean
rm -rf %{buildroot}

%post
update-desktop-database &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :


%postun
update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi


%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README TODO 
%{_mandir}/man*/%{name}.*
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{python_sitelib}/%{name}/
%{python_sitelib}/%{name}*.egg-info
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg


%changelog
* Sat Jun 26 2010 Fabian Affolter <fabian@bernewireless.net> - 1.9.1-1
- Update to 1.9.1
- Require shared-mime-info

* Sun Oct 18 2009 Fabian Affolter <fabian@bernewireless.net> - 1.8-1
- Updated to new upstream version 1.8
- The icons need now hicolor-icon-theme

* Tue Sep 29 2009 Fabian Affolter <fabian@bernewireless.net> - 1.7-1
- Updated to new upstream version 1.7

* Thu Sep 17 2009 Fabian Affolter <fabian@bernewireless.net> - 1.6-1
- Updated to new upstream version 1.6

* Tue Aug 11 2009 Ville Skyttä <ville.skytta@iki.fi> - 1.5-3
- Use bzipped upstream tarball.

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon May 11 2009 Christoph Wickert <cwickert@fedoraproject.org> - 1.5-1
- Update to 1.5
- Fix conditional comparison that caused broken deps in Fedora 9

* Sat May 02 2009 Fabian Affolter <fabian@bernewireless.net> - 1.4-3
- Small changes around the desktop file

* Sat Apr 25 2009 Fabian Affolter <fabian@bernewireless.net> - 1.4-2
- Removed PKG-INFO from doc
- Fixed requiements
- Added update-desktop-database
- Fixed category for the .desktop file
- Added patch for German translation

* Sun Apr 19 2009 Fabian Affolter <fabian@bernewireless.net> - 1.4-1
- Initial package for Fedora