Add support for alternatives system in Debian package (#1935)
* Allows for micro to be selectable in the `editor` group * Use same priority as in the nano package Ref: https://wiki.debian.org/DebianAlternatives
This commit is contained in:
parent
dd8e341de2
commit
0bbc3e7e3d
3 changed files with 17 additions and 1 deletions
9
assets/packaging/deb/micro.postinst
Executable file
9
assets/packaging/deb/micro.postinst
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
|
||||
update-alternatives --install /usr/bin/editor editor /usr/bin/micro 40 \
|
||||
--slave /usr/share/man/man1/editor.1 editor.1 \
|
||||
/usr/share/man/man1/micro.1
|
||||
fi
|
7
assets/packaging/deb/micro.prerm
Executable file
7
assets/packaging/deb/micro.prerm
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" != "upgrade" ]; then
|
||||
update-alternatives --remove editor /usr/bin/micro
|
||||
fi
|
|
@ -1 +1 @@
|
|||
fpm -s dir -t deb -p micro-$1-amd64.deb --name micro --license mit --version $1 --deb-recommends xclip --description "A modern and intuitive terminal-based text editor" ./micro=/usr/bin/micro ./assets/packaging/micro.1=/usr/share/man/man1/micro.1
|
||||
fpm -s dir -t deb -p micro-$1-amd64.deb --name micro --license mit --version $1 --deb-recommends xclip --description "A modern and intuitive terminal-based text editor" --after-install ./assets/packaging/deb/micro.postinst --before-remove ./assets/packaging/deb/micro.prerm ./micro=/usr/bin/micro ./assets/packaging/micro.1=/usr/share/man/man1/micro.1
|
||||
|
|
Loading…
Reference in a new issue