File perfmark.spec of Package perfmark
#
# spec file for package perfmark
#
# 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: perfmark
Version: 0.27.0
Release: 0
Summary: A High Performance Tracing Library
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://www.perfmark.io/
Source0: https://github.com/%{name}/%{name}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://repo1.maven.org/maven2/io/%{name}/%{name}-api/%{version}/%{name}-api-%{version}.pom
Source2: https://repo1.maven.org/maven2/io/%{name}/%{name}-impl/%{version}/%{name}-impl-%{version}.pom
Source3: https://repo1.maven.org/maven2/io/%{name}/%{name}-traceviewer/%{version}/%{name}-traceviewer-%{version}.pom
Source4: https://repo1.maven.org/maven2/io/%{name}/%{name}-tracewriter/%{version}/%{name}-tracewriter-%{version}.pom
Source5: https://repo1.maven.org/maven2/io/%{name}/%{name}-java6/%{version}/%{name}-java6-%{version}.pom
Source6: https://repo1.maven.org/maven2/io/%{name}/%{name}-java7/%{version}/%{name}-java7-%{version}.pom
Source7: https://repo1.maven.org/maven2/io/%{name}/%{name}-java9/%{version}/%{name}-java9-%{version}.pom
Source8: https://repo1.maven.org/maven2/io/%{name}/%{name}-java15/%{version}/%{name}-java15-%{version}.pom
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(com.google.errorprone:error_prone_annotation)
BuildArch: noarch
%description
PerfMark is a low-overhead, manually-instrumented, tracing library for Java.
Users can add the tracing function calls to their code to see how long each
part takes.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
API documentation for %{name}.
%prep
%autosetup
cp %{SOURCE1} api/pom.xml
cp %{SOURCE2} impl/pom.xml
cp %{SOURCE3} traceviewer/pom.xml
cp %{SOURCE4} tracewriter/pom.xml
cp %{SOURCE5} java6/pom.xml
cp %{SOURCE6} java7/pom.xml
cp %{SOURCE7} java9/pom.xml
cp %{SOURCE8} java15/pom.xml
cat >pom.xml <<__POM__
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>4.0.0</modelVersion>
<groupId>io.%{name}</groupId>
<artifactId>%{name}-parent</artifactId>
<version>%{version}</version>
<packaging>pom</packaging>
<modules>
<module>api</module>
<module>impl</module>
<module>traceviewer</module>
<module>tracewriter</module>
<module>java6</module>
<module>java7</module>
<module>java9</module>
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 15}%{!?pkg_vcmp:0}
<module>java15</module>
%endif
</modules>
</project>
__POM__
%global manifest_entries <Implementation-Version>%{version}</Implementation-Version>\
<Implementation-Title>PerfMark (https://www.perfmark.io/)</Implementation-Title>\
<Implementation-Vendor>Carl Mastrangelo https://www.carlmastrangelo.com/ https://twitter.com/CarlMastrangelo</Implementation-Vendor>\
<Specification-Version>%{version}</Specification-Version>\
<Specification-Title>PerfMark (https://www.perfmark.io/)</Specification-Title>\
<Specification-Vendor>Carl Mastrangelo (https://www.perfmark.io/)</Specification-Vendor>\
<Carl-Is-Awesome>true</Carl-Is-Awesome>\
%{nil}
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin api \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin impl \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.impl</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin traceviewer \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.traceviewer</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin tracewriter \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.tracewriter</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin java6 \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.javasix</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin java7 \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.javaseven</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin java9 \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.javanine</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin java15 \
'<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>io.%{name}.javafifteen</Automatic-Module-Name>
%{manifest_entries}
</manifestEntries>
</archive>
</configuration>'
%pom_change_dep -r : :::compile
%pom_add_dep com.google.errorprone:error_prone_annotation api
%build
%{mvn_build} -f -- \
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ) \
-Dmaven.compiler.{source,target}=11
%install
%mvn_install
%fdupes %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%license NOTICE LICENSE
%doc {CONTRIBUTING,README}.md doc
%files javadoc -f .mfiles-javadoc
%license NOTICE LICENSE
%changelog