File influxdb3.spec of Package influxdb3

#
# spec file for package influxdb_iox
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%global pkg_name influxdb

Name:           influxdb3
Version:        0.1.0~git1729878542.0e814f5d52
Release:        0
Summary:        The new core of InfluxDB written in Rust on top of Apache Arrow
License:        Apache-2.0 AND MIT
Url:            https://github.com/influxdata/influxdb
Source:         %{pkg_name}-%{version}.tar.zst
Source1:        vendor.tar.zst
Source2:        influxdb3.service
Source3:        influxdb3.env
Source4:        influxdb3.sysusers
Patch1:         fix_version_importing.patch
BuildRequires:  gcc-c++
BuildRequires:  cargo 
BuildRequires:  cargo-c
BuildRequires:  rust
BuildRequires:  clang-devel
BuildRequires:  llvm-devel
BuildRequires:  lld
BuildRequires:  postgresql-devel
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(systemd)
BuildRequires:  cargo-packaging
BuildRequires:  sysuser-shadow
BuildRequires:  sysuser-tools

%{?systemd_ordering}
%{?sysusers_requires}

%description
InfluxDB IOx (short for Iron Oxide, pronounced InfluxDB "eye-ox") is the future
core of InfluxDB, an open source time series database. The name is in homage to
Rust, the language this project is written in. It is built using Apache Arrow
and DataFusion among other things. InfluxDB IOx aims to be:

- The future core of InfluxDB; supporting industry standard SQL, InfluxQL, and
  Flux
- An in-memory columnar store using object storage for persistence
- A fast analytic database for structured and semi-structured events (like logs
  and tracing data)
- A system for defining replication (synchronous, asynchronous, push and pull)
  and partitioning rules for InfluxDB time series data and tabular analytics
  data
- A system supporting real-time subscriptions
- A processor that can transform and do arbitrary computation on time series
  and event data as it arrives
- An analytic database built for data science, supporting Apache Arrow Flight
  for fast data transfer

Persistence is through Parquet files in object storage. It is a design goal to
support integration with other big data systems through object storage and
Parquet specifically.

%prep
%autosetup -p1 -a 1 -n %{pkg_name}-%{version}

%build
export VERSION="%{version}"
export VERSION_HASH="${VERSION##*.}"
export GIT_HASH_SHORT="${VERSION_HASH}"
export GIT_HASH=$(awk '/commit:/ {print $2}' < ${RPM_SOURCE_DIR}/influxdb.obsinfo)
%{cargo_build}

%sysusers_generate_pre %{SOURCE4} %{name} %{name}.conf

%install
install -D -m 0755 target/release/influxdb3 %{buildroot}%{_bindir}/influxdb3

install -D -m 0750 -d         %{buildroot}%{_sysconfdir}/%{name}/
install -D -m 0640 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/env
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
install -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/%{name}.conf

%pre -f %{name}.pre
%service_add_pre %{name}.service

%preun
%service_del_preun %{name}.service

%post
%service_add_post %{name}.service

%postun
%service_del_postun %{name}.service

%files
%doc *.md assets/
%license LICENSE*
%{_bindir}/influxdb3
%config(noreplace) %{_sysconfdir}/%{name}/
%{_unitdir}/%{name}.service
%{_sysusersdir}/%{name}.conf

%changelog
openSUSE Build Service is sponsored by