File proxmox-biome.spec of Package proxmox-biome

#
# spec file for package proxmox-biome
#
# Copyright (c) 2025 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/
#

%define git_branch devel
%define git_date 20250731
%define git_version %{git_date}
%define rust_target release

Name:           proxmox-biome
Version:        %{git_version}
Release:        0
Summary:        Proxmox Biome
License:        AGPL-3.0-only
Group:          Productivity/Archiving/Backup
URL:            https://www.proxmox.com
Source0:        proxmox-biome.tar.gz
Source1:        vendor.tar.gz
Patch0:         vendor.patch
#BuildRequires: rustup
BuildRequires:  curl
BuildRequires:  fdupes 
BuildRequires:  sudo
BuildRequires:  git
BuildRequires:  jq
BuildRequires:  python3-Sphinx
BuildRequires:  pkg-config
BuildRequires:  libgudev-1_0-devel
BuildRequires:  libopenssl-devel
BuildRequires:  clang-devel
BuildRequires:  pam-devel
BuildRequires:  zlib-devel
BuildRequires:	jemalloc-devel
#BuildRequires: obs-service-cargo
#BuildRequires: osc
#BuildRequires: obs-service-tar
BuildRequires:  libuuid-devel
#BuildRequires: obs-service-format_spec_file
BuildRequires:  systemd-rpm-macros

# Pull in the latest rust/cargo toolchain
BuildRequires:  cargo
# This contains rpm macros to assist with building
#BuildRequires:  cargo-packaging
BuildRequires:  rust-packaging

# Disable this line if you wish to support all platforms.
# In most situations, you will likely only target tier1 arches for user facing components.
ExclusiveArch:  %{rust_tier1_arches}

%description
Proxmox Biome

%prep
# The number passed to -a (a stands for "after") should be equivalent to the Source tag number
# of the vendor tarball, 1 in this case (from Source1).

# % autosetup -n proxmox-backup -p1 -a1

%setup -n proxmox-biome
%setup -n proxmox-biome -D -T -a 1

%patch0 -p 0

# Remove exec bits to prevent an issue in fedora shebang checking. Uncomment only if required.
# find vendor -type f -name \*.rs -exec chmod -x '{}' \;
%define cargo_registry $(pwd)/vendor
# % global cargo_args --keep-going

%build
export BUILD_MODE=release
export BUILD_MODE=debug
export LIBEXECDIR=%{_libexecdir}
export CARGO_NET_OFFLINE=true
# % {cargo_build} --all
cd biome
cargo build --all --release

# Create Docs
# cargo doc --release --workspace
#cargo doc --workspace

#for f in etc www docs templates ; do
#    make -C $f
#done

%install
install -D -m 0644 -t %{buildroot}/usr/share/%{name} %{_builddir}/%{name}/src/biome.json
install -D -m 0755 -t %{buildroot}/%{_bindir} %{_builddir}/%{name}/src/proxmox-biome
install -D -m 0755 -t %{buildroot}/%{_bindir} %{_builddir}/%{name}/biome/target/%{rust_target}/biome

# % check
# % {cargo_test}
#cd biome
#cargo test --workspace

%files 
# % license LICENSE-FILE
%dir /usr/share/%{name}
/usr/share/%{name}/*

%{_bindir}/*

%changelog

openSUSE Build Service is sponsored by