LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File tvbrowser.spec of Package tvbrowser (Project home:dnh)

# 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 http://bugs.opensuse.org/

Name:           tvbrowser
Summary:        Digital TV guide
License:        GPL-3.0+
Group:          Productivity/Multimedia/Other
#Version:        3.4.3
Version:        4.0.0
%define _pkg_ver    4
Release:        0
Requires:       java >= 1.8
Url:            http://www.tvbrowser.org
Source:         http://downloads.sourceforge.net/project/tvbrowser/TV-Browser%20Releases%20%28Java%206%20and%20higher%29/%{version}/%{name}_%{version}_src.zip
Source1:        linux.properties
# TODO build from source, too
Source2:        http://www.tvbrowser.org/data/uploads/1372016422809_543/NewsPlugin.jar
Source3:        CHANGES-3.4.1-4.0.0.log
Patch0:         %{name}-3.1-ratings.patch
# upstream patch:
Patch10:	    %{name}-r8795_fix_possible_NPE.patch
BuildRequires:  ant
BuildRequires:  ant-junit
BuildRequires:  dejavu
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  fontconfig
BuildRequires:  hicolor-icon-theme
BuildRequires:  java-devel >= 1.8
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.

%package doc
Summary:        Digital TV guide documentation
Group:          Productivity/Multimedia/Other
Requires:       %{name} == %{version}

%description doc
Documentation package for tvbrowser.

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

%patch10 -p1

%patch0 -p1

#-XX:MaxPermSize=512m -XX:PermSize=128m 
export ANT_OPTS="-Xms32m -Xmx1024m"
export CLASSPATH=%{_datadir}/ant/lib/ant-launcher.jar
%ant -v runtime-linux -Dnewsplugin.url=file:///%{_sourcedir}/NewsPlugin.jar
%ant -v public-doc
%ant -v public-tvdatakit

cat >tvbrowser <<'EOF'

cd %{_javadir}/%{name}/ && \
    exec %{_bindir}/java \
        -Xms32m \
        -Xmx256m \
        -Djava.library.path=%{_javadir}/%{name} \
        -Dpropertiesfile=linux.properties \
        -jar tvbrowser.jar \


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

mkdir -p %{buildroot}%{_javadir}/%{name}/
install -p -m 644 %{SOURCE1} %{buildroot}%{_javadir}/%{name}/

cp -r runtime/tvbrowser_linux/* %{buildroot}%{_javadir}/%{name}/
rm "%{buildroot}%{_javadir}/%{name}/LICENSE.txt"
rm "%{buildroot}%{_javadir}/%{name}/COPYRIGHT.txt"

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



%doc ChangeLog.txt txt/COPYRIGHT.txt txt/LICENSE.txt

%files doc
%doc doc/*