SHA256
1
0
forked from suse-edge/Factory
Files
Factory/hauler/hauler.spec
2025-03-20 20:28:44 +01:00

65 lines
1.6 KiB
RPMSpec

#
# spec file for package hauler
#
# 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 project github.com/hauler-dev/hauler
Name: hauler
Version: 1.2.1
Release: 0
Summary: Airgap Swiss Army Knife
License: Apache-2.0
URL: https://github.com/hauler-dev/hauler
Source: hauler-%{version}.tar
Source1: vendor.tar.gz
BuildRequires: golang-packaging
%description
%prep
%setup -q -n hauler-%{version}
%build
%goprep %{project}
tar -xf %{SOURCE1}
MODULE=hauler.dev/go/hauler
%define buildtime %(date +%%Y-%%m-%%dT%%H:%%M:%%S%%z)
%define buildcommit %%SOURCE_COMMIT%%
go build \
-mod=vendor \
-buildmode=pie \
-o hauler \
-ldflags \
"-X $MODULE/internal/version.gitVersion=v%{version} -X $MODULE/internal/version.gitCommit=%{buildcommit} -X $MODULE/internal/version.buildDate=%{buildtime}" \
./cmd/hauler
%install
install -D -m 0755 hauler %{buildroot}%{_bindir}/hauler
%files
%doc README.md
%{_bindir}/hauler
%changelog