File davinci-resolve-updater.spec of Package davinci-resolve-updater
#
# spec file for package davinci-resolve-updater
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: davinci-resolve-updater
Version: 19.1.4
Release: 0
Url: https://www.blackmagicdesign.com/br/products/davinciresolve/
Summary: Keep DaVinci Resolve up to date
Group: System/GUI/KDE
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
BuildRequires: hicolor-icon-theme
BuildRequires: -post-build-checks
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150500
BuildRequires: apr-util-devel
%endif
Requires: wget
Requires: unzip
Requires: libapr1-0
Requires: libapr-util1-0
Requires: libpango-1_0-0
Requires: libjpeg62
Requires: libglib-2_0-0
Requires: libgmodule-2_0-0
Requires: libgio-2_0-0
Requires: libgobject-2_0-0
License: MIT
Source0: %{name}
Source1: get-download-url
Source2: %{name}.png
Source3: %{name}.desktop.txt
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This package helps to keep the DaVinci Resolve application always up to date.
%check
%prep
%build
%install
mkdir -p %{buildroot}/usr/share/%{name}/
mkdir -p %{buildroot}/usr/share/pixmaps/
install -Dm 755 %{SOURCE0} %{buildroot}/usr/share/%{name}/%{name}
install -Dm 755 %{SOURCE1} %{buildroot}/usr/share/%{name}/get-download-url
cp -f %{SOURCE3} %{buildroot}/usr/share/%{name}/%{name}.desktop
cp -f %{SOURCE2} %{buildroot}/usr/share/pixmaps/%{name}.png
%post
# Start update script
SKIP_PACKAGE_CHECK=1 /usr/share/%{name}/%{name} start
mkdir -p /opt/resolve/libs/_original_libraries
mv /opt/resolve/libs/{libgio*,libglib*,libgmodule*,libgobject*} /opt/resolve/libs/_original_libraries/
rm -f "/usr/share/applications/com.blackmagicdesign.resolve-Installer.desktop"
update-desktop-database
gtk-update-icon-cache
%preun
if [ "$1" = 0 ]; then
chmod 777 /usr/share/davinci-resolve-updater/DaVinci_Resolve_%{version}_Linux.run
/usr/share/davinci-resolve-updater/DaVinci_Resolve_%{version}_Linux.run --uninstall --noconfirm
# remove all files
rm -rf "/usr/share/davinci-resolve-updater"
rm -rf "/opt/resolve"
rm -f "/usr/loca/share/applications/com.blackmagicdesign.rawplayer.desktop"
rm -f "/usr/loca/share/applications/com.blackmagicdesign.rawspeedtest.desktop"
rm -f "/usr/loca/share/applications/com.blackmagicdesign.resolve-CaptureLogs.desktop"
rm -f "/usr/loca/share/applications/com.blackmagicdesign.resolve-Panels.desktop"
rm -f "/usr/loca/share/applications/com.blackmagicdesign.resolve.desktop"
rm -f "/etc/xdg/menus/applications-merged/com.blackmagicdesign.resolve.menu"
update-desktop-database
gtk-update-icon-cache
fi
%files
%defattr(-,root,root)
/usr/share/%{name}/%{name}
/usr/share/%{name}/get-download-url
/usr/share/%{name}/%{name}.desktop
/usr/share/pixmaps/%{name}.png
%changelog