File insync-updater.spec of Package insync-updater
Name: insync-updater
Version: 3.9.4
Release: 0
Url: https://www.insynchq.com/
Summary: Correction set for Insync
Group: System/GUI/KDE
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
BuildRequires: hicolor-icon-theme
BuildRequires: -post-build-checks
License: MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package only helps to run Insync on openSUSE.
%build
%install
%post
if test -e "/opt/insync/insync-extra.tar.xz"; then
tar xf /opt/insync/insync-extra.tar.xz -C /
fi
rm -f "/etc/zypp/repos.d/insync.repo"
cat > "/etc/zypp/repos.d/insync.repo" << EOM
[insync]
name=insync
baseurl=https://yum.insync.io/fedora/39/
enabled=1
autorefresh=0
gpgcheck=0
keeppackages=0
type=rpm-md
EOM
rm -f "/usr/lib/systemd/user/insync.service"
cat > "/usr/lib/systemd/user/insync.service" << EOM
[Unit]
Description=Insync
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/insync start
RestartSec=3
[Install]
WantedBy=default.target
EOM
systemctl daemon-reload
systemctl --global enable insync.service
# Fix ca-certificates
if test ! -e /etc/ssl/certs/ca-certificates.crt ; then
mkdir -p /etc/ssl/certs/
ln -s /etc/ssl/ca-bundle.pem /etc/ssl/certs/ca-certificates.crt
ln -s /etc/ssl/ca-bundle.pem /etc/ssl/certs/ca-bundle.crt
fi
update-desktop-database
gtk-update-icon-cache
%preun
if [ "$1" = 0 ]; then
# Remove all files
rm -f "/etc/zypp/repos.d/insync.repo"
rm -f "/usr/lib/systemd/user/insync.service"
update-desktop-database
gtk-update-icon-cache
fi
%clean
%files
%changelog