glow/glow.spec

69 lines
2.0 KiB
RPMSpec

#
# spec file for package spec glow
#
# Copyright (c) 2020 Andreas Schneider <asn@cryptomilk.org>
#
# 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 http://bugs.opensuse.org/
#
%{go_nostrip}
Name: glow
Version: 1.2.1
Release: 0
Summary: Render markdown on the CLI
#
License: MIT
#
Group: System/Console
Url: https://github.com/charmbracelet/glow
#
Source0: https://github.com/charmbracelet/glow/archive/v%{version}/%{name}-%{version}.tar.gz
# GOFLAGS="-mod=mod" go mod download && go mod vendor
# rm -f ../vendor.tar.xz && tar cJf ../vendor.tar.xz vendor/
Source1: vendor.tar.xz
#
BuildRequires: fdupes
BuildRequires: golang(API) >= 1.11
BuildRequires: golang-packaging
%description
Glow is a terminal based markdown reader designed from the ground up to bring
out the beauty—and power—of the CLI.
Use it to discover markdown files, read documentation directly on the command
line and stash markdown files to your own private collection so you can read
them anywhere. Glow will find local markdown files in subdirectories or a local
Git repository.
%prep
%autosetup -p1 -a1
%build
go build \
-mod=vendor \
-buildmode=pie \
-ldflags "-s -w -X main.Version=%{version}"
%install
install -d -m 0755 %{buildroot}%{_bindir}
install -m 0755 glow %{buildroot}%{_bindir}/glow
%check
./glow --version
%files
%defattr(-,root,root,-)
%doc README.md
%license LICENSE
%{_bindir}/glow