Blob Blame Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           nfoview
Version:        1.4
Release:        3%{?dist}
Summary:        Viewer for NFO files

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

BuildRequires:  python
BuildRequires:  python-setuptools-devel

BuildRequires:  desktop-file-utils
BuildRequires:  intltool

Requires:       pygtk2

%if "%{?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
%patch0 -p1


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

%postun
update-desktop-database &> /dev/null || :


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


%changelog
* 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