tags -1 patch
thanks

On 2021-06-28 00 h 34, Sebastiaan Couwenberg wrote:
> Control: tags -1 moreinfo
> 
> On 6/27/21 8:48 PM, Louis-Philippe Véronneau wrote:
>> Debian now has dh-vim-addon [1] to manage the installation procedure of
>> vim packages. It does "the right thing" (makes vim packages suitable for
>> the "new" vim :packadd feature) and generally helps make all vim
>> packages consistent.
>>
>> Please consider migrating to it.
>>
>> Here's an example of a package using it:
>>
>> https://salsa.debian.org/vim-team/vim-gitgutter/-/tree/master/debian
> 
> It's not clear how the icing2 packaging should be changed to use
> dh-vim-addon and how that benefits the icinga2 packaging.
> 
> The packaging already installs the vim bits in
> usr/share/vim/{registry,addons/{ftdetect,syntax}}.
> 
> If I understand the gitgutter example correctly, those files should be
> moved to somewhere under /usr/share/icinga2 and that path used in
> vim-icinga2.vim-addon.>
> The upstream packaging for packages.icinga.com is unlikely to use the
> addon because it's not available for oldstable. Hence I'm hesitant to
> adopt it in Debian and further diverge from upstream.

I think there's a lot of value in using dh-foo tooling, as it
standardizes packaging and provides a single, central utility to update
when something needs to be changed.

I do understand the argument about not wanting to diverge too much from
the upstream package though and in the end, that's your decision :)

I've included a patch to make the change I'm proposing. I've tested it
and it works as intended. Hopefully, it will provide you with the info
you requested. FWIW, the install tree looks like this:

-------------------------------------
./
./usr/
./usr/share/
./usr/share/doc/
./usr/share/doc/vim-icinga2/
./usr/share/doc/vim-icinga2/changelog.Debian.gz
./usr/share/doc/vim-icinga2/changelog.gz
./usr/share/doc/vim-icinga2/copyright
./usr/share/icinga2/
./usr/share/icinga2/vim/
./usr/share/icinga2/vim/ftdetect/
./usr/share/icinga2/vim/ftdetect/icinga2.vim
./usr/share/icinga2/vim/syntax/
./usr/share/icinga2/vim/syntax/icinga2.vim
./usr/share/nvim/
./usr/share/nvim/site/
./usr/share/nvim/site/pack/
./usr/share/nvim/site/pack/dist-bundle/
./usr/share/nvim/site/pack/dist-bundle/start/
./usr/share/nvim/site/pack/dist-bundle/start/icinga2 ->
../../../../../icinga2/vim
./usr/share/vim/
./usr/share/vim/vimfiles/
./usr/share/vim/vimfiles/pack/
./usr/share/vim/vimfiles/pack/dist-bundle/
./usr/share/vim/vimfiles/pack/dist-bundle/start/
./usr/share/vim/vimfiles/pack/dist-bundle/start/icinga2 ->
../../../../../icinga2/vim
-------------------------------------

Those changes can certainly be made "by hand" too, but IMO it's more
manual work and could lead to more work in the future if the vim best
practices change again.

Cheers, and thanks for maintaining icinga2 in Debian.

-- 
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   po...@debian.org / veronneau.org
  ⠈⠳⣄
From 19d70ba50267bae35b0ce5af47902bb09d8ba1b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= <po...@debian.org>
Date: Thu, 1 Jul 2021 22:09:07 -0400
Subject: [PATCH] Migrate vim-icinga2 to dh-vim-addon

---
 debian/control                   |  8 ++------
 debian/rules                     |  2 +-
 debian/vim-icinga2.README.Debian | 13 -------------
 debian/vim-icinga2.install       |  4 +---
 debian/vim-icinga2.neovim-addon  |  1 +
 debian/vim-icinga2.vim-addon     |  1 +
 debian/vim-icinga2.yaml          |  5 -----
 7 files changed, 6 insertions(+), 28 deletions(-)
 delete mode 100644 debian/vim-icinga2.README.Debian
 create mode 120000 debian/vim-icinga2.neovim-addon
 create mode 100644 debian/vim-icinga2.vim-addon
 delete mode 100644 debian/vim-icinga2.yaml

diff --git a/debian/control b/debian/control
index b61490d5..fe640e33 100644
--- a/debian/control
+++ b/debian/control
@@ -10,6 +10,7 @@ Build-Depends: bash-completion,
                cmake (>= 2.8.8),
                cmake (>= 3.2.2) | pkg-config,
                debhelper-compat (= 12),
+               dh-vim-addon,
                flex,
                g++ (>= 1.96),
                libboost-dev,
@@ -208,13 +209,8 @@ Description: host and network monitoring system - PostgreSQL support
 
 Package: vim-icinga2
 Architecture: all
-Depends: ${misc:Depends}
-Recommends: vim-addon-manager
+Depends: ${vim-addon:Depends}, ${misc:Depends}
 Multi-Arch: foreign
 Description: syntax highlighting for Icinga 2 config files in VIM
  The vim-icinga2 package provides filetype detection and syntax
  highlighting for Icinga 2 config files.
- .
- As per the Debian vim policy, installed addons are not activated
- automatically, but the "vim-addon-manager" tool can be used for this
- purpose.
diff --git a/debian/rules b/debian/rules
index 3ebcf6b2..299f946d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,7 +14,7 @@ ifneq (,$(filter $(DEB_HOST_ARCH), armel mips mipsel powerpc))
 endif
 
 %:
-	dh $@ --with bash_completion
+	dh $@ --with bash_completion --with vim_addon
 
 override_dh_auto_clean:
 	dh_auto_clean
diff --git a/debian/vim-icinga2.README.Debian b/debian/vim-icinga2.README.Debian
deleted file mode 100644
index 50366fe1..00000000
--- a/debian/vim-icinga2.README.Debian
+++ /dev/null
@@ -1,13 +0,0 @@
-Dear user, this package provides the vim addon for Icinga 2, but it is not enabled
-per default.
-
-If you want to enable it for your user account just execute
-
-        vim-addons install icinga2
-
-Similarly, to enable it for all users of this system just execute (as root):
-
-        vim-addons -w install icinga2
-
-vim-addons is provided by the vim-addon-manager package, have a look at its
-manpage for more information.
diff --git a/debian/vim-icinga2.install b/debian/vim-icinga2.install
index afca62ba..9d03eeb2 100644
--- a/debian/vim-icinga2.install
+++ b/debian/vim-icinga2.install
@@ -1,3 +1 @@
-debian/vim-icinga2.yaml               usr/share/vim/registry
-tools/syntax/vim/ftdetect/icinga2.vim usr/share/vim/addons/ftdetect
-tools/syntax/vim/syntax/icinga2.vim   usr/share/vim/addons/syntax
+tools/syntax/vim usr/share/icinga2
diff --git a/debian/vim-icinga2.neovim-addon b/debian/vim-icinga2.neovim-addon
new file mode 120000
index 00000000..13c5207e
--- /dev/null
+++ b/debian/vim-icinga2.neovim-addon
@@ -0,0 +1 @@
+vim-icinga2.vim-addon
\ No newline at end of file
diff --git a/debian/vim-icinga2.vim-addon b/debian/vim-icinga2.vim-addon
new file mode 100644
index 00000000..827a9e5c
--- /dev/null
+++ b/debian/vim-icinga2.vim-addon
@@ -0,0 +1 @@
+usr/share/icinga2/vim icinga2
diff --git a/debian/vim-icinga2.yaml b/debian/vim-icinga2.yaml
deleted file mode 100644
index 483a0673..00000000
--- a/debian/vim-icinga2.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-addon: icinga2
-description: "Syntax highlighting for Icinga 2"
-files:
-  - ftdetect/icinga2.vim
-  - syntax/icinga2.vim
-- 
2.32.0

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to