From a6722cf16690b12317db991859a783a139fff340 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Wed, 14 Jul 2021 13:48:18 +0300 Subject: [PATCH] initial commit --- .gitmodules | 3 +++ README.md | 46 +++++++++++++++++++++++++++++++++++++++++++ build.sh | 7 +++++++ kafkacat | 1 + kafkacat.spec | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 .gitmodules create mode 100644 README.md create mode 100644 build.sh create mode 160000 kafkacat create mode 100644 kafkacat.spec diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..4f08da9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "kafkacat"] + path = kafkacat + url = https://github.com/edenhill/kafkacat.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..a80400a --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# kafkacat + +This is a Fedora package repository of [kafkacat](https://github.com/edenhill/kafkacat) utility + +# dependencies + +1. librdkafka + +``` +# dnf install librdkafka +``` + +2. fedora build system + +``` +# dnf install fedora-packager fedora-review +# usermod -a -G mock +``` + +... and perform a relogin to update user groups + +# how to run + +1. clone this repo + +``` +git clone https://github.com/bvn13/kafkacat.git +``` + +2. update submodule + +``` +git submodule foreach git pull origin master +``` + +3. build fedora package + +``` +fedpkg --release f34 local +``` + +4. install built rpm + +``` +# rpm -i x86_64/kafkacat-1.7.0-1.x86_64.rpm +``` diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..fff2a78 --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#/bin/bash + +git submodule foreach git pull origin master + +ln -sf kafkacat kafkacat-1.7.0 + +fedpkg --release f34 local diff --git a/kafkacat b/kafkacat new file mode 160000 index 0000000..b104319 --- /dev/null +++ b/kafkacat @@ -0,0 +1 @@ +Subproject commit b10431980d2d9b6d75f85d2779b36538f1d315a1 diff --git a/kafkacat.spec b/kafkacat.spec new file mode 100644 index 0000000..85eab0e --- /dev/null +++ b/kafkacat.spec @@ -0,0 +1,54 @@ +Name: kafkacat +Version: 1.7.0 +Release: 1%(?dist) +Summary: kafkacat is a generic non-JVM producer and consumer for Apache Kafka 0.8, think of it as a netcat for Kafka. + +Group: Productivity/Networking/Other +License: BSD-2-Clause +URL: https://github.com/edenhill/kafkacat +Source: kafkacat-%{version}.tar +Requires: librdkafka + +BuildRequires: zlib-devel gcc >= 4.1 librdkafka-devel +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +%description +kafkacat is a generic non-JVM producer and consumer for Apache Kafka >= 0.8, +think of it as a netcat for Kafka. + +In producer mode kafkacat reads messages from stdin, delimited with a +configurable delimeter (-D, defaults to newline), and produces them to the +provided Kafka cluster (-b), topic (-t) and partition (-p). + +In consumer mode kafkacat reads messages from a topic and partition and prints +them to stdout using the configured message delimiter. + +kafkacat also features a Metadata list (-L) mode to display the current state +of the Kafka cluster and its topics and partitions. + +kafkacat is fast and lightweight; statically linked it is no more than 150Kb. + +%prep +%setup -q + +%configure +#./configure +./configure --prefix=/usr + +%build +make + +%install +rm -rf %{buildroot} +DESTDIR=%{buildroot} make install + +%clean +rm -rf %{buildroot} + +%files -n %{name} +%defattr(755,root,root) +%{_bindir}/kafkacat +%defattr(644,root,root) +%doc README.md +%doc LICENSE +