8
0

2 Commits

2 changed files with 16 additions and 6 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Sep 24 11:31:38 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Use SOURCE_DATE_EPOCH for reproducible jar mtime
-------------------------------------------------------------------
Sun Mar 20 07:20:01 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package template-resolver
#
# Copyright (c) 2022 SUSE LLC
# 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
@@ -24,10 +24,10 @@ License: Apache-2.0
Group: Development/Libraries/Java
URL: https://github.com/sbt/template-resolver
Source0: %{name}-%{version}.tar.xz
Source1: http://central.maven.org/maven2/org/scala-sbt/%{name}/%{version}/%{name}-%{version}.pom
Source1: https://repo1.maven.org/maven2/org/scala-sbt/%{name}/%{version}/%{name}-%{version}.pom
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: javapackages-local >= 6
BuildArch: noarch
%description
@@ -47,11 +47,16 @@ JavaDoc documentation for %{name}
# jar
mkdir -p target/classes
javac -d target/classes -source 8 -target 8 $(find src/main -name \*.java | xargs)
jar -cf target/%{name}-%{version}.jar -C target/classes .
jar \
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 17}%{!?pkg_vcmp:0}
--date="$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)" \
%endif
--create --file=target/%{name}-%{version}.jar -C target/classes .
# javadoc
mkdir -p target/site/apidocs
javadoc -d target/site/apidocs -source 8 -notimestamp $(find src/main -name \*.java | xargs)
%{mvn_artifact} %{SOURCE1} target/%{name}-%{version}.jar
%install
# jar
@@ -59,7 +64,7 @@ install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
install -pm 0644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
%{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
%add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}