2017-12-19 08:11:27 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package vgrep
|
|
|
|
|
#
|
2024-06-17 11:04:58 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-12-19 08:11:27 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2019-02-17 12:22:12 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-12-19 08:11:27 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Remove stripping of Go binaries.
|
|
|
|
|
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
|
|
|
|
|
# Project name when using go tooling.
|
|
|
|
|
%define project github.com/vrothberg/vgrep
|
|
|
|
|
Name: vgrep
|
2024-06-17 11:04:58 +00:00
|
|
|
Version: 2.8.0
|
2017-12-19 08:11:27 +00:00
|
|
|
Release: 0
|
2017-12-26 20:02:15 +00:00
|
|
|
Summary: Frontend for git-grep and grep
|
2019-02-17 12:22:12 +00:00
|
|
|
License: GPL-3.0-only
|
2017-12-19 08:11:27 +00:00
|
|
|
Group: Productivity/Text/Utilities
|
2020-04-17 14:07:50 +00:00
|
|
|
URL: https://github.com/vrothberg/vgrep
|
2019-02-17 12:22:12 +00:00
|
|
|
Source0: https://github.com/vrothberg/vgrep/archive/v%{version}.tar.gz
|
2017-12-19 08:11:27 +00:00
|
|
|
BuildRequires: fdupes
|
2024-06-17 11:04:58 +00:00
|
|
|
BuildRequires: golang(API) >= 1.21
|
2017-12-19 08:11:27 +00:00
|
|
|
Requires: git-core
|
|
|
|
|
Requires: grep
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
vgrep is a command-line tool to search textual patterns in directories. It
|
|
|
|
|
serves as a frontend to grep and git-grep and allows to open the indexed
|
|
|
|
|
matching lines in a user-specified editor. vgrep is inspired by the ancient
|
|
|
|
|
cgvg scripts but extended to perform further operations such as listing
|
|
|
|
|
statistics of files and directory trees or showing the context lines before and
|
|
|
|
|
after the matches.
|
|
|
|
|
|
|
|
|
|
%prep
|
2021-01-21 08:12:44 +00:00
|
|
|
%autosetup
|
2017-12-19 08:11:27 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
# We can't use symlinks here because go-list gets confused by symlinks, so we
|
|
|
|
|
# have to copy the source to $HOME/go and then use that as the GOPATH.
|
|
|
|
|
export GOPATH=$HOME/go
|
|
|
|
|
mkdir -pv $HOME/go/src/%{project}
|
|
|
|
|
rm -rf $HOME/go/src/%{project}/*
|
|
|
|
|
cp -avr * $HOME/go/src/%{project}
|
|
|
|
|
|
|
|
|
|
# Build the binary.
|
|
|
|
|
cd $HOME/go/src/%{project}
|
2020-09-01 10:48:37 +00:00
|
|
|
go build -mod=vendor -o ./build/vgrep -buildmode=pie -ldflags "-s -w -X main.version=%{version}"
|
2017-12-19 08:11:27 +00:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
# Install the binary.
|
|
|
|
|
install -D -m 0755 $HOME/go/src/%{project}/build/%{name} "%{buildroot}/%{_bindir}/%{name}"
|
|
|
|
|
|
2017-12-26 20:02:15 +00:00
|
|
|
%fdupes %{buildroot}/%{_prefix}
|
2017-12-19 08:11:27 +00:00
|
|
|
|
|
|
|
|
%files
|
2021-01-21 08:12:44 +00:00
|
|
|
%license LICENSE
|
2017-12-19 08:11:27 +00:00
|
|
|
%{_bindir}/%{name}
|
|
|
|
|
|
|
|
|
|
%changelog
|