File MediathekView.spec of Package MediathekView
# norootforbuild
%define java_version 20
%define jar_version 14.0.0
Name: MediathekView
Summary: Searches the online media library
Summary(de): Durchsucht verschiedene Mediatheken
Group: Productivity/Multimedia/Video/Players
Version: 14.0.0
Release: 1.1
URL: https://mediathekview.de/
Source0: %{name}-%{version}.tar.xz
Source2: %{name}.desktop
Source4: %{name}_maven_build_files.tar.bz2
Source10: %{name}.vmoptions
License: GPL-3.0-only
BuildRequires: java-devel >= %{java_version}
BuildRequires: xz
Requires: java >= %{java_version}
Requires: vlc
Requires: rtmpdump
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Obsoletes: MediathekView-next
%description
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.
%prep
%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
%build
export CLASSPATH=$(build-classpath)
./mvnw -DskipTests=true package
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
# app
install -d -m 755 %{buildroot}%{_javadir}/%{name}
install -m 755 target/MediathekView.jar %{buildroot}%{_javadir}/%{name}/MediathekView-%{jar_version}.jar
pushd %{buildroot}%{_javadir}/%{name}
ln -sf MediathekView-%{jar_version}.jar MediathekView.jar
popd
# vmoptions
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/
install -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/%{name}/%{name}.vmoptions
# other
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 %{SOURCE2} %{buildroot}%{_datadir}/applications/MediathekView.desktop
# Create Startscript
cat > MediathekView.sh << EOF
#!/bin/bash
# use right java version
JAVA_HOME=%{_sysconfdir}/alternatives/jre_%{java_version}
# set jar-entry-class
MAIN_CLASS="mediathek.Main"
# source the jpackage helpers and set environment
VERBOSE=1
. %{_javadir}-utils/java-functions
set_javacmd
check_java_env
set_jvm_dirs
# 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)
# Attention: set_options parameter now in MediathekView.vmoptions file.
set_options \$(sed '/#/d' /etc/MediathekView/MediathekView.vmoptions | tr '\n' ' ')
CLASSPATH=\`build-classpath MediathekView\`
run "\$@"
EOF
install -D -m755 MediathekView.sh %{buildroot}%{_bindir}/MediathekView.sh
%clean
rm -rf $RPM_BUILD_ROOT
%files
%attr(755,root,root) %{_bindir}/MediathekView.sh
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/%{name}-%{jar_version}.jar
%{_javadir}/%{name}/%{name}.jar
%attr(644,root,root) %{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%attr(644,root,root) %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.vmoptions
%changelog