File containerlab.spec of Package containerlab
#
# spec file for package containerlab
#
# Copyright (c) 2022-2024, Martin Hauke <mardnh@gmx.de>
#
# 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: containerlab
Version: 0.71.0
Release: 0
Summary: Containerlab enables container-based networking labs
License: BSD-3-Clause
Group: Productivity/Networking/Other
URL: https://containerlab.srlinux.dev/
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: go
BuildRequires: golang-packaging
%{go_provides}
%description
Containerlab provides a CLI for orchestrating and managing container-based
etworking labs. It starts the containers, builds a virtual wiring between
them to create lab topologies of users choice and manages labs lifecycle.
%prep
%autosetup -a 1 -p 1
%build
export GO111MODULE=on
export GOPROXY=direct
export GOSUMDB=off
COMMIT_HASH=$(git rev-parse --short HEAD || echo "unknown")
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
go build -mod=vendor \
-ldflags="-s -w \
-X 'github.com/srl-labs/containerlab/cmd/version.Version=%{version}' \
-X 'github.com/srl-labs/containerlab/cmd/version.commit=${COMMIT_HASH}' \
-X 'github.com/srl-labs/containerlab/cmd/version.date=${BUILD_DATE}'" \
-o containerlab
%install
install -d %{buildroot}%{_bindir}
install -m 0755 containerlab %{buildroot}%{_bindir}/
%files
%license LICENSE
%doc README.md
%{_bindir}/containerlab
%changelog