Index: debian/neon-flathub.sh =================================================================== --- /dev/null +++ debian/neon-flathub.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Every so often try to add flathub. +# Actually preseeding repos isn't working at this time, certainly not via +# flatpak itself, ostree may work but looked to behave equally broken (the +# problem seems mostly that bin/flatpak needs to properly fall into the preseed +# configs). +# The following code will repeat for as long as the remote is not in flatpak +# AND setting it up doesn't work (this includes internet access problems). + +while ! /usr/bin/flatpak remote-add --system --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo; do + echo 'Failed to add flathub. Trying again in a bit.' + sleep 1800 # 30 minutes +done Index: debian/plasma-discover-flatpak-backend.dirs =================================================================== --- /dev/null +++ debian/plasma-discover-flatpak-backend.dirs @@ -0,0 +1 @@ +usr/lib/neon_update/ Index: debian/plasma-discover-flatpak-backend.install =================================================================== --- debian/plasma-discover-flatpak-backend.install +++ debian/plasma-discover-flatpak-backend.install @@ -4,3 +4,5 @@ usr/share/icons/hicolor/scalable/apps/flatpak-discover.svgz usr/share/libdiscover/categories/flatpak-backend-categories.xml usr/share/metainfo/org.kde.discover.flatpak.appdata.xml + +debian/neon-flathub.sh usr/lib/neon_update/ Index: debian/plasma-discover-flatpak-backend.neon-flathub.service =================================================================== --- /dev/null +++ debian/plasma-discover-flatpak-backend.neon-flathub.service @@ -0,0 +1,15 @@ +[Unit] +Description=Automatically configures the flathub.org flatpak repository +After=network.target dbus.service NetworkManager-wait-online.service +Wants=network-online.target +ConditionPathExists=!/var/lib/neon/flathub-set-up + +[Service] +Type=oneshot +ExecStart=/usr/lib/neon_update/neon-flathub.sh +# Create our marker iff the previous command exited 0 +ExecStart=/bin/mkdir -p /var/lib/neon/ +ExecStart=/usr/bin/touch /var/lib/neon/flathub-set-up + +[Install] +WantedBy=network-online.target Index: debian/plasma-discover-flatpak-backend.postinst =================================================================== --- debian/plasma-discover-flatpak-backend.postinst +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -. /usr/share/debconf/confmodule - -# Add the flathub repo by default to give a better out of the box experience -# akin to what we offer with snap. flathub is the kinda defacto place to put -# your flatpaks, so having it enabled by default seems like a useful way to -# increase availablability of flatpaks. Ackd by discover maintainer and -# neon devs. -# https://phabricator.kde.org/T9731 -# -> Don't fail the postinst if this fails, it's not a strict requirement. -flatpak remote-add --system --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo || true - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 Index: debian/rules =================================================================== --- debian/rules +++ debian/rules @@ -1,5 +1,7 @@ #!/usr/bin/make -f +dh := --with systemd + include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) @@ -26,3 +28,14 @@ # FIXME: tests are broken at time override_dh_auto_test: : + +# Neon-specific: set up flathub repo by default +# https://phabricator.kde.org/T9731 +override_dh_systemd_enable: + dh_systemd_enable --name neon-flathub + +override_dh_systemd_start: + dh_systemd_start neon-flathub.service + +override_dh_installinit: + dh_installinit --noscripts --name neon-flathub