File vim-plugin-perl-support.spec of Package vim-plugin-perl-support

#
# spec file for package vim-plugin-perl-support
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 https://bugs.opensuse.org/
#


%define         vimplugin_dir %{_datadir}/vim/vimfiles
Name:           vim-plugin-perl-support
Version:        5.2
Release:        0
Summary:        Write and run Perl-scripts using menus and hotkeys
License:        GPL-2.0-only
Group:          Productivity/Text/Editors
URL:            http://www.vim.org/scripts/script.php?script_id=556
Source:         perl-support.zip
BuildRequires:  unzip
BuildRequires:  vim
BuildRequires:  vim-data
Requires:       vim
Recommends:     perl(Perl::Critic)
Recommends:     perl(Perl::Tidy)

%description
- insert various types of comments
- insert complete but empty statements (e.g. 'if {} else {}' )
- insert often used code snippets (e.g. declarations, the opening of files, .. )
- insert the names of file tests, character classes, special Perl-variables and POSIX-signals
- read, write, maintain your own code snippets in a separate   directory
- run scripts or run syntax check from within the editor
- show compilation erros in a quickfix window; navigate with hotkeys
- read perldoc for functions and modules
- run perltidy / run the profiler SmallProf
- test / explain regular expressions (needs Vim with Perl interface)

This plugin comes with a help file (perlsupport.txt). Read it with

  :h perlsupport

Author Fritz Mehner

%prep
%setup -q -c %{name}

%build

%install
install -m 755 -d %{buildroot}%{vimplugin_dir}/doc
install -m 644 -p doc/*.txt %{buildroot}%{vimplugin_dir}/doc

install -m 755 -d %{buildroot}%{vimplugin_dir}/syntax
install -m 644 -p syntax/template.vim %{buildroot}%{vimplugin_dir}/syntax

install -m 755 -d %{buildroot}%{vimplugin_dir}/ftplugin
install -m 644 -p ftplugin/*.vim %{buildroot}%{vimplugin_dir}/ftplugin

install -m 755 -d %{buildroot}%{vimplugin_dir}/plugin
install -m 644 -p plugin/*.vim %{buildroot}%{vimplugin_dir}/plugin

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support/codesnippets/RegularExpressions
install -m 644 -p perl-support/codesnippets/RegularExpressions/* \
    %{buildroot}%{vimplugin_dir}/perl-support/codesnippets/RegularExpressions

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support/codesnippets
install -m 644 -p perl-support/codesnippets/*.pl \
    %{buildroot}%{vimplugin_dir}/perl-support/codesnippets
install -m 644 -p perl-support/codesnippets/dot.SmallProf \
    %{buildroot}%{vimplugin_dir}/perl-support/codesnippets
install -m 644 -p perl-support/codesnippets/free-software-comment \
    %{buildroot}%{vimplugin_dir}/perl-support/codesnippets

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support/templates
install -m 644 -p perl-support/templates/* \
    %{buildroot}%{vimplugin_dir}/perl-support/templates

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support/modules
install -m 644 -p perl-support/modules/* \
    %{buildroot}%{vimplugin_dir}/perl-support/modules

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support/scripts
install -m 755 -p perl-support/scripts/*.{pl,sh} \
    %{buildroot}%{vimplugin_dir}/perl-support/scripts

install -m 755 -d %{buildroot}%{vimplugin_dir}/perl-support/wordlists
install -m 644 -p perl-support/wordlists/* \
    %{buildroot}%{vimplugin_dir}/perl-support/wordlists

%post
vim -u NONE -U NONE -X -n '+set nobackup nomore' '+helptags %{buildroot}%{vimplugin_dir}/doc' '+qa!' </dev/null &>/dev/null

%postun
if [[ $1 == 0 ]]
then
  vim -u NONE -U NONE -X -n '+set nobackup nomore' '+helptags %{buildroot}%{vimplugin_dir}/doc' '+qa!' </dev/null &>/dev/null
fi

%files
%defattr(-,root,root,0755)
%{vimplugin_dir}
%{vimplugin_dir}/plugin
%{vimplugin_dir}/plugin/perl-support.vim
%{vimplugin_dir}/syntax
%{vimplugin_dir}/syntax/template.vim
%{vimplugin_dir}/ftplugin
%{vimplugin_dir}/perl-support
%{vimplugin_dir}/perl-support/*
%doc %{vimplugin_dir}/doc
%doc perl-support/doc/*
%doc perl-support/rc
%doc perl-support/README.perlsupport

%changelog