%define _define _jar_repack %{nil}
%define debug_package %{nil}
Name: druid
Version: 27.0.0
Release: 1
Summary: Druid is a high performance real-time analytics.
License: Apache-2.0
URL: https://druid.apache.org
Source0: https://github.com/apache/druid/archive/refs/tags/%{name}-%{version}.tar.gz
Source1: https://repo.huaweicloud.com/kunpeng/maven/org/hyperic/sigar-dist/1.6.5.132/sigar-dist-1.6.5.132.zip
Source2: https://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/5.5.12/kafka-schema-registry-client-5.5.12.jar
Source3: https://packages.confluent.io/maven/io/confluent/kafka-schema-registry-client/6.0.1/kafka-schema-registry-client-6.0.1.jar
Source4: https://packages.confluent.io/maven/io/confluent/kafka-protobuf-provider/6.0.1/kafka-protobuf-provider-6.0.1.jar
Source5: https://packages.confluent.io/maven/io/confluent/kafka-protobuf-provider/5.5.12/kafka-protobuf-provider-5.5.12.jar
Patch0: 0001-change-npm.patch
BuildRequires: java-1.8.0-openjdk-devel maven zlib npm gcc-c++ gcc gcc-gfortran libgcc python3-pip git npm
Requires: java-1.8.0-openjdk
%description
Druid is a high performance real-time analytics.
%prep
%autosetup -p1 -n %{name}-%{name}-%{version}
mvn install:install-file -DgroupId=org.hyperic -DartifactId=sigar-dist -Dversion=1.6.5.132 -Dpackaging=zip -Dfile=%{SOURCE1}
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=5.5.12 -Dpackaging=jar -Dfile=%{SOURCE2}
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=6.0.1 -Dpackaging=jar -Dfile=%{SOURCE3}
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-protobuf-provider -Dversion=6.0.1 -Dpackaging=jar -Dfile=%{SOURCE4}
mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-protobuf-provider -Dversion=5.5.12 -Dpackaging=jar -Dfile=%{SOURCE5}
%build
pip install pip install --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
pip3 install pyyaml==5.4.1 -i https://repo.huaweicloud.com/repository/pypi/simple
mvn clean install -Pdist -DskipTests -Dcheckstyle.skip -Dmaven.test.skip=true
%install
mkdir -p $RPM_BUILD_ROOT/opt/druid
cp -r %{_builddir}/druid-druid-%{version}/distribution/target/apache-druid-%{version}-bin.tar.gz %{_builddir}
cd %{_builddir}
tar -xf apache-druid-%{version}-bin.tar.gz
cp -r %{_builddir}/apache-druid-%{version} $RPM_BUILD_ROOT/opt/druid
%files
/opt/druid
%changelog
* Mon Sep 25 2023 xiexing <xiexing4@hisilicon.com> -27.0.0-1
- update version
* Mon Apr 25 2022 xiexing <xiexing4@hisilicon.com> -0.22.1-1
-Initial package release