# Copyright (C) 2024 Maxwell G # SPDX-License-Identifier: MIT # License text: https://spdx.org/licenses/MIT %bcond manpages 1 %global forgeurl https://gitlab.com/fedora/sigs/go/go-vendor-tools %define tag v%{version_no_tilde %{quote:%nil}} Name: go-vendor-tools Version: 0.5.1^4.20240503.a459863 %forgemeta Release: 1%{?dist} Summary: Tools for handling Go library vendoring in Fedora # BSD-3-Clause: src/go_vendor_tools/archive.py License: MIT AND BSD-3-Clause URL: %{forgeurl} Source0: go-vendor-tools-0.5.1^4.20240503.a459863.tar.gz BuildArch: noarch BuildRequires: python3-devel %if %{with manpages} BuildRequires: scdoc %endif Recommends: (askalono-cli or trivy) Recommends: go-vendor-tools+all %global common_description %{expand: go-vendor-tools provides tools and macros for handling Go library vendoring in Fedora.} %description %common_description %package doc Summary: Documentation for go-vendor-tools Enhances: go-vendor-tools %description doc %common_description %prep %autosetup -p1 %generate_buildrequires %pyproject_buildrequires -x all,test %build %pyproject_wheel %if %{with manpages} ./doc/man/mkman.sh %endif mkdir -p bash_completions fish_completions zsh_completions for bin in go_vendor_archive go_vendor_license; do register-python-argcomplete --shell bash "${bin}" > "bash_completions/${bin}" register-python-argcomplete --shell fish "${bin}" > "fish_completions/${bin}.fish" # Compatibility with old argcomplete versions if ! (register-python-argcomplete --shell zsh "${bin}" > "zsh_completions/_${bin}"); then echo "#compdef ${bin}" > "zsh_completions/_${bin}" echo -e "autoload -Uz bashcompinit\nbashcompinit" > "zsh_completions/_${bin}" cat "bash_completions/${bin}" >> "zsh_completions/_${bin}" fi done %install %pyproject_install # TODO(anyone): Use -l flag once supported by EL 9. %pyproject_save_files go_vendor_tools # Install RPM macros install -Dpm 0644 rpm/macros.go_vendor_tools -t %{buildroot}%{_rpmmacrodir} # Install documentation mkdir -p %{buildroot}%{_docdir}/go-vendor-tools-doc cp -rL doc/* %{buildroot}%{_docdir}/go-vendor-tools-doc # Install manpages %if %{with manpages} install -Dpm 0644 doc/man/*.1 -t %{buildroot}%{_mandir}/man1/ %endif # Install completions install -Dpm 0644 bash_completions/* -t %{buildroot}%{bash_completions_dir}/ install -Dpm 0644 fish_completions/* -t %{buildroot}%{fish_completions_dir}/ install -Dpm 0644 zsh_completions/* -t %{buildroot}%{zsh_completions_dir}/ %check %pytest %files -f %{pyproject_files} # Install top-level markdown files %doc *.md %license LICENSES/* %{_bindir}/go_vendor* %{bash_completions_dir}/go_vendor_* %{fish_completions_dir}/go_vendor_*.fish %{zsh_completions_dir}/_go_vendor_* %{_rpmmacrodir}/macros.go_vendor_tools %if %{with manpages} %{_mandir}/man1/go*.1* %endif %files doc %doc %{_docdir}/go-vendor-tools-doc/ %pyproject_extras_subpkg -n go-vendor-tools all %changelog * Fri May 03 2024 Maxwell G - 0.5.1^4.20240503.a459863-1 - lint doc: enable pymarkdownlnt for the doc folder * Fri May 03 2024 Brad Smith - 0.5.1^3.20240503.735e24d-1 - doc scenarios: add new upstream version scenario * Thu May 02 2024 Brad Smith - 0.5.1^2.20240502.54a475f-1 - doc: update mkdocs URLs to go-sig Gitlab namespace * Thu Apr 11 2024 Maxwell G - 0.5.1^1.20240411.fc9513a-1 - Post-release version bump * Thu Apr 11 2024 Maxwell G - 0.5.1-1 - Release 0.5.1. * Thu Apr 11 2024 Maxwell G - 0.5.0-1 - Release 0.5.0. * Wed Apr 10 2024 Maxwell G - 0.4.0-1 - Release 0.4.0. * Wed Apr 10 2024 Maxwell G - 0.4.0~b1-1 - Release 0.4.0b1. * Thu Mar 28 2024 Maxwell G - 0.3.0-1 - Release 0.3.0. * Sat Mar 16 2024 Maxwell G - 0.2.0-1 - Release 0.2.0. * Sat Mar 09 2024 Maxwell G - 0.1.0-1 - Release 0.1.0. * Tue Mar 05 2024 Maxwell G - 0.0.1-1 - Release 0.0.1.