rpm pkgs: changed autostart path

Previously after installing the rpm GUI package, we created a symlink to
our .desktop file for all users, under /home/*/.config/autostart/

If the path didn't exist we created it, unfortunately as root, which
caused some problems with other applications like Gnome Tweaks.

Now a link is created under /etc/xdg/autostart/, which is what we use
with the debian packages.

Closes: #1068
This commit is contained in:
Gustavo Iñiguez Goia 2023-11-29 22:54:02 +01:00
parent 4f9b69961c
commit 86d3f54247
Failed to generate hash of commit

View file

@ -19,7 +19,7 @@ Vendor: OpenSnitch project
Packager: Gustavo Iñiguez Goya <gooffy1@gmail.com>
Url: https://github.com/evilsocket/opensnitch
Requires: python3, python3-pip, (netcfg or setup), (python3-pyinotify or python3-inotify), python3-qt5, python3-notify2
Recommends: (python3-slugify or python3-python-slugify), python3-protobuf >= 3.0, python3-grpcio >= 1.10.0
Recommends: (python3-slugify or python3-python-slugify), python3-protobuf >= 3.0, python3-grpcio >= 1.10.0, (qgnomeplatform-qt5 or QGnomePlatform-qt5)
# avoid to depend on a particular python version
%global __requires_exclude ^python\\(abi\\) = 3\\..$
@ -42,26 +42,17 @@ These rules can last forever, until the app restart or just one time.
%post
if [ $1 -ge 1 ]; then
for i in $(ls /home)
do
if grep /home/$i /etc/passwd &>/dev/null; then
path=/home/$i/.config/autostart/
if [ ! -d $path ]; then
mkdir -p $path
deskfile=/etc/xdg/autostart/opensnitch_ui.desktop
if [ -d /etc/xdg/autostart -a ! -h $deskfile -a ! -f $deskfile ]; then
ln -s /usr/share/applications/opensnitch_ui.desktop /etc/xdg/autostart/
fi
if [ -f /usr/share/applications/%{desktop_file} ];then
ln -s /usr/share/applications/%{desktop_file} $path 2>/dev/null || true
else
echo "No desktop file: %{desktop_file}"
fi
fi
done
gtk-update-icon-cache /usr/share/icons/hicolor/ || true
fi
%postun
if [ $1 -eq 0 ]; then
# deprecated: kept for uninstalling old (<= v1.6.4) autostart files
for i in $(ls /home)
do
if grep /home/$i /etc/passwd &>/dev/null; then
@ -74,6 +65,11 @@ if [ $1 -eq 0 ]; then
fi
done
deskfile=/etc/xdg/autostart/opensnitch_ui.desktop
if [ -h $deskfile -o -f $deskfile ]; then
rm -f $deskfile
fi
pkill -15 opensnitch-ui 2>/dev/null || true
fi