Fix rpm upgrade
This commit is contained in:
parent
9372a7318b
commit
824f65baae
@ -81,8 +81,6 @@ if test -f 'libcoreclrtraceptprovider.so'; then
|
|||||||
rm 'libcoreclrtraceptprovider.so'
|
rm 'libcoreclrtraceptprovider.so'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
touch appsettings.json
|
|
||||||
chmod 666 appsettings.json
|
|
||||||
|
|
||||||
install -m 666 libation_glass.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/libation.svg
|
install -m 666 libation_glass.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/libation.svg
|
||||||
install -m 666 Libation.desktop %{buildroot}%{_datadir}/applications/Libation.desktop
|
install -m 666 Libation.desktop %{buildroot}%{_datadir}/applications/Libation.desktop
|
||||||
@ -94,26 +92,33 @@ install * %{buildroot}%{_libdir}/%{name}/
|
|||||||
|
|
||||||
%post
|
%post
|
||||||
|
|
||||||
|
if [ \$1 -eq 1 ] ; then
|
||||||
|
# Initial installation
|
||||||
|
touch %{_libdir}/%{name}/appsettings.json
|
||||||
|
chmod 666 %{_libdir}/%{name}/appsettings.json
|
||||||
|
|
||||||
ln -s %{_libdir}/%{name}/Libation %{_bindir}/libation
|
ln -s %{_libdir}/%{name}/Libation %{_bindir}/libation
|
||||||
ln -s %{_libdir}/%{name}/Hangover %{_bindir}/hangover
|
ln -s %{_libdir}/%{name}/Hangover %{_bindir}/hangover
|
||||||
ln -s %{_libdir}/%{name}/LibationCli %{_bindir}/libationcli
|
ln -s %{_libdir}/%{name}/LibationCli %{_bindir}/libationcli
|
||||||
|
|
||||||
gtk-update-icon-cache -f %{_datadir}/icons/hicolor/
|
gtk-update-icon-cache -f %{_datadir}/icons/hicolor/
|
||||||
|
|
||||||
%postun
|
if ! grep -q 'fs.inotify.max_user_instances=524288' /etc/sysctl.conf; then
|
||||||
|
echo fs.inotify.max_user_instances=524288 | tee -a /etc/sysctl.conf && sysctl -p
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
%postun
|
||||||
|
if [ \$1 -eq 0 ] ; then
|
||||||
|
# Uninstall
|
||||||
rm %{_bindir}/libation
|
rm %{_bindir}/libation
|
||||||
rm %{_bindir}/hangover
|
rm %{_bindir}/hangover
|
||||||
rm %{_bindir}/libationcli
|
rm %{_bindir}/libationcli
|
||||||
|
|
||||||
if ! grep -q 'fs.inotify.max_user_instances=524288' /etc/sysctl.conf; then
|
|
||||||
echo fs.inotify.max_user_instances=524288 | tee -a /etc/sysctl.conf && sysctl -p
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_datadir}/icons/hicolor/scalable/apps/libation.svg
|
%{_datadir}/icons/hicolor/scalable/apps/libation.svg
|
||||||
%{_datadir}/applications/Libation.desktop
|
%{_datadir}/applications/Libation.desktop" >> ~/rpmbuild/SPECS/libation.spec
|
||||||
%{_libdir}/%{name}/appsettings.json" >> ~/rpmbuild/SPECS/libation.spec
|
|
||||||
|
|
||||||
|
|
||||||
cd "$BIN_DIR"
|
cd "$BIN_DIR"
|
||||||
|
|||||||
@ -29,11 +29,11 @@ namespace LinuxConfigApp
|
|||||||
|
|
||||||
//only run the auto upgrader if the current app was installed from the
|
//only run the auto upgrader if the current app was installed from the
|
||||||
//.deb or .rpm package. Try to detect this by checking if the symlink exists.
|
//.deb or .rpm package. Try to detect this by checking if the symlink exists.
|
||||||
public bool CanUpgrade => Directory.Exists("/usr/lib/libation");
|
public bool CanUpgrade => File.Exists("/bin/libation");
|
||||||
public void InstallUpgrade(string upgradeBundle)
|
public void InstallUpgrade(string upgradeBundle)
|
||||||
{
|
{
|
||||||
if (File.Exists("/bin/yum"))
|
if (File.Exists("/bin/yum"))
|
||||||
RunAsRoot("yum", $"install '{upgradeBundle}'");
|
RunAsRoot("yum", $"install -y '{upgradeBundle}'");
|
||||||
else
|
else
|
||||||
RunAsRoot("apt", $"install '{upgradeBundle}'");
|
RunAsRoot("apt", $"install '{upgradeBundle}'");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user