kafka/kafka.spec

63 lines
1.7 KiB
RPMSpec
Raw Normal View History

2020-09-05 21:46:30 -04:00
%global debug_package %{nil}
%global debug_package %{nil}
%define kafka_home /opt/kafka
2020-09-03 23:05:31 -04:00
Name: kafka
Version: 2.6.0
2020-09-05 21:46:30 -04:00
Release: 1%{?dist}
Summary: A Distributed Streaming Platform.
2020-09-03 23:05:31 -04:00
License: Apache License, Version 2.0
Source0: https://archive.apache.org/dist/%{name}/%{version}/%{name}-%{version}-src.tgz
2020-09-05 21:46:30 -04:00
Source1: https://services.gradle.org/distributions/gradle-6.5-bin.zip
2020-10-04 21:08:55 -04:00
Source2: kafka.service
2020-09-05 21:46:30 -04:00
2020-09-03 23:05:31 -04:00
BuildRequires: systemd java-1.8.0-openjdk-devel
2020-09-05 21:46:30 -04:00
Provides: kafka = %{version}
2020-09-03 23:05:31 -04:00
Requires: java-1.8.0-openjdk
%description
Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.
2020-09-05 21:46:30 -04:00
%pre
getent group %{name} >/dev/null || groupadd -r %{name}
getent passwd %{name} >/dev/null || \
useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
-c "User for Kafka services" %{name}
exit 0
2020-09-03 23:05:31 -04:00
%prep
%setup -q -n %{name}-%{version}-src
%build
2020-09-05 21:46:30 -04:00
unzip -q $RPM_SOURCE_DIR/gradle-6.5-bin.zip
./gradle-6.5/bin/gradle
2020-09-03 23:05:31 -04:00
./gradlew jar
%install
2020-09-05 21:46:30 -04:00
mkdir -p $RPM_BUILD_ROOT%{kafka_home}/{libs,bin,config}
2020-09-03 23:05:31 -04:00
2020-09-05 21:46:30 -04:00
install -p -D -m 755 bin/*.sh $RPM_BUILD_ROOT%{kafka_home}/bin
install -p -D -m 644 config/* $RPM_BUILD_ROOT%{kafka_home}/config
cp -n */build/libs/* $RPM_BUILD_ROOT%{kafka_home}/libs
cp -n */build/dependant-libs*/* $RPM_BUILD_ROOT%{kafka_home}/libs
cp -n */*/build/libs/* $RPM_BUILD_ROOT%{kafka_home}/libs
cp -n */*/build/dependant-libs*/* $RPM_BUILD_ROOT%{kafka_home}/libs
2020-09-03 23:05:31 -04:00
%files
%defattr(-,root,root)
2020-09-05 21:46:30 -04:00
%{kafka_home}
2020-09-03 23:05:31 -04:00
%doc NOTICE
%doc LICENSE
2020-09-05 21:46:30 -04:00
%clean
rm -rf %{buildroot}
2020-09-03 23:05:31 -04:00
%changelog
2020-09-05 21:46:30 -04:00
* Sat Aug 15 2020 Hao Zhang <unioah@isrc.iscas.ac.cn>
2020-09-05 21:48:13 -04:00
- init
2020-10-04 21:08:55 -04:00
* Sat Oct 04 2020 Hao Zhang <unioah@isrc.iscas.ac.cn>
- add service