Name:                cassandra-java-driver
Version:             3.4.0
Release:             2
Summary:             DataStax Java Driver for Apache Cassandra
License:             ASL 2.0
URL:                 https://github.com/datastax/java-driver
Source0:             https://github.com/datastax/java-driver/archive/%{version}.tar.gz
Patch0:              %{name}-%{version}-Remove-Guava-code-for-v18.patch
BuildRequires:       maven-local mvn(io.dropwizard.metrics:metrics-core)
BuildRequires:       mvn(com.fasterxml.jackson.core:jackson-databind) mvn(com.google.guava:guava)
BuildRequires:       mvn(io.netty:netty-handler) mvn(io.netty:netty-transport-native-epoll)
BuildRequires:       mvn(javax.json:javax.json-api) mvn(joda-time:joda-time) mvn(log4j:log4j:1.2.17)
BuildRequires:       mvn(net.jpountz.lz4:lz4) mvn(org.apache.commons:commons-exec)
BuildRequires:       mvn(org.assertj:assertj-core) mvn(org.hdrhistogram:HdrHistogram)
BuildRequires:       mvn(org.mockito:mockito-all) mvn(org.ow2.asm:asm-all) mvn(org.slf4j:slf4j-api)
BuildRequires:       mvn(org.slf4j:slf4j-log4j12) mvn(org.sonatype.oss:oss-parent:pom:)
BuildRequires:       mvn(org.testng:testng) mvn(org.xerial.snappy:snappy-java)
BuildRequires:       mvn(org.apache.felix:maven-bundle-plugin) mvn(com.github.jnr:jnr-ffi)
BuildRequires:       mvn(com.github.jnr:jnr-posix) mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires:       mvn(org.apache.maven.plugins:maven-failsafe-plugin)
BuildRequires:       mvn(org.apache.felix:org.apache.felix.framework)
BuildRequires:       mvn(ch.qos.logback:logback-classic)
BuildArch:           noarch
%description
A driver for Apache Cassandra 1.2+ that works exclusively with the
Cassandra Query Language version 3 (CQL3) and Cassandra's binary protocol.

%package extras
Summary:             DataStax Java Driver for Apache Cassandra - Extras
Requires:            %{name} = %{version}-%{release}
%description extras
Extended functionality for the Java driver.

%package mapping
Summary:             DataStax Java Driver for Apache Cassandra - Object Mapping
Requires:            %{name} = %{version}-%{release}
%description mapping
Object mapper for the DataStax CQL Java Driver.

%package parent
Summary:             DataStax Java Driver for Apache Cassandra - Parent POM
%description parent
Parent POM for the DataStax Java Driver.

%package tests
Summary:             DataStax Java Driver for Apache Cassandra - Tests
Requires:            %{name} = %{version}-%{release}
%description tests
Tests for the DataStax Java Driver.

%package javadoc
Summary:             Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -qn java-driver-%{version}
%patch0 -p1
%pom_disable_module driver-dist
%pom_disable_module driver-examples
%pom_disable_module stress driver-tests
%pom_disable_module shading driver-tests
%pom_remove_plugin -r :animal-sniffer-maven-plugin:
%pom_remove_plugin -r :clirr-maven-plugin
%pom_remove_plugin -r :license-maven-plugin
%pom_xpath_remove -r "pom:build/pom:extensions"
%pom_remove_plugin -r :maven-source-plugin
%pom_remove_plugin -r :maven-release-plugin
%pom_remove_plugin :gmaven-plugin driver-mapping
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-javadoc-plugin']/pom:executions/pom:execution/pom:goals"
%pom_remove_plugin -r :maven-shade-plugin driver-core
rm manual/statements/.nav
rm manual/object_mapper/.nav
%mvn_package ":cassandra-driver-tests-parent" tests
%mvn_package ":cassandra-driver-tests-osgi" tests

%build
%mvn_build -fs

%install
%mvn_install

%files -f .mfiles-cassandra-driver-core
%doc README.md changelog faq manual upgrade_guide
%license LICENSE

%files extras -f .mfiles-cassandra-driver-extras

%files mapping -f .mfiles-cassandra-driver-mapping

%files parent -f .mfiles-cassandra-driver-parent
%license LICENSE

%files tests -f .mfiles-tests

%files javadoc -f .mfiles-javadoc
%license LICENSE

%changelog
* Mon Feb 14 2022 wangkai <wangkai385@huawei.com> - 3.4.0-2
- Rebuild for fix log4j1.x cves

* Tue Aug 25 2020 wangyue <wangyue92@huawei.com> - 3.4.0-1
- package init
