Rpm: don't use update-alternatives

Even if I set rpm as conflicting with TigerVNC, update-alternatives
breaks in post-install. That is because files like /usr/bin/vncserver
are left from TigerVNC, when post-install runs.

So, I chose to use /usr/bin/vncserver without update-alternatives.
This commit is contained in:
Dmitry Maksyoma 2021-02-22 21:21:21 +13:00
parent 9e7d57cc3c
commit 0d62f6b7aa

View File

@ -8,7 +8,7 @@ URL: https://github.com/kasmtech/KasmVNC
BuildRequires: rsync
Requires: xorg-x11-xauth, xorg-x11-xkb-utils, xkeyboard-config, xorg-x11-server-utils, openssl, perl
Conflicts: tigervnc-server
Conflicts: tigervnc-server, tigervnc-server-minimal
%description
@ -19,6 +19,12 @@ Lorem ipsum
%install
rm -rf $RPM_BUILD_ROOT
DESTDIR=$RPM_BUILD_ROOT make -f /src/debian/Makefile.to_fakebuild_tar_package install
cd $RPM_BUILD_ROOT/usr/bin && mv Xkasmvnc Xvnc && \
mv kasmvncserver vncserver && mv kasmvncconfig vncconfig && \
ln -s kasmvncpasswd vncpasswd
cd $RPM_BUILD_ROOT/usr/share/man/man1 && mv Xkasmvnc.1 Xvnc.1 && \
mv kasmvncserver.1 vncserver.1 && mv kasmvncconfig.1 vncconfig.1 && \
mv kasmvncpasswd.1 vncpasswd.1
%files
/usr/bin/*
@ -33,18 +39,6 @@ DESTDIR=$RPM_BUILD_ROOT make -f /src/debian/Makefile.to_fakebuild_tar_package in
- Initial release of the rpm package.
%post
bindir=/usr/bin
mandir=/usr/share/man
commands="kasmvncserver kasmvncpasswd kasmvncconfig Xkasmvnc"
for kasm_command in $commands; do
generic_command=`echo "$kasm_command" | sed -e 's/kasm//'`;
update-alternatives --install "$bindir/$generic_command" \
"$generic_command" "$bindir/$kasm_command" 90 \
--slave "$mandir/man1/$generic_command.1.gz" "$generic_command.1.gz" \
"$mandir/man1/$kasm_command.1.gz"
done
kasmvnc_group="kasmvnc"
create_kasmvnc_group() {
@ -69,13 +63,4 @@ DESTDIR=$RPM_BUILD_ROOT make -f /src/debian/Makefile.to_fakebuild_tar_package in
make_self_signed_certificate
%postun
bindir=/usr/bin
mandir=/usr/share/man
commands="kasmvncserver kasmvncpasswd kasmvncconfig Xkasmvnc"
for kasm_command in $commands; do
generic_command=`echo "$kasm_command" | sed -e 's/kasm//'`;
update-alternatives --remove "$generic_command" "$bindir/$kasm_command"
done
rm -f /etc/pki/tls/private/kasmvnc.pem