File tvbrowser.spec of Package tvbrowser

#
# spec file for package tvbrowser
#
# Copyright (c) 2013 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
Summary:        Digital TV guide
License:        GPL-3.0+
Group:          Productivity/Multimedia/Other
Version:        3.3.2
Release:        0
Requires:       java >= 1.6
Url:            http://tv-browser.org
Source0:        http://downloads.sourceforge.net/project/tvbrowser/TV-Browser%20Releases%20%28Java%206%20and%20higher%29/%{version}/%{name}_%{version}_bin.tar.gz
BuildRequires:  dos2unix
BuildRequires:  optipng
BuildRequires:  update-desktop-files
# needed for expanding %%icon_theme_cache_post in %%post/un
BuildRequires:  gtk3-tools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
TV-Browser is Plugin based digital TV guide. Plugins can be installed with
the download function of TV-Browser.


%prep
%setup -q
dos2unix LICENSE.txt
find -name "*.png" | while read a; do
    optipng -o 5 "$a" || optipng -o 5 -fix "$a"
done

%build
cat >tvbrowser <<'EOF'
#!/bin/sh

cd %{_datadir}/%{name} && \
    exec %{_bindir}/java \
        -Xms16m \
        -Xmx128m \
        -Djava.library.path=%{_datadir}/%{name} \
        -Dpropertiesfile=linux.properties \
        -jar tvbrowser.jar \
        "$@"
EOF

%install
export NO_BRP_CHECK_BYTECODE_VERSION="true"
install -D -p -m 755 tvbrowser %{buildroot}%{_bindir}/tvbrowser
for file in tvbrowser.jar; do
    install -D -p -m 644 ${file} %{buildroot}%{_datadir}/%{name}/${file}
done
find hyphen icons imgs personas plugins themepacks -depth -print | \
    cpio -p -d -m %{buildroot}%{_datadir}/%{name}
for size in 16 32 48 128; do
    (
        install -d %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/
        cd %{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/
        ln -s ../../../../tvbrowser/imgs/tvbrowser${size}.png tvbrowser.png
    )
done
%suse_update_desktop_file -c tvbrowser TV-Browser 'Digital TV Guide' tvbrowser tvbrowser AudioVideo TV Java

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc COPYRIGHT.txt LICENSE.txt
%{_bindir}/tvbrowser
%{_datadir}/%{name}
%{_datadir}/applications/tvbrowser.desktop
%{_datadir}/icons/hicolor/*/apps/tvbrowser.png

%changelog
openSUSE Build Service is sponsored by