153 lines
5.0 KiB
RPMSpec
153 lines
5.0 KiB
RPMSpec
|
#
|
||
|
# spec file for package protobuf-java
|
||
|
#
|
||
|
# Copyright (c) 2024 SUSE LLC
|
||
|
# Copyright (c) 2024 Andreas Stieger <Andreas.Stieger@gmx.de>
|
||
|
#
|
||
|
# 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/
|
||
|
#
|
||
|
|
||
|
|
||
|
%define tarname protobuf
|
||
|
%define baseversion 28.2
|
||
|
Name: protobuf-java
|
||
|
Version: 4.%{baseversion}
|
||
|
Release: 0
|
||
|
Summary: Java Bindings for Google Protocol Buffers
|
||
|
License: BSD-3-Clause
|
||
|
Group: Development/Libraries/Java
|
||
|
URL: https://github.com/protocolbuffers/protobuf
|
||
|
Source0: https://github.com/protocolbuffers/protobuf/releases/download/v%{baseversion}/%{tarname}-%{baseversion}.tar.gz
|
||
|
Source1: https://repo1.maven.org/maven2/com/google/protobuf/%{name}/%{version}/%{name}-%{version}.pom
|
||
|
Source2: https://repo1.maven.org/maven2/com/google/protobuf/%{name}lite/%{version}/%{name}lite-%{version}.pom
|
||
|
Source3: https://repo1.maven.org/maven2/com/google/protobuf/%{name}-util/%{version}/%{name}-util-%{version}.pom
|
||
|
BuildRequires: fdupes
|
||
|
BuildRequires: java-devel >= 1.8
|
||
|
BuildRequires: maven-local
|
||
|
BuildRequires: protobuf-devel >= %{baseversion}
|
||
|
BuildRequires: mvn(com.google.code.findbugs:jsr305)
|
||
|
BuildRequires: mvn(com.google.code.gson:gson)
|
||
|
BuildRequires: mvn(com.google.errorprone:error_prone_annotations)
|
||
|
BuildRequires: mvn(com.google.guava:guava)
|
||
|
BuildRequires: mvn(com.google.j2objc:j2objc-annotations)
|
||
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||
|
Requires: java >= 1.8
|
||
|
Requires: protobuf-devel >= %{baseversion}
|
||
|
BuildArch: noarch
|
||
|
|
||
|
%description
|
||
|
Protocol Buffers are a way of encoding structured data in an efficient yet
|
||
|
extensible format. Google uses Protocol Buffers for almost all of its internal
|
||
|
RPC protocols and file formats.
|
||
|
|
||
|
This package contains the Java bindings.
|
||
|
|
||
|
%package parent
|
||
|
Summary: Java Bindings for Google Protocol Buffers (parent pom)
|
||
|
|
||
|
%description parent
|
||
|
Protocol Buffers are a way of encoding structured data in an efficient yet
|
||
|
extensible format. Google uses Protocol Buffers for almost all of its internal
|
||
|
RPC protocols and file formats.
|
||
|
|
||
|
This package contains the parent pom of the Java bindings.
|
||
|
|
||
|
%package bom
|
||
|
Summary: Java Bindings for Google Protocol Buffers (bom)
|
||
|
|
||
|
%description bom
|
||
|
Protocol Buffers are a way of encoding structured data in an efficient yet
|
||
|
extensible format. Google uses Protocol Buffers for almost all of its internal
|
||
|
RPC protocols and file formats.
|
||
|
|
||
|
This package contains the bill-of-materials pom of the Java bindings.
|
||
|
|
||
|
%package javadoc
|
||
|
Summary: Javadoc for %{name}
|
||
|
Group: Documentation/HTML
|
||
|
|
||
|
%description javadoc
|
||
|
This package contains the API documentation for %{name}.
|
||
|
|
||
|
%prep
|
||
|
%autosetup -p1 -n %{tarname}-%{baseversion}
|
||
|
|
||
|
# The previous blank line is crucial for older system being able
|
||
|
# to use the autosetup macro
|
||
|
|
||
|
pushd java
|
||
|
cp %{SOURCE1} core/pom.xml
|
||
|
cp %{SOURCE2} lite/pom.xml
|
||
|
cp %{SOURCE3} util/pom.xml
|
||
|
%pom_disable_module kotlin
|
||
|
%pom_disable_module kotlin-lite
|
||
|
%pom_disable_module lite
|
||
|
%pom_remove_plugin :animal-sniffer-maven-plugin
|
||
|
%pom_xpath_set "pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration/pom:source" "1.8"
|
||
|
%pom_xpath_set "pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration/pom:target" "1.8"
|
||
|
|
||
|
%{mvn_package} :{*}-parent parent
|
||
|
%{mvn_package} :{*}-bom bom
|
||
|
|
||
|
%{mvn_file} :{*} @1
|
||
|
%{mvn_file} :%{name} %{tarname}
|
||
|
|
||
|
popd
|
||
|
|
||
|
%build
|
||
|
pushd java
|
||
|
protoc \
|
||
|
--java_out=core/src/main/java \
|
||
|
--proto_path=../src \
|
||
|
--proto_path=core/src/main/resources/google/protobuf \
|
||
|
core/src/main/resources/google/protobuf/java_features.proto
|
||
|
for i in \
|
||
|
../src/google/protobuf/any.proto \
|
||
|
../src/google/protobuf/api.proto \
|
||
|
../src/google/protobuf/descriptor.proto \
|
||
|
../src/google/protobuf/duration.proto \
|
||
|
../src/google/protobuf/empty.proto \
|
||
|
../src/google/protobuf/field_mask.proto \
|
||
|
../src/google/protobuf/source_context.proto \
|
||
|
../src/google/protobuf/struct.proto \
|
||
|
../src/google/protobuf/timestamp.proto \
|
||
|
../src/google/protobuf/type.proto \
|
||
|
../src/google/protobuf/wrappers.proto; do
|
||
|
protoc \
|
||
|
--java_out=core/src/main/java \
|
||
|
--proto_path=../src \
|
||
|
--proto_path=core/src/main/resources/google/protobuf \
|
||
|
${i}
|
||
|
cp ${i} core/src/main/resources/google/protobuf/
|
||
|
done
|
||
|
|
||
|
%{mvn_build} -f -- -Dprotoc=$(type -p protoc)
|
||
|
popd
|
||
|
|
||
|
%install
|
||
|
pushd java
|
||
|
%mvn_install
|
||
|
%fdupes -s %{buildroot}%{_javadocdir}
|
||
|
popd
|
||
|
|
||
|
%files -f java/.mfiles
|
||
|
%license LICENSE
|
||
|
|
||
|
%files bom -f java/.mfiles-bom
|
||
|
|
||
|
%files parent -f java/.mfiles-parent
|
||
|
|
||
|
%files javadoc -f java/.mfiles-javadoc
|
||
|
%license LICENSE
|
||
|
|
||
|
%changelog
|