File tvbrowser.spec of Package tvbrowser

# spec file for package tvbrowser
# Copyright (c) 2014 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

Name:           tvbrowser
Summary:        Digital TV guide
License:        GPL-3.0+
Group:          Productivity/Multimedia/Other
Release:        0
Requires:       java >= 1.6
# TODO build from source, too
BuildRequires:  ant
BuildRequires:  ant-junit
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  java-devel
BuildRequires:  jpackage-utils
BuildRequires:  optipng
BuildRequires:  unzip
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

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

cp %{S:2} .
%setup -q
dos2unix src/LICENSE.txt
find -name "*.png" | while read a; do
    optipng -o 5 "$a" || optipng -o 5 -fix "$a"

%ant runtime-linux -Dnewsplugin.url=file:///%{_sourcedir}/NewsPlugin.jar

cat >tvbrowser <<'EOF'

cd %{_javadir}/%{name}/ && \
    exec %{_bindir}/java \
        -Xms16m \
        -Xmx128m \
        -Djava.library.path=%{_javadir}/%{name} \ \
        -jar tvbrowser.jar \


install -D -p -m 755 tvbrowser %{buildroot}%{_bindir}/tvbrowser

mkdir -p %{buildroot}%{_javadir}/%{name}/
cp -r runtime/tvbrowser_linux/* %{buildroot}%{_javadir}/%{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 %{_javadir}/%{name}/imgs/tvbrowser${size}.png tvbrowser.png

%suse_update_desktop_file -c tvbrowser TV-Browser 'Digital TV Guide' tvbrowser tvbrowser AudioVideo TV Java

%fdupes %{buildroot}%{_javadir}

# TODO: JUnit is causing trouble
#%%ant test

%ant clean



%doc ChangeLog.txt