]> granicus.if.org Git - icinga2/commitdiff
RPM: Add packages for syntax highlighting
authorDirk Goetz <dirk.goetz@netways.de>
Tue, 28 Apr 2015 17:14:05 +0000 (19:14 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 17 Jun 2016 11:07:21 +0000 (13:07 +0200)
refs #8401

doc/2-getting-started.md
icinga2.spec

index c600cb02e03b1002917369528c72b24d9c288f8f..455f62be4394d038dbf80d2bb5efd6046c0c4661 100644 (file)
@@ -325,28 +325,19 @@ to obtain the Vim configuration, please install the extra package `vim-icinga2`.
 
 ### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
 
-Create a new local vim configuration storage in your home directory (`~/.vim`), if it doesn't exist already.
-The `~/.vim/syntax` directory  contains the actual syntax file and the one in `~/.vim/ftdetect` is used to detect
-the file type. Both are called `icinga2.vim`. 
+Install the package vim-icinga2 with your distribution's package manager.
 
-    $ PREFIX=~/.vim
-    $ mkdir -p $PREFIX/{syntax,ftdetect}
-    $ cd /usr/share/doc/icinga2-common-[x.x.x]/syntax/vim
-    $ cp syntax/icinga2.vim $PREFIX/syntax/
-    $ cp ftdetect/icinga2.vim $PREFIX/ftdetect/
+Debian/Ubuntu:
+
+    $ apt-get install vim-icinga2
 
-On Debian systems replace the path `/usr/share/doc/icinga2-common-[x.x.x]/syntax/vim` with `/usr/share/vim/addons`. Alternatively,
-you can use the `vim-addons` tool to create the `~/.vim/syntax` and `~/.vim/ftdetect` directories and create symlinks to the files
-in `/usr/share/vim/addons`:
+RHEL/CentOS/Fedora:
 
-    $ vim-addons install icinga2
-    Info: installing removed addon 'icinga2' to /home/root/.vim
-    $ ls -l /home/root/.vim/*
-    /home/root/.vim/ftdetect:
-    lrwxrwxrwx 1 root root [...] icinga2.vim -> /usr/share/vim/addons/ftdetect/icinga2.vim
+    $ yum install vim-icinga2
+
+SLES/openSUSE:
 
-    /home/root/.vim/syntax:
-    lrwxrwxrwx 1 root root [...]  icinga2.vim -> /usr/share/vim/addons/syntax/icinga2.vim
+    $ zypper install vim-icinga2
 
 Test it:
 
@@ -357,19 +348,30 @@ Test it:
 
 ### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
 
-Copy the `/etc/nanorc` sample file to your home directory and rename it to `~/.nanorc`. Create the `/etc/nano`
-directory and copy the provided `icinga2.nanorc` into it.
+Install the package nano-icinga2 with your distribution's package manager.
+
+Debian/Ubuntu:
+
+    $ apt-get install nano-icinga2
+
+RHEL/CentOS/Fedora:
+
+    $ yum install nano-icinga2
+
+SLES/openSUSE:
+
+    $ zypper install nano-icinga2
+
+Copy the `/etc/nanorc` sample file to your home directory. 
 
     $ cp /etc/nanorc ~/.nanorc
-    # mkdir -p /etc/nano
-    # cp /usr/share/doc/icinga2-common-[x.x.x]/syntax/nano/icinga2.nanorc /etc/nano
 
 On Debian systems change `/usr/share/doc/icinga2-common-[x.x.x]/syntax/nano/icinga2.nanorc` to `/usr/share/nano/icinga2.nanorc`.
 
 Then include the icinga2.nanorc file in your ~/.nanorc by adding the following line:
 
     ## Icinga 2
-    include "/etc/nano/icinga2.nanorc"
+    include "/usr/share/nano/icinga2.nanorc"
 
 Test it:
 
index 37775dc6bc9e49ca0954b235a85f0f1d458bc567..1cbcfd4fd2143203ded2727b576d943841b117a8 100644 (file)
@@ -253,6 +253,27 @@ Provides a GUI for the Icinga 2 API.
 %endif
 
 
+%package -n vim-icinga2
+Summary:      Vim syntax highlighting for icinga2
+Group:        Applications/System
+%if "%{_vendor}" == "suse"
+Requires:     vim-data
+%else
+Requires:     vim-filesystem
+%endif
+
+%description -n vim-icinga2
+Vim syntax highlighting for icinga2
+
+
+%package -n nano-icinga2
+Summary:      Nano syntax highlighting for icinga2
+Group:        Applications/System
+Requires:     nano
+
+%description -n nano-icinga2
+Nano syntax highlighting for icinga2
+
 %prep
 %setup -q -n %{name}-%{version}
 
@@ -378,6 +399,21 @@ mkdir -p %{buildroot}%{_prefix}/lib/firewalld/services
 install -p -m 644 tools/firewalld/%{name}.xml %{buildroot}%{_prefix}/lib/firewalld/services
 %endif
 
+%if "%{_vendor}" == "suse"
+%if 0%{?suse_version} >= 1310
+install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/syntax/%{name}.vim
+install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim74/ftdetect/%{name}.vim
+%else
+install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/syntax/%{name}.vim
+install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vim72/ftdetect/%{name}.vim
+%endif
+%else
+install -D -m 0644 tools/syntax/vim/syntax/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/%{name}.vim
+install -D -m 0644 tools/syntax/vim/ftdetect/%{name}.vim %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
+%endif
+
+install -D -m 0644 tools/syntax/nano/%{name}.nanorc %{buildroot}%{_datadir}/nano/%{name}.nanorc
+
 %clean
 [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
 
@@ -715,4 +751,23 @@ fi
 %{_datadir}/applications/icinga2-studio.desktop
 %endif
 
+%files -n vim-icinga2
+%defattr(-,root,root,-)
+%if "%{_vendor}" == "suse"
+%if 0%{?suse_version} >= 1310
+%{_datadir}/vim/vim74/syntax/%{name}.vim
+%{_datadir}/vim/vim74/ftdetect/%{name}.vim
+%else
+%{_datadir}/vim/vim72/syntax/%{name}.vim
+%{_datadir}/vim/vim72/ftdetect/%{name}.vim
+%endif
+%else
+%{_datadir}/vim/vimfiles/syntax/%{name}.vim
+%{_datadir}/vim/vimfiles/ftdetect/%{name}.vim
+%endif
+
+%files -n nano-icinga2
+%defattr(-,root,root,-)
+%{_datadir}/nano/%{name}.nanorc
+
 %changelog