File kube-kompare.spec of Package kube-kompare
#
# spec file for package kube-kompare
#
# Copyright (c) 2024 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 __arch_install_post export NO_BRP_STRIP_DEBUG=true
%define executable_name kompare
Name: kube-kompare
Version: 0.0.2~alpha3
Release: 0
Summary: CLI tool to compare two kubernetes cluster and their resources
License: Apache-2.0
URL: https://github.com/xendit/kube-kompare
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: go >= 1.22
# binary conflicts with KDE's kompare
Conflicts: kompare
%description
Kompare is a Go CLI runner for comparing two clusters. This software compares
two Kubernetes clusters using kubeconfig to connect to them and compare
existing objects in the two clusters based on flexible criteria passed via the
command line.
When comparing two Kubernetes clusters, you may encounter challenges such as
ignoring Kubernetes resource definition subtypes like UID and dates, or
filtering and comparing only specific types of objects. Existing tools may not
offer the flexibility to define such criteria, which led us to create Kompare.
%prep
%autosetup -p 1 -a 1
%build
DATE_FMT="+%%Y-%%m-%%dT%%H:%%M:%%SZ"
BUILD_DATE=$(date -u -d "@${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u -r "${SOURCE_DATE_EPOCH}" "${DATE_FMT}" 2>/dev/null || date -u "${DATE_FMT}")
go build \
-mod=vendor \
-buildmode=pie \
-o bin/%{executable_name}
%install
install -D -m 0755 bin/%{executable_name} %{buildroot}/%{_bindir}/%{executable_name}
%files
%doc README.md
%license LICENSE
%{_bindir}/%{executable_name}
%changelog