Files
jose4j/jose4j.spec

66 lines
2.1 KiB
RPMSpec

#
# spec file for package jose4j
#
# 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: jose4j
Version: 0.9.5
Release: 0
Summary: JWT implementation for Java
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://bitbucket.org/b_c/jose4j
Source0: %{name}-%{version}.tar.gz
BuildRequires: java-devel >= 15
BuildRequires: javapackages-local >= 6
BuildRequires: slf4j >= 1.7
BuildArch: noarch
%description
The jose.4.j library is a robust and easy to use open source implementation of
JSON Web Token (JWT) and the JOSE specification suite (JWS, JWE, and JWK).
It is written in Java and relies solely on the JCA APIs for cryptography.
%prep
%setup -q
%build
mkdir -p classes
javac -d classes -encoding utf8 \
-source 1.8 -target 1.8 \
-cp $(build-classpath slf4j/api) \
$(find src/main/java -name '*.java' | xargs)
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 --verbose --file=%{name}-%{version}.jar -C classes .
%install
# jar
install -dm 0755 %{buildroot}%{_javadir}
install -pm 0644 %{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar
%files -f .mfiles
%doc NOTICE.txt README.md
%license LICENSE
%changelog