File MediathekView.spec of Package MediathekView
# norootforbuild
%define java_version 24
%define jar_version 14.3.1
Name: MediathekView
Summary: Searches the online media library
Summary(de): Durchsucht verschiedene Mediatheken
Group: Productivity/Multimedia/Video/Players
Version: 14.3.1
Release: 1.1
URL: https://mediathekview.de/
Source0: %{name}-%{version}.tar.xz
Source2: %{name}.desktop
Source4: %{name}_maven_build_files.tar.bz2
Patch0: %{name}-fix-class-path-for-dependencies.patch
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
%autosetup -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 clean package
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
# app
install -d -m 755 %{buildroot}%{_javadir}/%{name}
install -d -m 755 %{buildroot}%{_javadir}/%{name}/dependency/
install -m 755 target/MediathekView.jar %{buildroot}%{_javadir}/%{name}/MediathekView-%{jar_version}.jar
install -m 755 target/dependency/*.jar %{buildroot}%{_javadir}/%{name}/dependency/
pushd %{buildroot}%{_javadir}/%{name}
ln -sf MediathekView-%{jar_version}.jar MediathekView.jar
popd
# 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
# Thx to Arch community!
# https://aur.archlinux.org/cgit/aur.git/tree/mediathekview.sh?h=mediathekview-xdg
data_directory="$HOME/.mediathek3"
java_options=(
# the application enforces the use of certain JVM parameters:
# https://github.com/mediathekview/MediathekView/blob/14.3.0/src/main/java/mediathek/Main.java#L282
-XX:+UseShenandoahGC
-XX:ShenandoahGCHeuristics=compact
-XX:+UseStringDeduplication
-XX:MaxRAMPercentage=25 # use the default 25%
--add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED
--add-exports=java.desktop/sun.swing=ALL-UNNAMED
--enable-native-access=ALL-UNNAMED
--add-modules jdk.incubator.vector
-DexternalUpdateCheck # disable automatic update check
-jar /usr/share/java/MediathekView/MediathekView.jar
)
exec java "${java_options[@]}" "$@" "$data_directory"
EOF
install -D -m755 MediathekView.sh %{buildroot}%{_bindir}/MediathekView.sh
%files
%attr(755,root,root) %{_bindir}/MediathekView.sh
%dir %{_javadir}/%{name}
%dir %{_javadir}/%{name}/dependency
%{_javadir}/%{name}/%{name}-%{jar_version}.jar
%{_javadir}/%{name}/%{name}.jar
%{_javadir}/%{name}/dependency/*.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
%changelog