Submitting a new package OBS-URL: https://build.opensuse.org/request/show/1219838 OBS-URL: https://build.opensuse.org/package/show/Java:packages/tomlj?expand=0&rev=1
103 lines
2.9 KiB
RPMSpec
103 lines
2.9 KiB
RPMSpec
#
|
||
# spec file for package tomlj
|
||
#
|
||
# 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: tomlj
|
||
Version: 1.1.1
|
||
Release: 0
|
||
Summary: A Java parser for Tom’s Obvious, Minimal Language (TOML)
|
||
License: Apache-2.0
|
||
Group: Development/Libraries/Java
|
||
URL: https://github.com/%{name}/%{name}
|
||
Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||
Source1: https://repo1.maven.org/maven2/org/%{name}/%{name}/%{version}/%{name}-%{version}.pom
|
||
BuildRequires: fdupes
|
||
BuildRequires: maven-local
|
||
BuildRequires: mvn(org.antlr:antlr4-maven-plugin)
|
||
BuildRequires: mvn(org.checkerframework:checker-qual)
|
||
BuildArch: noarch
|
||
|
||
%description
|
||
TomlJ is a complete TOML parser with the following attributes:
|
||
|
||
* Supports the latest TOML specification version (1.0.0).
|
||
* Provides detailed error reporting, including error position.
|
||
* Performs error recovery, allowing parsing to continue after an error.
|
||
|
||
It uses the ANTLR parser-generator and runtime library.
|
||
|
||
%package javadoc
|
||
Summary: API documentation for %{name}
|
||
Group: Documentation/HTML
|
||
|
||
%description javadoc
|
||
API documentation for %{name}.
|
||
|
||
%prep
|
||
%autosetup
|
||
|
||
cp %{SOURCE1} pom.xml
|
||
|
||
mv src/main/antlr{,4}
|
||
|
||
sed -i -e '/^@header/,+2d' src/main/antlr4/org/tomlj/internal/*.g4
|
||
|
||
%pom_change_dep org.antlr:antlr4-runtime :::compile
|
||
%pom_change_dep org.checkerframework:checker-qual :::compile
|
||
|
||
%pom_add_plugin org.antlr:antlr4-maven-plugin . \
|
||
'<configuration>
|
||
<visitor>true</visitor>
|
||
</configuration>
|
||
<executions>
|
||
<execution>
|
||
<goals>
|
||
<goal>antlr4</goal>
|
||
</goals>
|
||
</execution>
|
||
</executions>'
|
||
|
||
%pom_add_plugin org.apache.maven.plugins:maven-jar-plugin . \
|
||
'<configuration>
|
||
<archive>
|
||
<manifestEntries>
|
||
<Implementation-Title>tomlj</Implementation-Title>
|
||
<Implementation-Version>%{version}</Implementation-Version>
|
||
<Automatic-Module-Name>org.tomlj</Automatic-Module-Name>
|
||
</manifestEntries>
|
||
</archive>
|
||
</configuration>'
|
||
|
||
%{mvn_file} : %{name}
|
||
|
||
%build
|
||
%{mvn_build} -f -- \
|
||
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)
|
||
|
||
%install
|
||
%mvn_install
|
||
%fdupes %{buildroot}%{_javadocdir}/%{name}
|
||
|
||
%files -f .mfiles
|
||
%license LICENSE
|
||
%doc README.md
|
||
|
||
%files javadoc -f .mfiles-javadoc
|
||
%license LICENSE
|
||
|
||
%changelog
|