File tvbrowser.spec of Package tvbrowser

#
# spec file for package tvbrowser
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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:           tvbrowser
BuildRequires:  dos2unix fdupes optipng update-desktop-files
Summary:        Digital TV guide
Version:        3.0.1
Release:        1
License:        LGPLv2.1+
Group:          Productivity/Networking/News/Utilities
Requires:       java >= 1.6
Url:            http://tv-browser.org
Source0:        %{name}-%{version}.tar.bz2
Source1:        LICENSE.txt
Patch0:         tvbrowser-desktop.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
TV-Browser is a Java 1.5 based digital TV guide for more than 140
TV/Radio channels and some cinemas.



Authors:
--------
    Bodo Tasche
    Martin Oberhauser
    Ren� Mach
    Bj�rn Balazs
    Nelson Darkwah Oppong
    Joakim Arborelius
    Til Schneider

%prep
%setup -q
%patch0 -p 1
rm LICENSE.txt
cp -f %{S:1} ./

%build

%install
export NO_BRP_CHECK_BYTECODE_VERSION="true"
rm -f *.url
find -name "*.png" | while read a
do
	optipng -o 5 "$a" || optipng -o 5 -fix "$a"
done
install -d %buildroot%_datadir/%name
install -d %buildroot/usr/bin
cp -a *  %buildroot%_datadir/%name/
mkdir -p %{buildroot}%{_docdir}/%{name}
mv %{buildroot}%{_datadir}/%{name}/*.txt %{buildroot}%{_docdir}/%{name}/
install -d %buildroot/usr/share/icons/hicolor/128x128/apps
install -d %buildroot/usr/share/icons/hicolor/48x48/apps
install -d %buildroot/usr/share/icons/hicolor/32x32/apps
install -d %buildroot/usr/share/icons/hicolor/16x16/apps
cp -p imgs/tvbrowser128.png %buildroot/usr/share/icons/hicolor/128x128/apps/tvbrowser.png
cp -p imgs/tvbrowser48.png %buildroot/usr/share/icons/hicolor/48x48/apps/tvbrowser.png
cp -p imgs/tvbrowser32.png %buildroot/usr/share/icons/hicolor/32x32/apps/tvbrowser.png
cp -p imgs/tvbrowser16.png %buildroot/usr/share/icons/hicolor/16x16/apps/tvbrowser.png
install -d %buildroot/usr/share/applications
install -p tvbrowser.desktop %buildroot/usr/share/applications/tvbrowser.desktop
rm %{buildroot}%{_datadir}/%{name}/tvbrowser.desktop *.txt
%fdupes -s %{buildroot}%{_datadir}
%suse_update_desktop_file %{buildroot}/%{_datadir}/applications/tvbrowser.desktop

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/*
%_datadir/%name
%{_datadir}/applications/tvbrowser.desktop
%{_datadir}/icons/hicolor

%post
ln -s -f %_datadir/%name/tvbrowser.sh /usr/bin/tvbrowser

%changelog