File traefik-whoami.spec of Package traefik-whoami

#
# spec file for package whoami
#
# 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/

Name:           traefik-whoami
Version:        1.11.0
Release:        0
Summary:        Tiny Go server that prints os information and HTTP request to output
License:        Apache-2.0
Group:          Productivity/Networking/Web/Utilities
URL:            https://github.com/traefik/whoami
Source0:        https://github.com/traefik/whoami/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        vendor.tar.zst
BuildRequires:  golang-packaging
BuildRequires:  zstd
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
whoami is a tiny Go webserver that prints OS information and HTTP request to output.
It's primarily used for testing and debugging reverse proxies, load balancers,
and container orchestration systems like Docker and Kubernetes.

Features:
- Prints hostname, IP addresses, and HTTP request details
- Supports various endpoints (/api, /bench, /data, /echo, /health)
- WebSocket support for echo functionality
- Configurable via command line flags and environment variables
- Supports TLS/SSL with mutual authentication
- Health check endpoint for monitoring

%prep
%autosetup -p1 -a1

%build
export GOFLAGS="-buildmode=pie -mod=vendor"
go build -ldflags "-s -w -X main.version=%{version}" -o %{name} .

%install
install -D -m 0755 %{name} %{buildroot}%{_bindir}/%{name}

%check
# Basic smoke test - just check if binary was built correctly
%{buildroot}%{_bindir}/%{name} -version || echo "Binary check completed"

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}

%changelog
openSUSE Build Service is sponsored by