2022-05-03 04:46:39 +00:00
|
|
|
#
|
|
|
|
# spec file for package jslt
|
|
|
|
#
|
2024-03-19 06:53:42 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2022-05-03 04:46:39 +00:00
|
|
|
#
|
|
|
|
# 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: jslt
|
2024-03-19 06:53:42 +00:00
|
|
|
Version: 0.1.14
|
2022-05-03 04:46:39 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: JSON query and transformation language
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
URL: https://github.com/schibsted/%{name}
|
|
|
|
Source0: %{url}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
|
|
Source1: https://repo1.maven.org/maven2/com/schibsted/spt/data/%{name}/%{version}/%{name}-%{version}.pom
|
|
|
|
Source2: %{name}.pod
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: maven-local
|
|
|
|
BuildRequires: mvn(com.fasterxml.jackson.core:jackson-databind)
|
|
|
|
BuildRequires: mvn(net.java.dev.javacc:javacc)
|
|
|
|
BuildRequires: mvn(org.apache.maven.plugins:maven-javadoc-plugin)
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description
|
|
|
|
JSLT is a complete query and transformation language for JSON. The language
|
|
|
|
design is inspired by jq, XPath, and XQuery.
|
|
|
|
|
|
|
|
JSLT can be used as:
|
|
|
|
|
|
|
|
• a query language to extract values from JSON (.foo.bar[0]),
|
|
|
|
• a filter/check language to test JSON objects
|
|
|
|
(starts-with(.foo.bar[0], "http://")) ,
|
|
|
|
• a transformation language to convert between JSON formats.
|
|
|
|
|
|
|
|
%package javadoc
|
|
|
|
Summary: API documentation for %{name}
|
|
|
|
Group: Documentation/HTML
|
|
|
|
|
|
|
|
%description javadoc
|
|
|
|
API documentation for %{name}.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
pushd core
|
|
|
|
cp %{SOURCE1} pom.xml
|
2024-03-19 06:53:42 +00:00
|
|
|
|
|
|
|
%pom_change_dep com.fasterxml.jackson.core:jackson-databind::runtime :::compile
|
|
|
|
|
2022-05-03 04:46:39 +00:00
|
|
|
%{mvn_file} : %{name}
|
|
|
|
popd
|
|
|
|
|
|
|
|
%build
|
|
|
|
pushd core
|
|
|
|
jjtree \
|
|
|
|
-OUTPUT_DIRECTORY=src/main/java/schibsted/spt/data/jslt/parser \
|
2024-03-19 06:53:42 +00:00
|
|
|
src/main/jjtree/jslt.jjt
|
2022-05-03 04:46:39 +00:00
|
|
|
javacc \
|
|
|
|
-OUTPUT_DIRECTORY=src/main/java/schibsted/spt/data/jslt/parser \
|
2024-03-19 06:53:42 +00:00
|
|
|
src/main/java/schibsted/spt/data/jslt/parser/jslt.jj
|
|
|
|
%{mvn_build} -f -- \
|
|
|
|
-Dproject.build.outputTimestamp=$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)
|
2022-05-03 04:46:39 +00:00
|
|
|
popd
|
2024-03-19 06:53:42 +00:00
|
|
|
|
2022-05-03 04:46:39 +00:00
|
|
|
pod2man \
|
|
|
|
--release='%{name} %{version}' \
|
|
|
|
--section=1 \
|
|
|
|
--center='User Commands' \
|
|
|
|
--quotes=none \
|
|
|
|
%{SOURCE2} \
|
|
|
|
%{name}.1
|
|
|
|
|
|
|
|
%install
|
|
|
|
pushd core
|
|
|
|
%mvn_install
|
|
|
|
popd
|
2024-03-19 06:53:42 +00:00
|
|
|
|
2022-05-03 04:46:39 +00:00
|
|
|
%fdupes %{buildroot}%{_javadocdir}/%{name}
|
2024-03-19 06:53:42 +00:00
|
|
|
|
2022-05-03 04:46:39 +00:00
|
|
|
%jpackage_script com.schibsted.spt.data.jslt.cli.JSLT '' '' %{name}:jackson-core:jackson-databind:jackson-annotations %{name} true
|
2024-03-19 06:53:42 +00:00
|
|
|
|
2022-05-03 04:46:39 +00:00
|
|
|
install -dm0755 %{buildroot}/%{_mandir}/man1
|
|
|
|
install -m0644 %{name}.1 %{buildroot}/%{_mandir}/man1
|
|
|
|
|
|
|
|
%files -f core/.mfiles
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md docs/*.md examples ideas language-design.txt tutorial.md
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
%{_mandir}/man1/%{name}.1%{?ext_man}
|
|
|
|
|
|
|
|
%files javadoc -f core/.mfiles-javadoc
|
|
|
|
%license LICENSE
|
|
|
|
|
|
|
|
%changelog
|