%global forgeurl https://github.com/mvdan/sh %global version %(date +%Y%m%d) %global commit c6351e95dbeeb2645b68c463ea916eed815bef5e %global _forgeversionsuffix %{scm}%(printf %.7s %{commit}) %global source_date_epoch_from_changelog 0 %global _enable_debug_packages 0 %global gomodulesmode GO111MODULE=on %forgemeta Name: gosh-shfmt Version: %{forgeversion} Release: %{autorelease} Summary: Shell parser, formatter, and interpreter License: BSD-3-Clause URL: %{forgeurl} Source0: %{forgesource} BuildRequires: golang-bin BuildRequires: go-rpm-macros BuildRequires: systemd-rpm-macros %description This package provides the gosh and shfmt tools. It serves as a shell parser, formatter, and interpreter. Shells supported by this package: - POSIX shell - Bash - Zsh - mksh %prep %forgeautosetup %build export GOPROXY="https://proxy.golang.org,direct" export GOFLAGS="-trimpath" export GO_LDFLAGS="-s -w" for MODULE in gosh shfmt do %gobuild -o ${MODULE} ./cmd/${MODULE} done %install for MODULE in gosh shfmt do %__install -p -m 755 -D -t %{buildroot}%{_bindir} ${MODULE} done %__install -p -m 644 -D -t %{buildroot}%{_licensedir}/%{name} LICENSE %__install -p -m 644 -D -t %{buildroot}%{_pkgdocdir} AGENTS.md CHANGELOG.md README.md %files %license %{_licensedir}/* %doc %{_pkgdocdir} %{_bindir}/*