File MediathekView.spec of Package MediathekView

# norootforbuild

Name:           MediathekView
Summary:        Searches the online media library
Summary(de):    Durchsucht verschiedene Mediatheken
Group:			Productivity/Multimedia/Video/Players
Version:        13.4.0
Release:        1.1
Source2:        %{name}.desktop
Source4:        %{name}_maven_buildfiles.tar.bz2 
License:        GPL-3.0-only
BuildRequires:	java-devel >= 11
Requires:		java >= 11
Requires:		vlc
Requires:		ffmpeg
Requires:		rtmpdump
BuildRoot:		%{_tmppath}/%{name}-%{version}-build
BuildArch:		noarch

MediathekView searches the online media library of various German tv stations.
(ARD, ZDF, Arte, 3Sat, MDR, NDR, ORF, SF), invites contributions with a
program of your choice and can create topics as subscriptions and automatically
download new contributions. There is also a way to manage and download podcast.

%description -l de
Das Programm durchsucht die Mediathek verschiedener Sender (ARD, ZDF, Arte,
3Sat, MDR, NDR, ORF, SF), lädt Beiträge mit einem Programm eigener Wahl und
kann Themen als Abos anlegen und neue Beiträge automatisch downloaden.
Es gibt auch eine Möglichkeit, Podcast zu verwalten und zu downloaden.

%setup -q -n %{name}-%{version}
# Install maven files as /home/abuild/.m2
tar -xjf %{SOURCE4} -C $HOME 

# cleanup
find -name '*.class' -type f -exec rm -r {} \;

# W: wrong-file-end-of-line-encoding
sed -i 's/\r$//' res/README.txt

export CLASSPATH=$(build-classpath)
./mvnw package

install -d -m 755 %{buildroot}%{_javadir}/Mediathek
install -m 755 target/MediathekView.jar %{buildroot}%{_javadir}/Mediathek/MediathekView-13.4.0.jar
pushd %{buildroot}%{_javadir}/Mediathek
ln -sf MediathekView-13.4.0.jar MediathekView.jar
install -d -m 755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -m 644 res/%{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
install -d -m 755 %{buildroot}%{_datadir}/applications/   
install -m 644 %{S:2} %{buildroot}%{_datadir}/applications/MediathekView.desktop

# Create Startscript
%__cat > << EOF
# use right java version
# set jar-entry-class
# source the jpackage helpers and set environment
.  %{_javadir}-utils/java-functions
# If the memory run short it can help to use set_options
# Xms set the initial and minimum Java heap size, Xmx set the maximum Java heap size
# default: Xms (25% of the amount of free physical memory in the system, up to 16 MB and at least 8 MB)
# default: Xmx (32bit: 50% of available physical memory up to 1 GB, 64bit: 50% of available physical memory up to 32 GB)
set_options "-Xms256M" "-Xmx1G" "" "-Dawt.useSystemAAFontSettings=on" "-Dswing.aatext=true"
CLASSPATH=\`build-classpath Mediathek\`
run "\$@"

install -D -m755 %{buildroot}%{_bindir}/


%attr(755,root,root) %{_bindir}/
%dir %{_javadir}/Mediathek
%attr(644,root,root) %{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%attr(644,root,root) %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg