a1e7d41
# There is no better way how to obtain the vimfiles folder location :/
a1e7d41
# https://bugzilla.redhat.com/show_bug.cgi?id=844975
a1e7d41
%global vimfiles  %{_datadir}/vim/vimfiles
a1e7d41
a1e7d41
%global commandt_so_dir %{ruby_vendorarchdir}/command-t
a1e7d41
dddc59c
%global appdata_dir %{_datadir}/appdata
dddc59c
a1e7d41
Name: vim-command-t
67468f2
Version: 1.10
eb2ab28
Release: 2%{?dist}
a1e7d41
Summary: An extremely fast, intuitive mechanism for opening files in VIM
a1e7d41
Group: Applications/Editors
a1e7d41
License: BSD
a1e7d41
URL: https://wincent.com/products/command-t
a1e7d41
# Officialy distributed only using vimball:
a1e7d41
# https://wincent.com/issues/1978
a1e7d41
# git clone git://git.wincent.com/command-t.git && cd command-t/
67468f2
# git archive 1.10 -o command-t-1.10.tar.gz
a1e7d41
Source0: command-t-%{version}.tar.gz
dddc59c
# Plug-in AppData for Gnome Software.
dddc59c
# https://github.com/wincent/Command-T/issues/99
dddc59c
Source1: vim-command-t.metainfo.xml
8c6a9aa
Requires: ruby(release)
3ad49b4
# Although command-t does not depend on rubygems directly, the RubyGems are
3ad49b4
# required by Ruby, but not always (rhbz#845011). So it is necessary to enforce
3ad49b4
# the RubyGems dependency, to fix possile SEGFAULT (rhbz#858135). There is
3ad49b4
# unfortunately nothing better to do about it, as long as RPM/YUM does not
3ad49b4
# support some conditional requires.
3ad49b4
Requires: ruby(rubygems)
a1e7d41
Requires: vim-common
8c6a9aa
BuildRequires: ruby(release)
a1e7d41
BuildRequires: ruby-devel
8c6a9aa
BuildRequires: rubygem(rspec)
a1e7d41
BuildRequires: rubygem(rr)
a1e7d41
Requires(post): %{_bindir}/vim
a1e7d41
Requires(postun): %{_bindir}/vim
a1e7d41
a1e7d41
%description
a1e7d41
The Command-T plug-in for VIM provides an extremely fast, intuitive mechanism
a1e7d41
for opening files with a minimal number of keystrokes. It's named "Command-T"
a1e7d41
because it is inspired by the "Go to File" window bound to Command-T
a1e7d41
in TextMate.
a1e7d41
a1e7d41
Files are selected by typing characters that appear in their paths, and are
a1e7d41
ordered by an algorithm which knows that characters that appear in certain
a1e7d41
locations (for example, immediately after a path separator) should be given
a1e7d41
more weight.
a1e7d41
a1e7d41
%prep
a1e7d41
%setup -q -c
a1e7d41
a1e7d41
%build
a1e7d41
pushd ./ruby/command-t
a1e7d41
a1e7d41
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
a1e7d41
ruby extconf.rb --vendor
a1e7d41
make %{?_smp_mflags}
a1e7d41
a1e7d41
popd
a1e7d41
a1e7d41
a1e7d41
%install
a1e7d41
mkdir -p %{buildroot}%{vimfiles}
eb2ab28
cp -par {autoload,doc,plugin,ruby} %{buildroot}%{vimfiles}
a1e7d41
a1e7d41
mkdir -p %{buildroot}%{commandt_so_dir}
a1e7d41
chmod 0755 %{buildroot}%{vimfiles}/ruby/command-t/ext.so
a1e7d41
mv %{buildroot}%{vimfiles}/ruby/command-t/ext.so %{buildroot}%{commandt_so_dir}
a1e7d41
a1e7d41
# Remove all dot files.
a1e7d41
find %{buildroot}%{vimfiles} -name '.*' -delete
a1e7d41
a1e7d41
# Replace symlink with copy.
a1e7d41
rm README.txt
a1e7d41
cp -pa doc/command-t.txt README.txt
a1e7d41
dddc59c
# Install AppData.
dddc59c
mkdir -p %{buildroot}%{appdata_dir}
dddc59c
install -m 644 %{SOURCE1} %{buildroot}%{appdata_dir}
dddc59c
a1e7d41
%check
a1e7d41
# Get rid of Bundler
67468f2
sed -i '/Bundler/,/^end$/ s/^/#/' spec/spec_helper.rb
a1e7d41
a1e7d41
rspec -Iruby spec
a1e7d41
a1e7d41
%post
a1e7d41
vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null
a1e7d41
a1e7d41
%postun
a1e7d41
> %{vimfiles}/doc/tags
a1e7d41
vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null
a1e7d41
a1e7d41
%files
a1e7d41
%doc LICENSE
a1e7d41
%doc README.txt
a1e7d41
%{commandt_so_dir}
eb2ab28
%{vimfiles}/autoload/*
a1e7d41
%{vimfiles}/doc/*
a1e7d41
%{vimfiles}/plugin/*
a1e7d41
%exclude %{vimfiles}/ruby/command-t/ext*
a1e7d41
%exclude %{vimfiles}/ruby/command-t/*.o
a1e7d41
%exclude %{vimfiles}/ruby/command-t/*.h
a1e7d41
%exclude %{vimfiles}/ruby/command-t/*.c
a1e7d41
%exclude %{vimfiles}/ruby/command-t/Makefile
a1e7d41
%exclude %{vimfiles}/ruby/command-t/mkmf.log
a1e7d41
%exclude %{vimfiles}/ruby/command-t/depend
eb2ab28
%{vimfiles}/ruby
dddc59c
%{appdata_dir}/vim-command-t.metainfo.xml
a1e7d41
a1e7d41
a1e7d41
%changelog
eb2ab28
* Mon Aug 11 2014 Vít Ondruch <vondruch@redhat.com> - 1.10-2
eb2ab28
- Add missing autoload directory.
eb2ab28
67468f2
* Mon Aug 11 2014 Vít Ondruch <vondruch@redhat.com> - 1.10-1
67468f2
- Update to Command-T 1.10.
dddc59c
- Add Gnome Software plug-in AppData (rhbz#1110300).
67468f2
88cdaa7
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8-2
88cdaa7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
88cdaa7
9ad4147
* Tue Apr 29 2014 Vít Ondruch <vondruch@redhat.com> - 1.8-1
9ad4147
- Update to Command-T 1.8.
9ad4147
5fb8672
* Thu Dec 19 2013 Vít Ondruch <vondruch@redhat.com> - 1.6-1
5fb8672
- Update to command-t 1.6.
5fb8672
419153d
* Mon Sep 23 2013 Vít Ondruch <vondruch@redhat.com> - 1.5-1
419153d
- Update to command-t 1.5.
419153d
a74390e
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-5
a74390e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
a74390e
3ad49b4
* Wed Apr 10 2013 Vít Ondruch <vondruch@redhat.com> - 1.4-4
3ad49b4
- Add dependency on RubyGems to fix possible SEGFAULT (rhbz#858135).
3ad49b4
8c6a9aa
* Wed Feb 27 2013 Vít Ondruch <vondruch@redhat.com> - 1.4-3
8c6a9aa
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
8c6a9aa
f2f6f84
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
f2f6f84
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f2f6f84
a1e7d41
* Fri Aug 03 2012 Vít Ondruch <vondruch@redhat.com> - 1.4-1
a1e7d41
- Initial package.