Name:                canal
Version:             1.1.7
Release:             1
Summary:             MySQL Binlog Incremental Subscription & Consuming Components
License:             ASL 2.0
URL:                 https://github.com/alibaba/canal
Source0:             https://github.com/alibaba/canal/archive/refs/tags/canal-1.1.7.tar.gz
BuildRequires:       maven java
Requires:            java
BuildArch:           noarch
%description
MySQL Binlog Incremental Subscription & Consuming Components

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


%package adapter
Summary:             Adapter for %{name}
%description adapter
This package contains the adapter components for %{name}.

%prep
%autosetup -n canal-canal-%{version} -p1
find -name "*.jar" -delete
find -name "*.class" -delete

%build
mvn package -Dmaven.test.failure.ignore=true

%install
install -d %{buildroot}%{_datadir}/canal
cp -r deployer/target/canal/bin %{buildroot}%{_datadir}/canal
cp -r deployer/target/canal/conf %{buildroot}%{_datadir}/canal
cp -r deployer/target/canal/lib %{buildroot}%{_datadir}/canal
cp -r deployer/target/canal/logs %{buildroot}%{_datadir}/canal


# Adapter files
install -d %{buildroot}%{_datadir}/canal-adapter
cp -r client-adapter/launcher/target/canal-adapter/* %{buildroot}%{_datadir}/canal-adapter

install -d %{buildroot}%{_javadir}
find . -name "*.jar" | cp --parents `xargs` %{buildroot}%{_javadir}
install -d %{buildroot}%{_datadir}/canal/javadoc
find . -name "*.xml" | cp --parents `xargs` %{buildroot}%{_datadir}/canal/javadoc

%files
%license LICENSE.txt
%{_datadir}/canal/{bin,lib,conf,logs}
%{_javadir}

%files javadoc
%doc README.md
%{_datadir}/canal/javadoc

%files adapter
%{_datadir}/canal-adapter

%changelog
* Wed Jun 19 2024 luxuexian <luxuexian@huawei.com> - 1.1.7-1
- update to 1.1.7, add canal-adapter subpackage

* Mon Jul 19 2021 huanghaitao <huanghaitao8@huawei.com> - 1.1.5-1
- package init
