Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Nikola Forró
1520515a33 Initial import 2022-06-28 17:51:17 +02:00
4 changed files with 107 additions and 0 deletions

1
.gitignore vendored
View file

@ -0,0 +1 @@
/vim-go-1.26.tar.gz

View file

@ -0,0 +1 @@
SHA512 (vim-go-1.26.tar.gz) = 30722557c2c66e3601a001b490bf4949bf9949a2b41db838f0fa3fba91abb30469d3726cee293afdd1afd385871d62db09e9e9bf2acf48d947b469a5a19888ac

12
vim-go.metainfo.xml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2015 Nikola Forró <nforro@redhat.com> -->
<component type="addon">
<id>vim-go</id>
<extends>gvim.desktop</extends>
<name>vim-go</name>
<summary>Go development plugin for Vim</summary>
<url type="homepage">https://github.com/fatih/vim-go</url>
<metadata_license>CC0-1.0</metadata_license>
<project_license>BSD-3-Clause</project_license>
<updatecontact>nforro@redhat.com</updatecontact>
</component>

93
vim-go.spec Normal file
View file

@ -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 <lua>
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ó <nforro@redhat.com> - 1.26-1
- Initial import