File datanucleus-core.spec of Package datanucleus-core
#
# spec file for package datanucleus-core
#
# Copyright (c) 2023 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/
#
%global debug_package %{nil}
Name: datanucleus-core
Version: 6.0.4
Release: 0
Summary: DataNucleus Core
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://www.datanucleus.org/%{name}
Source: https://github.com/datanucleus/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz
Patch0: java8compat.patch
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: mvn(javax.cache:cache-api)
BuildRequires: mvn(javax.enterprise:cdi-api)
BuildRequires: mvn(javax.transaction:javax.transaction-api)
BuildRequires: mvn(javax.validation:validation-api)
BuildRequires: mvn(log4j:log4j)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.logging.log4j:log4j-api)
BuildRequires: mvn(org.datanucleus:datanucleus-maven-parent:pom:)
BuildRequires: mvn(org.osgi:osgi.core)
BuildArch: noarch
%description
DataNucleus Core provides the primary components
of a heterogeneous Java persistence solution.
It supports persistence API's being layered on
top of the core functionality.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{name}-%{name}-%{version}
%patch -P 0 -p1
# Use generic OSGi APIs
%pom_change_dep :org.osgi.core org.osgi:osgi.core
%pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin' ]/pom:configuration/pom:instructions" '
<Require-Bundle>org.eclipse.equinox.registry;resolution:=optional,org.eclipse.core.runtime;resolution:=optional</Require-Bundle>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-Vendor>DataNucleus</Bundle-Vendor>
<Premain-Class>org.datanucleus.enhancer.DataNucleusClassFileTransformer</Premain-Class>
<Export-Package>org.datanucleus*;version="${project.version}"</Export-Package>'
%pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId = 'maven-bundle-plugin' ]" "
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>"
%build
%{mvn_build} -f -- \
%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0}
-Dmaven.compiler.release=8 \
%endif
-Dsource=8
%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license src/main/resources/META-INF/LICENSE.txt
%doc src/main/resources/META-INF/NOTICE.txt
%files javadoc -f .mfiles-javadoc
%license src/main/resources/META-INF/LICENSE.txt
%doc src/main/resources/META-INF/NOTICE.txt
%changelog