%define appname micro %define commit 3a7403b %define date 20260128 %define import_path github.com/micro-editor/micro/v2 Name: micro-git Version: 2.0.15^%{date}g%{commit} Release: 1%{?dist} Summary: A modern and intuitive terminal-based text editor License: MIT AND BSD-3-Clause AND BSD-2-Clause AND Apache-2.0 AND MPL-2.0 URL: https://github.com/micro-editor/micro Source0: %{url}/archive/refs/heads/master.zip Source1: %{appname}-vendor.tar.gz ExclusiveArch: %{go_arches} BuildRequires: git-core BuildRequires: make BuildRequires: golang BuildRequires: go-rpm-macros BuildRequires: compiler(go-compiler) BuildRequires: pandoc %description micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals. It is a single, batteries-included, static binary. %prep %autosetup -n %{appname}-master -a 1 %build export GO111MODULE=on export LDFLAGS="-X %{import_path}/internal/util.Version=%{version} \ -X %{import_path}/internal/util.CommitHash=%{commit} \ -X %{import_path}/internal/util.CompileDate=%{date}" %gobuild -o %{appname} -mod=vendor -ldflags "$LDFLAGS" ./cmd/micro make -f Makefile man %install install -Dpm 0755 %{appname} %{buildroot}%{_bindir}/%{appname} install -Dpm 0644 assets/packaging/%{appname}.1 %{buildroot}%{_mandir}/man1/%{appname}.1 install -Dpm 0644 assets/packaging/%{appname}.desktop %{buildroot}%{_datadir}/applications/%{appname}.desktop install -Dpm 0644 assets/packaging/%{appname}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{appname}.svg %files %license LICENSE LICENSE-THIRD-PARTY %doc README.md %{_bindir}/%{appname} %{_mandir}/man1/micro.1* %{_datadir}/applications/%{appname}.desktop %{_datadir}/icons/hicolor/scalable/apps/%{appname}.svg %changelog %autochangelog