#
# spec file for package radiance
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
Name: radiance
Version: 8.0.0
Release: 0
Summary: Building modern, elegant and fast Swing applications
License: BSD-3-Clause
Group: Development/Libraries/Java
URL: https://github.com/kirill-grouchnikov/%{name}
Source0: %{name}-%{version}.tar.xz
Source1: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-common/%{version}/%{name}-common-%{version}.pom
Source2: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-animation/%{version}/%{name}-animation-%{version}.pom
Source3: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-theming/%{version}/%{name}-theming-%{version}.pom
Source4: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-theming-extras/%{version}/%{name}-theming-extras-%{version}.pom
Source5: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-component/%{version}/%{name}-component-%{version}.pom
Source6: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-svg-transcoder/%{version}/%{name}-svg-transcoder-%{version}.pom
Source7: https://repo1.maven.org/maven2/org/pushing-pixels/%{name}-theming-debugger/%{version}/%{name}-theming-debugger-%{version}.pom
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(org.apache.xmlgraphics:batik-bridge)
BuildRequires: mvn(org.apache.xmlgraphics:batik-transcoder)
BuildRequires: mvn(org.pushing-pixels:ephemeral-chroma)
BuildArch: noarch
%description
Radiance is a collection of libraries for writing modern, elegant and fast
Swing applications based on the Ephemeral design system. It is built with Java
11, and runs on Java 9 and later.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
API documentation for %{name}.
%prep
%autosetup
chmod 0644 LICENSE README.md $(find docs -type f)
cp %{SOURCE1} common/pom.xml
cp %{SOURCE2} animation/pom.xml
cp %{SOURCE3} theming/pom.xml
cp %{SOURCE4} theming-extras/pom.xml
cp %{SOURCE5} component/pom.xml
cp %{SOURCE6} tools/svg-transcoder/pom.xml
cp %{SOURCE7} tools/theming-debugger/pom.xml
cat >pom.xml <<__POM__
4.0.0
org.pushing-pixels
%{name}-parent
%{version}
pom
common
animation
theming
theming-extras
component
tools/svg-transcoder
tools/theming-debugger
__POM__
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin common \
'
org.pushingpixels.radiance.common
%{version}
'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin animation \
'
org.pushingpixels.radiance.animation
%{version}
'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin theming \
'
org.pushingpixels.radiance.theming
%{version}
'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin theming-extras \
'
org.pushingpixels.radiance.theming.extras
%{version}
'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin component \
'
org.pushingpixels.radiance.component
%{version}
'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin tools/svg-transcoder \
'
org.pushingpixels.radiance.svg.transcoder
%{version}
'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin tools/theming-debugger \
'
org.pushingpixels.radiance.theming.debugger
%{version}
'
%pom_change_dep -r org.pushing-pixels: :::compile
%pom_remove_dep org.apache.xmlgraphics:batik-all tools/svg-transcoder
%pom_add_dep org.apache.xmlgraphics:batik-bridge tools/svg-transcoder
%pom_add_dep org.apache.xmlgraphics:batik-transcoder tools/svg-transcoder
%build
%{mvn_build} -f -- \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
-Dmaven.compiler.release=9 -DlegacyMode=true -Dverbose=true
%install
%{mvn_package} :%{name}-parent __noinstall
%mvn_install
%fdupes %{buildroot}%{_javadocdir}/%{name}
install -dm0755 %{buildroot}%{_defaultdocdir}/%{name}
cp -pr docs %{buildroot}%{_defaultdocdir}/%{name}
%fdupes %{buildroot}%{_defaultdocdir}/%{name}
%files -f .mfiles
%license LICENSE
%doc README.md docs
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog