From 1520515a336743a97183e7cfc94df7b656ce03d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Tue, 28 Jun 2022 17:51:17 +0200 Subject: [PATCH] Initial import --- .gitignore | 1 + sources | 1 + vim-go.metainfo.xml | 12 ++++++ vim-go.spec | 93 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 vim-go.metainfo.xml create mode 100644 vim-go.spec diff --git a/.gitignore b/.gitignore index e69de29..272551a 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/vim-go-1.26.tar.gz diff --git a/sources b/sources index e69de29..b17aef7 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (vim-go-1.26.tar.gz) = 30722557c2c66e3601a001b490bf4949bf9949a2b41db838f0fa3fba91abb30469d3726cee293afdd1afd385871d62db09e9e9bf2acf48d947b469a5a19888ac diff --git a/vim-go.metainfo.xml b/vim-go.metainfo.xml new file mode 100644 index 0000000..8a316cc --- /dev/null +++ b/vim-go.metainfo.xml @@ -0,0 +1,12 @@ + + + + vim-go + gvim.desktop + vim-go + Go development plugin for Vim + https://github.com/fatih/vim-go + CC0-1.0 + BSD-3-Clause + nforro@redhat.com + diff --git a/vim-go.spec b/vim-go.spec new file mode 100644 index 0000000..b55b32a --- /dev/null +++ b/vim-go.spec @@ -0,0 +1,93 @@ +%global vimfiles_root %{_datadir}/vim/vimfiles +%global appdata_dir %{_datadir}/appdata + +# do not build debugsource and debuginfo subpackages +%global debug_package %{nil} + +Name: vim-go +Version: 1.26 +Release: 1%{?dist} +Summary: Go development plugin for Vim + +License: BSD +URL: https://github.com/fatih/vim-go +Source0: https://github.com/fatih/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +Source1: %{name}.metainfo.xml + +# cannot build as noarch until golang is available on all arches +#BuildArch: noarch + +# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required +ExclusiveArch: %{?golang_arches}%{!?golang_arches:%{ix86} x86_64 %{arm}} + +Requires: vim-common +Requires(post): vim +Requires(postun): vim + +Requires: golang + +%description +Go (golang) support for Vim. It comes with predefined sensible settings +(like auto gofmt on save), has auto-complete, snippet support, improved syntax +highlighting, go tool-chain commands, etc... +If needed vim-go installs all necessary binaries for providing seamless Vim +integration with current commands. It's highly customizable and each individual +feature can be disabled/enabled easily. + +%prep +%setup -q + + +%build + + +%install +mkdir -p %{buildroot}%{vimfiles_root} +cp -ar {autoload,compiler,doc,ftdetect,ftplugin,gosnippets,indent,plugin,rplugin,syntax,templates} \ + %{buildroot}%{vimfiles_root} +# remove version control files +find %{buildroot}%{vimfiles_root} -name .gitignore -o -name .gitkeep -delete + +mkdir -p %{buildroot}%{appdata_dir} +install -m 644 %{SOURCE1} %{buildroot}%{appdata_dir} + + +# up until version 1.22, %%{vimfiles_root}/autoload/go/test-fixtures/fmt/src/imports was a symlink, +# but it changed to a directory in later versions - remove it to avoid conflict +%pretrans -p +path = rpm.expand('%{vimfiles_root}') .. '/autoload/go/test-fixtures/fmt/src/imports' +st = posix.stat(path) +if st and st.type == 'link' then + os.remove(path) +end + + +%post +vim -c ":helptags %{vimfiles_root}/doc" -c ":q" &> /dev/null || : + + +%postun +> %{vimfiles_root}/doc/tags || : +vim -c ":helptags %{vimfiles_root}/doc" -c ":q" &> /dev/null || : + + +%files +%license LICENSE +%doc README.md +%{vimfiles_root}/autoload/* +%{vimfiles_root}/compiler/* +%{vimfiles_root}/doc/* +%{vimfiles_root}/ftdetect/* +%{vimfiles_root}/ftplugin/* +%{vimfiles_root}/gosnippets/* +%{vimfiles_root}/indent/* +%{vimfiles_root}/plugin/* +%{vimfiles_root}/rplugin/* +%{vimfiles_root}/syntax/* +%{vimfiles_root}/templates/* +%{appdata_dir}/%{name}.metainfo.xml + + +%changelog +* Tue Jun 28 2022 Nikola Forró - 1.26-1 +- Initial import