summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2019-07-16 09:19:47 +0100
committerSimon McVittie <smcv@debian.org>2019-07-16 09:19:47 +0100
commit268c9117c5ac045e6a3bb1f7b86405fa7b6226ca (patch)
tree5da7e75bebae511d0a760d3b45dd9a59a350d73d
parent2e60476e57b678905a72969d5d6b2fbb798b6e5f (diff)
parenta847ba9e5acdee42f387da0cda40f5f143c0738d (diff)
xdg-desktop-portal (1.4.2-2) unstable; urgency=medium
* Release to unstable * d/salsa-ci.yml: Request standard CI on salsa.debian.org * d/p/test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch: Skip tests when FUSE is non-functional, even if we are root * Standards-Version: 4.4.0 (no changes required) * Use debhelper-compat 12 - Remove redundant --libexecdir=/usr/libexec, which is the default at this compat level * d/p/Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch: Update icon validator to the one from Flatpak 1.4.2 * Mark autopkgtest as flaky due to #931726 [dgit import unpatched xdg-desktop-portal 1.4.2-2]
-rw-r--r--debian/changelog258
-rw-r--r--debian/control93
-rw-r--r--debian/copyright64
-rw-r--r--debian/gbp.conf7
-rw-r--r--debian/patches/Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch311
-rw-r--r--debian/patches/Revert-Stop-building-the-icon-validator.patch102
-rw-r--r--debian/patches/series4
-rw-r--r--debian/patches/test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch227
-rw-r--r--debian/patches/validate-icon-Add-a-define-for-bwrap.patch19
-rwxr-xr-xdebian/rules21
-rw-r--r--debian/salsa-ci.yml3
-rw-r--r--debian/source/format1
-rw-r--r--debian/tests/control5
-rwxr-xr-xdebian/tests/gnome-desktop-testing6
-rw-r--r--debian/upstream/metadata8
-rw-r--r--debian/watch2
-rw-r--r--debian/xdg-desktop-portal-dev.doc-base8
-rw-r--r--debian/xdg-desktop-portal-dev.install4
-rw-r--r--debian/xdg-desktop-portal-tests.install2
-rw-r--r--debian/xdg-desktop-portal.docs1
-rw-r--r--debian/xdg-desktop-portal.install7
21 files changed, 1153 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..3f3dfb4
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,258 @@
+xdg-desktop-portal (1.4.2-2) unstable; urgency=medium
+
+ * Release to unstable
+ * d/salsa-ci.yml: Request standard CI on salsa.debian.org
+ * d/p/test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch:
+ Skip tests when FUSE is non-functional, even if we are root
+ * Standards-Version: 4.4.0 (no changes required)
+ * Use debhelper-compat 12
+ - Remove redundant --libexecdir=/usr/libexec, which is the default
+ at this compat level
+ * d/p/Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch:
+ Update icon validator to the one from Flatpak 1.4.2
+ * Mark autopkgtest as flaky due to #931726
+
+ -- Simon McVittie <smcv@debian.org> Tue, 16 Jul 2019 09:19:47 +0100
+
+xdg-desktop-portal (1.4.2-1) experimental; urgency=medium
+
+ * New upstream release
+ * Disable pipewire (screencasting) until 0.2.6 is available in Debian
+ * Build-depend on libjson-glib-dev
+ * d/copyright: Update
+
+ -- Simon McVittie <smcv@debian.org> Mon, 10 Jun 2019 09:37:22 +0100
+
+xdg-desktop-portal (1.2.0-1) unstable; urgency=medium
+
+ [ Simon McVittie ]
+ * New upstream stable release
+ * d/watch: Only watch for stable releases
+ * d/p/Revert-Stop-building-the-icon-validator.patch,
+ d/p/validate-icon-Add-a-define-for-bwrap.patch,
+ d/p/Replace-the-icon-validator-with-the-one-from-Flatpak-git-.patch:
+ Build a copy of the icon validator from Flatpak git master.
+ We don't want to rely on a version of Flatpak that isn't
+ stable yet.
+ - d/p/notification-Handle-non-existing-directories.patch,
+ d/p/notification-bind-mount-etc-ld.so.cache-to-the-sandbox.patch:
+ Remove, no longer necessary
+ * d/upstream/metadata: Add DEP-12 metadata
+ * Release to unstable
+
+ [ Jeremy Bicha ]
+ * Don't enable remote desktop support on Ubuntu. See LP bug 1802533
+
+ -- Simon McVittie <smcv@debian.org> Sat, 26 Jan 2019 18:31:50 +0000
+
+xdg-desktop-portal (1.1.1-1) experimental; urgency=medium
+
+ * New upstream development release
+ - Drop patches, applied upstream
+ - Build-Depend on libgdk-pixbuf2.0-dev, for icon validation
+ - Package new xdg-desktop-portal-validate-icon executable
+ - Depend on bubblewrap, for sandboxed icon validation
+ * Enable Location portal (geoclue-2.0)
+ * Standards-Version: 4.3.0 (no changes required)
+ * d/control: Set Vcs-Git branch for experimental
+ * d/p/notification-Handle-non-existing-directories.patch,
+ d/p/notification-bind-mount-etc-ld.so.cache-to-the-sandbox.patch:
+ Make bwrap invocation more reliable, and in particular make it
+ work on purely 32-bit systems with no /lib64 (patches taken from
+ gnome-desktop, thanks to Iain Lane and Mart Raudsepp)
+
+ -- Simon McVittie <smcv@debian.org> Thu, 17 Jan 2019 09:57:59 +0000
+
+xdg-desktop-portal (1.1.0-1) experimental; urgency=medium
+
+ * New upstream development release
+ - d/copyright: Update
+ - d/control: Build-depend on fontconfig, for fontconfig cache
+ invalidation in Settings portal
+ - d/control: Build-depend on flatpak, for permission-store test
+ * Don't build with Location portal yet, because geoclue-2.0 is
+ currently too old
+ * Drop patch, applied upstream
+ * d/gbp.conf: Use debian/experimental branch
+ * d/patches: Skip another build-time test when FUSE is not supported
+ * d/patches: Don't show a critical warning when a document permissions
+ entry is removed
+ * Enable Pipewire support, for screencasting
+
+ -- Simon McVittie <smcv@debian.org> Mon, 19 Nov 2018 18:47:57 +0000
+
+xdg-desktop-portal (1.0.3-1) unstable; urgency=medium
+
+ * New upstream release
+ * d/p/desktop-portal-don-t-attempt-to-export-NULL-GDBusInterfac.patch:
+ Add patch from upstream to guard against NULL interface objects
+ (previously applied in Ubuntu, LP: #1691649)
+
+ -- Simon McVittie <smcv@debian.org> Sat, 13 Oct 2018 11:33:35 +0100
+
+xdg-desktop-portal (1.0.2-1) unstable; urgency=medium
+
+ * New upstream release
+ * d/p/network-monitor-Build-variants-for-GetStatus-correctly.patch:
+ Drop, superseded by upstream changes
+
+ -- Simon McVittie <smcv@debian.org> Mon, 10 Sep 2018 10:37:46 +0100
+
+xdg-desktop-portal (1.0.1-1) unstable; urgency=medium
+
+ * New upstream release
+ * d/p/network-monitor-Build-variants-for-GetStatus-correctly.patch:
+ Add patch to make NetworkMonitor.GetStatus() work as intended
+ * Standards-Version: 4.2.1 (no changes required)
+
+ -- Simon McVittie <smcv@debian.org> Fri, 31 Aug 2018 08:55:19 +0100
+
+xdg-desktop-portal (1.0-1) unstable; urgency=medium
+
+ * New upstream release
+ * Install upstream NEWS
+ * Standards-Version: 4.2.0 (no further changes)
+
+ -- Simon McVittie <smcv@debian.org> Thu, 23 Aug 2018 09:53:13 +0100
+
+xdg-desktop-portal (0.99-1) unstable; urgency=medium
+
+ * New upstream release
+ * Standards-Version: 4.1.5
+ * Install to /usr/libexec
+ * Build in a UTF-8 locale, to avoid FTBFS when gdbus-codegen reads
+ UTF-8
+
+ -- Simon McVittie <smcv@debian.org> Sat, 28 Jul 2018 12:28:48 +0100
+
+xdg-desktop-portal (0.11-2) unstable; urgency=medium
+
+ [ Jeremy Bicha ]
+ * Update package description to mention Snap
+ * Use github page as homepage
+
+ -- Simon McVittie <smcv@debian.org> Sun, 24 Jun 2018 22:02:48 +0100
+
+xdg-desktop-portal (0.11-1) unstable; urgency=medium
+
+ * New upstream release
+ - Drop patch, applied upstream
+ * Standards-Version: 4.1.4 (no changes)
+
+ -- Simon McVittie <smcv@debian.org> Wed, 25 Apr 2018 16:29:22 +0100
+
+xdg-desktop-portal (0.10-4) unstable; urgency=medium
+
+ * Merge from experimental, with autopkgtests included
+ * d/p/build-Run-install-test-data-hook-as-intended.patch:
+ Mark patch as applied upstream
+
+ -- Simon McVittie <smcv@debian.org> Fri, 16 Feb 2018 14:50:44 +0000
+
+xdg-desktop-portal (0.10-3) experimental; urgency=medium
+
+ * Reinstate xdg-desktop-portal-tests package and autopkgtests
+ * d/p/build-Run-install-test-data-hook-as-intended.patch:
+ Run the tests' install hook to set up enough symlinks that they
+ will pass
+ * Upload to experimental to wait for NEW processing
+
+ -- Simon McVittie <smcv@debian.org> Thu, 15 Feb 2018 00:30:01 +0000
+
+xdg-desktop-portal (0.10-2) unstable; urgency=medium
+
+ * Really remove xdg-desktop-portal-tests stanza from d/control
+
+ -- Simon McVittie <smcv@debian.org> Thu, 15 Feb 2018 00:01:42 +0000
+
+xdg-desktop-portal (0.10-1) unstable; urgency=medium
+
+ * New upstream release
+ * Add Breaks/Replaces for flatpak (<< 0.10.4-1~) since this package
+ has taken over the permission store and documents portal
+ * Disable Pipewire support for now (ITP: #874089)
+ * Add new build-dependencies for FUSE
+ * Install the permission store and documents portal
+ * d/copyright: Update
+ * Drop flatpak build-dependency, no longer needed
+ * Remove patches, applied upstream
+ * Depend on FUSE
+ * Build installed-tests, but don't install them for now to avoid the
+ NEW queue
+ * Use dh_missing --fail-missing instead of dh_install --fail-missing
+
+ -- Simon McVittie <smcv@debian.org> Wed, 14 Feb 2018 17:44:15 +0000
+
+xdg-desktop-portal (0.9-2) unstable; urgency=medium
+
+ * Standards-Version: 4.1.3 (no changes)
+ * Change Vcs-* to point to salsa.debian.org
+ * d/p/0.10/: Update to upstream git commit 0.9-9-g422ecf3 for various
+ bug fixes
+
+ -- Simon McVittie <smcv@debian.org> Thu, 18 Jan 2018 08:46:29 +0000
+
+xdg-desktop-portal (0.9-1) unstable; urgency=medium
+
+ * New upstream release
+ - Drop all patches, applied upstream
+
+ -- Simon McVittie <smcv@debian.org> Fri, 24 Nov 2017 10:38:16 +0000
+
+xdg-desktop-portal (0.8-3) unstable; urgency=medium
+
+ * Set Rules-Requires-Root to no
+ * Use https Format URL in d/copyright
+ * Standards-Version: 4.1.1 (no further changes)
+
+ -- Simon McVittie <smcv@debian.org> Sat, 11 Nov 2017 13:43:41 +0000
+
+xdg-desktop-portal (0.8-2) unstable; urgency=medium
+
+ * Mark patches as applied upstream for 0.9
+ * Upload to unstable
+
+ -- Simon McVittie <smcv@debian.org> Sat, 10 Jun 2017 10:12:20 +0100
+
+xdg-desktop-portal (0.8-1) experimental; urgency=medium
+
+ * New upstream release
+ * Add patches to make the development files completely
+ architecture-independent (Closes: #864451)
+ * Make xdg-desktop-portal-dev Architecture: all
+
+ -- Simon McVittie <smcv@debian.org> Fri, 09 Jun 2017 08:04:12 +0100
+
+xdg-desktop-portal (0.6-1) experimental; urgency=medium
+
+ * New upstream release
+ - Run as a systemd user service if dbus-user-session is installed
+ - Add email portal
+ * Move to debhelper compat level 10
+ * Omit unimplemented configure option --enable-installed-tests
+ * Do not explicitly disable quiet Automake output: dh now does this
+ by default
+ * Move API documentation from main package to -dev package
+ * Register API documentation with doc-base
+
+ -- Simon McVittie <smcv@debian.org> Mon, 03 Apr 2017 15:28:02 +0100
+
+xdg-desktop-portal (0.5-1) unstable; urgency=medium
+
+ * New upstream release
+
+ -- Simon McVittie <smcv@debian.org> Sat, 21 Jan 2017 16:28:36 +0000
+
+xdg-desktop-portal (0.4-1) unstable; urgency=medium
+
+ * New upstream release
+ - Drop cherry-picked patch for flatpak 0.6.10 container detection,
+ now included in the upstream release
+
+ -- Simon McVittie <smcv@debian.org> Mon, 05 Dec 2016 10:51:02 +0000
+
+xdg-desktop-portal (0.3-1) unstable; urgency=medium
+
+ * Initial release. (Closes: #831689)
+
+ -- Simon McVittie <smcv@debian.org> Wed, 21 Sep 2016 22:14:13 +0100
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..65f00d9
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,93 @@
+Source: xdg-desktop-portal
+Section: admin
+Priority: optional
+Maintainer: Utopia Maintenance Team <pkg-utopia-maintainers@lists.alioth.debian.org>
+Uploaders:
+ Simon McVittie <smcv@debian.org>,
+Build-Depends:
+ dbus,
+ debhelper-compat (= 12),
+ fuse <!nocheck>,
+ libgdk-pixbuf2.0-dev,
+ libgeoclue-2-dev (>= 2.5.2),
+ libflatpak-dev,
+ libfontconfig1-dev,
+ libfuse-dev,
+ libglib2.0-dev,
+ libjson-glib-dev,
+ xmlto,
+Rules-Requires-Root: no
+Standards-Version: 4.4.0
+Homepage: https://github.com/flatpak/xdg-desktop-portal
+Vcs-Git: https://salsa.debian.org/debian/xdg-desktop-portal.git
+Vcs-Browser: https://salsa.debian.org/debian/xdg-desktop-portal
+
+Package: xdg-desktop-portal
+Architecture: linux-any
+Multi-arch: foreign
+Depends:
+ bubblewrap,
+ default-dbus-session-bus | dbus-session-bus,
+ fuse,
+ ${misc:Depends},
+ ${shlibs:Depends},
+Breaks:
+ flatpak (<< 0.10.4-1~),
+Replaces:
+ flatpak (<< 0.10.4-1~),
+Description: desktop integration portal for Flatpak and Snap
+ xdg-desktop-portal provides a portal frontend service for Flatpak, Snap,
+ and possibly other desktop containment/sandboxing frameworks. This service
+ is made available to the sandboxed application, and provides mediated
+ D-Bus interfaces for file access, URI opening, printing and similar
+ desktop integration features.
+ .
+ The implementation of these interfaces is expected to require
+ user confirmation before responding to the sandboxed application's
+ requests. For example, when the sandboxed application ask to open a file,
+ the portal implementation will open an "Open" dialog outside the sandbox,
+ and will only make the selected file available to the sandboxed app if
+ that dialog is confirmed.
+ .
+ xdg-desktop-portal is designed to be desktop-agnostic, and uses a
+ desktop-environment-specific GUI backend such as xdg-desktop-portal-gtk
+ to provide its functionality.
+
+Package: xdg-desktop-portal-dev
+Architecture: all
+Multi-arch: foreign
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
+Breaks:
+ libflatpak-dev (<< 0.10.4-1~),
+ xdg-desktop-portal (<< 0.5-2~),
+Replaces:
+ libflatpak-dev (<< 0.10.4-1~),
+ xdg-desktop-portal (<< 0.5-2~),
+Description: desktop integration portal - development files
+ xdg-desktop-portal provides a portal frontend service for Flatpak, Snap,
+ and possibly other desktop containment/sandboxing frameworks. This service
+ is made available to the sandboxed application, and provides mediated
+ D-Bus interfaces for file access, URI opening, printing and similar
+ desktop integration features. See the xdg-desktop-portal package's
+ description for more details.
+ .
+ This package contains development files for backends such as
+ xdg-desktop-portal-gtk.
+
+Package: xdg-desktop-portal-tests
+Architecture: any
+Depends:
+ xdg-desktop-portal,
+ ${misc:Depends},
+ ${shlibs:Depends},
+Description: desktop integration portal - automated tests
+ xdg-desktop-portal provides a portal frontend service for Flatpak, Snap,
+ and possibly other desktop containment/sandboxing frameworks. This service
+ is made available to the sandboxed application, and provides mediated
+ D-Bus interfaces for file access, URI opening, printing and similar
+ desktop integration features. See the xdg-desktop-portal package's
+ description for more details.
+ .
+ This package contains automated tests.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..517c32d
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,64 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: xdg-desktop-portal
+Source: https://github.com/flatpak/xdg-desktop-portal/releases
+
+Files:
+ *
+Copyright:
+ © 2010 Codethink Limited
+ © 2013-2019 Red Hat, Inc
+ © 2016 Free Software Foundation, Inc.
+ © 2016 Piotr Drag
+ © 2016 Aviary.pl
+ © 2017 Jan Alexander Steffens
+ © 2018 Igalia S.L.
+License: LGPL-2+
+
+Files:
+ src/flatpak-instance.*
+Copyright:
+ © 2018 Red Hat, Inc
+License: LGPL-2.1+
+
+Files:
+ debian/*
+Copyright:
+ © 2016-2018 Simon McVittie
+ © 2016-2018 Collabora Ltd.
+License: LGPL-2+
+
+License: LGPL-2+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+ .
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Comment:
+ On Debian systems, the full text of the GNU Lesser General Public License
+ version 2.1 can be found in the file '/usr/share/common-licenses/LGPL-2.1'.
+
+License: LGPL-2.1+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ .
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Comment:
+ On Debian systems, the full text of the GNU Lesser General Public License
+ version 2.1 can be found in the file '/usr/share/common-licenses/LGPL-2.1'.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..f56457d
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,7 @@
+[DEFAULT]
+pristine-tar = True
+compression = xz
+debian-branch = debian/master
+upstream-branch = upstream/latest
+patch-numbers = False
+upstream-vcs-tag = %(version)s
diff --git a/debian/patches/Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch b/debian/patches/Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch
new file mode 100644
index 0000000..ea52a2f
--- /dev/null
+++ b/debian/patches/Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch
@@ -0,0 +1,311 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Fri, 25 Jan 2019 19:13:33 +0000
+Subject: Replace the icon validator with the one from Flatpak 1.4.2
+
+For now we still want to avoid relying on Flatpak, since that dependency
+would be quite circular.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ src/notification.c | 14 +---
+ src/validate-icon.c | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 2 files changed, 207 insertions(+), 19 deletions(-)
+
+diff --git a/src/notification.c b/src/notification.c
+index 1367114..2301380 100644
+--- a/src/notification.c
++++ b/src/notification.c
+@@ -401,7 +401,7 @@ validate_icon_more (GVariant *v)
+ int status;
+ g_autofree char *err = NULL;
+ g_autoptr(GError) error = NULL;
+- const char *icon_validator = LIBEXECDIR "/flatpak-validate-icon";
++ const char *icon_validator = LIBEXECDIR "/xdg-desktop-portal-validate-icon";
+ const char *args[6];
+
+ if (G_IS_THEMED_ICON (icon))
+@@ -417,12 +417,6 @@ validate_icon_more (GVariant *v)
+ return FALSE;
+ }
+
+- if (!g_file_test (icon_validator, G_FILE_TEST_EXISTS))
+- {
+- g_debug ("Icon validation: %s not found, accepting icon without further validation.", icon_validator);
+- return TRUE;
+- }
+-
+ bytes = g_bytes_icon_get_bytes (G_BYTES_ICON (icon));
+ fd = g_file_open_tmp ("iconXXXXXX", &name, &error);
+ if (fd == -1)
+@@ -455,14 +449,12 @@ validate_icon_more (GVariant *v)
+ if (!g_spawn_sync (NULL, (char **)args, NULL, 0, NULL, NULL, NULL, &err, &status, &error))
+ {
+ g_debug ("Icon validation: %s", error->message);
+-
+ return FALSE;
+ }
+
+- if (!g_spawn_check_exit_status (status, &error))
++ if (!g_spawn_check_exit_status (status, NULL))
+ {
+- g_debug ("Icon validation: %s", error->message);
+-
++ g_debug ("Icon validation: %s", err);
+ return FALSE;
+ }
+
+diff --git a/src/validate-icon.c b/src/validate-icon.c
+index 2bab74f..9e88507 100644
+--- a/src/validate-icon.c
++++ b/src/validate-icon.c
+@@ -1,9 +1,35 @@
++/*
++ * Copyright © 2018 Red Hat, Inc
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
++ *
++ * Authors:
++ * Matthias Clasen <mclasen@redhat.com>
++ */
++
+ #include <gdk-pixbuf/gdk-pixbuf.h>
++#include <glib/gstdio.h>
++#include <errno.h>
++#include <unistd.h>
+
+ static int
+-validate_icon (const char *filename)
++validate_icon (const char *arg_width,
++ const char *arg_height,
++ const char *filename)
+ {
+ GdkPixbufFormat *format;
++ int max_width, max_height;
+ int width, height;
+ const char *name;
+ const char *allowed_formats[] = { "png", "jpeg", "svg", NULL };
+@@ -11,7 +37,7 @@ validate_icon (const char *filename)
+ g_autoptr(GError) error = NULL;
+
+ format = gdk_pixbuf_get_file_info (filename, &width, &height);
+- if (format == NULL)
++ if (format == NULL)
+ {
+ g_printerr ("Format not recognized\n");
+ return 1;
+@@ -20,13 +46,35 @@ validate_icon (const char *filename)
+ name = gdk_pixbuf_format_get_name (format);
+ if (!g_strv_contains (allowed_formats, name))
+ {
+- g_printerr ("Format %s not allowed\n", name);
++ g_printerr ("Format %s not accepted\n", name);
+ return 1;
+ }
+
+- if (width > 256 || height > 256)
++ if (!g_str_equal (name, "svg"))
++ {
++ max_width = g_ascii_strtoll (arg_width, NULL, 10);
++ if (max_width < 16 || max_width > 4096)
++ {
++ g_printerr ("Bad width limit: %s\n", arg_width);
++ return 1;
++ }
++
++ max_height = g_ascii_strtoll (arg_height, NULL, 10);
++ if (max_height < 16 || max_height > 4096)
++ {
++ g_printerr ("Bad height limit: %s\n", arg_height);
++ return 1;
++ }
++ }
++ else
++ {
++ /* Sanity check for vector files */
++ max_height = max_width = 4096;
++ }
++
++ if (width > max_width || height > max_height)
+ {
+- g_printerr ("Image too large (%dx%d)\n", width, height);
++ g_printerr ("Image too large (%dx%d). Max. size %dx%d\n", width, height, max_width, max_height);
+ return 1;
+ }
+
+@@ -40,14 +88,162 @@ validate_icon (const char *filename)
+ return 0;
+ }
+
++G_GNUC_NULL_TERMINATED
++static void
++add_args (GPtrArray *argv_array, ...)
++{
++ va_list args;
++ const char *arg;
++
++ va_start (args, argv_array);
++ while ((arg = va_arg (args, const gchar *)))
++ g_ptr_array_add (argv_array, g_strdup (arg));
++ va_end (args);
++}
++
++const char *
++flatpak_get_bwrap (void)
++{
++ const char *e = g_getenv ("FLATPAK_BWRAP");
++
++ if (e != NULL)
++ return e;
++ return HELPER;
++}
++
++
++static gboolean
++path_is_usrmerged (const char *dir)
++{
++ /* does /dir point to /usr/dir? */
++ g_autofree char *target = NULL;
++ GStatBuf stat_buf_src, stat_buf_target;
++
++ if (g_stat (dir, &stat_buf_src) < 0)
++ return FALSE;
++
++ target = g_strdup_printf ("/usr/%s", dir);
++
++ if (g_stat (target, &stat_buf_target) < 0)
++ return FALSE;
++
++ return (stat_buf_src.st_dev == stat_buf_target.st_dev) &&
++ (stat_buf_src.st_ino == stat_buf_target.st_ino);
++}
++
++static int
++rerun_in_sandbox (const char *arg_width,
++ const char *arg_height,
++ const char *filename)
++{
++ const char * const usrmerged_dirs[] = { "bin", "lib64", "lib", "sbin" };
++ int i;
++ g_autoptr(GPtrArray) args = g_ptr_array_new_with_free_func (g_free);
++ char validate_icon[PATH_MAX + 1];
++ ssize_t symlink_size;
++
++ symlink_size = readlink ("/proc/self/exe", validate_icon, sizeof (validate_icon) - 1);
++ if (symlink_size < 0 || (size_t) symlink_size >= sizeof (validate_icon))
++ {
++ g_printerr ("Error: failed to read /proc/self/exe\n");
++ return 1;
++ }
++
++ validate_icon[symlink_size] = 0;
++
++ add_args (args,
++ flatpak_get_bwrap (),
++ "--unshare-ipc",
++ "--unshare-net",
++ "--unshare-pid",
++ "--ro-bind", "/usr", "/usr",
++ "--ro-bind", "/etc/ld.so.cache", "/etc/ld.so.cache",
++ "--ro-bind", validate_icon, validate_icon,
++ NULL);
++
++ /* These directories might be symlinks into /usr/... */
++ for (i = 0; i < G_N_ELEMENTS (usrmerged_dirs); i++)
++ {
++ g_autofree char *absolute_dir = g_strdup_printf ("/%s", usrmerged_dirs[i]);
++
++ if (!g_file_test (absolute_dir, G_FILE_TEST_EXISTS))
++ continue;
++
++ if (path_is_usrmerged (absolute_dir))
++ {
++ g_autofree char *symlink_target = g_strdup_printf ("/usr/%s", absolute_dir);
++
++ add_args (args,
++ "--symlink", symlink_target, absolute_dir,
++ NULL);
++ }
++ else
++ {
++ add_args (args,
++ "--ro-bind", absolute_dir, absolute_dir,
++ NULL);
++ }
++ }
++
++ add_args (args,
++ "--tmpfs", "/tmp",
++ "--proc", "/proc",
++ "--dev", "/dev",
++ "--chdir", "/",
++ "--setenv", "GIO_USE_VFS", "local",
++ "--unsetenv", "TMPDIR",
++ "--die-with-parent",
++ "--ro-bind", filename, filename,
++ NULL);
++
++ if (g_getenv ("G_MESSAGES_DEBUG"))
++ add_args (args, "--setenv", "G_MESSAGES_DEBUG", g_getenv ("G_MESSAGES_DEBUG"), NULL);
++ if (g_getenv ("G_MESSAGES_PREFIXED"))
++ add_args (args, "--setenv", "G_MESSAGES_PREFIXED", g_getenv ("G_MESSAGES_PREFIXED"), NULL);
++
++ add_args (args, validate_icon, arg_width, arg_height, filename, NULL);
++ g_ptr_array_add (args, NULL);
++
++ {
++ g_autofree char *cmdline = g_strjoinv (" ", (char **) args->pdata);
++ g_debug ("Icon validation: Spawning %s", cmdline);
++ }
++
++ execvpe (flatpak_get_bwrap (), (char **) args->pdata, NULL);
++ /* If we get here, then execvpe() failed. */
++ g_printerr ("Icon validation: execvpe %s: %s\n", flatpak_get_bwrap (), g_strerror (errno));
++ return 1;
++}
++
++static gboolean opt_sandbox;
++
++static GOptionEntry entries[] = {
++ { "sandbox", 0, 0, G_OPTION_ARG_NONE, &opt_sandbox, "Run in a sandbox", NULL },
++ { NULL }
++};
++
+ int
+ main (int argc, char *argv[])
+ {
+- if (argc != 2)
++ GOptionContext *context;
++ GError *error = NULL;
++
++ context = g_option_context_new ("WIDTH HEIGHT PATH");
++ g_option_context_add_main_entries (context, entries, NULL);
++ if (!g_option_context_parse (context, &argc, &argv, &error))
++ {
++ g_printerr ("Error: %s\n", error->message);
++ return 1;
++ }
++
++ if (argc != 4)
+ {
+- g_error ("Expect a single path");
++ g_printerr ("Usage: %s [OPTION…] WIDTH HEIGHT PATH\n", argv[0]);
+ return 1;
+ }
+
+- return validate_icon (argv[1]);
++ if (opt_sandbox)
++ return rerun_in_sandbox (argv[1], argv[2], argv[3]);
++ else
++ return validate_icon (argv[1], argv[2], argv[3]);
+ }
diff --git a/debian/patches/Revert-Stop-building-the-icon-validator.patch b/debian/patches/Revert-Stop-building-the-icon-validator.patch
new file mode 100644
index 0000000..81920f1
--- /dev/null
+++ b/debian/patches/Revert-Stop-building-the-icon-validator.patch
@@ -0,0 +1,102 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Fri, 25 Jan 2019 19:09:54 +0000
+Subject: Revert "Stop building the icon validator"
+
+This reverts commit 2fb498f92f8e1c41049dedf887690083fa12f6d1.
+---
+ configure.ac | 1 +
+ src/Makefile.am.inc | 5 +++++
+ src/validate-icon.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 59 insertions(+)
+ create mode 100644 src/validate-icon.c
+
+diff --git a/configure.ac b/configure.ac
+index 02808ab..a8a62b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -142,6 +142,7 @@ fi
+ GLIB_TESTS
+
+ PKG_CHECK_MODULES(FUSE, [fuse])
++PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0])
+
+ AC_CONFIG_FILES([
+ Makefile
+diff --git a/src/Makefile.am.inc b/src/Makefile.am.inc
+index da49bcf..a8242f1 100644
+--- a/src/Makefile.am.inc
++++ b/src/Makefile.am.inc
+@@ -1,5 +1,6 @@
+ libexec_PROGRAMS += \
+ xdg-desktop-portal \
++ xdg-desktop-portal-validate-icon \
+ $(NULL)
+
+ service_in_files += \
+@@ -200,3 +201,7 @@ xdg_desktop_portal_CPPFLAGS = \
+ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \
+ -DLOCALEDIR=\"$(localedir)\" \
+ $(NULL)
++
++xdg_desktop_portal_validate_icon_SOURCES = src/validate-icon.c
++xdg_desktop_portal_validate_icon_LDADD = $(GDK_PIXBUF_LIBS)
++xdg_desktop_portal_validate_icon_CFLAGS = $(GDK_PIXBUF_CFLAGS)
+diff --git a/src/validate-icon.c b/src/validate-icon.c
+new file mode 100644
+index 0000000..2bab74f
+--- /dev/null
++++ b/src/validate-icon.c
+@@ -0,0 +1,53 @@
++#include <gdk-pixbuf/gdk-pixbuf.h>
++
++static int
++validate_icon (const char *filename)
++{
++ GdkPixbufFormat *format;
++ int width, height;
++ const char *name;
++ const char *allowed_formats[] = { "png", "jpeg", "svg", NULL };
++ g_autoptr(GdkPixbuf) pixbuf = NULL;
++ g_autoptr(GError) error = NULL;
++
++ format = gdk_pixbuf_get_file_info (filename, &width, &height);
++ if (format == NULL)
++ {
++ g_printerr ("Format not recognized\n");
++ return 1;
++ }
++
++ name = gdk_pixbuf_format_get_name (format);
++ if (!g_strv_contains (allowed_formats, name))
++ {
++ g_printerr ("Format %s not allowed\n", name);
++ return 1;
++ }
++
++ if (width > 256 || height > 256)
++ {
++ g_printerr ("Image too large (%dx%d)\n", width, height);
++ return 1;
++ }
++
++ pixbuf = gdk_pixbuf_new_from_file (filename, &error);
++ if (pixbuf == NULL)
++ {
++ g_printerr ("Failed to load image: %s\n", error->message);
++ return 1;
++ }
++
++ return 0;
++}
++
++int
++main (int argc, char *argv[])
++{
++ if (argc != 2)
++ {
++ g_error ("Expect a single path");
++ return 1;
++ }
++
++ return validate_icon (argv[1]);
++}
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..fc6d5e3
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch
+Revert-Stop-building-the-icon-validator.patch
+validate-icon-Add-a-define-for-bwrap.patch
+Replace-the-icon-validator-with-the-one-from-Flatpak-1.4..patch
diff --git a/debian/patches/test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch b/debian/patches/test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch
new file mode 100644
index 0000000..ce7c115
--- /dev/null
+++ b/debian/patches/test-doc-portal-Check-for-FUSE-support-more-thoroughly.patch
@@ -0,0 +1,227 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Wed, 26 Jun 2019 09:29:47 +0100
+Subject: test-doc-portal: Check for FUSE support more thoroughly
+
+Some CI pipelines do the build as root, which means /dev/fuse is
+writable, but if we do not have appropriate permissions then we cannot
+actually mount FUSE filesystems.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ document-portal/document-portal-fuse.c | 3 +-
+ tests/Makefile.am.inc | 3 +-
+ tests/test-doc-portal.c | 101 ++++++++++++++++++++++++++-------
+ 3 files changed, 84 insertions(+), 23 deletions(-)
+
+diff --git a/document-portal/document-portal-fuse.c b/document-portal/document-portal-fuse.c
+index 2705402..f1935ec 100644
+--- a/document-portal/document-portal-fuse.c
++++ b/document-portal/document-portal-fuse.c
+@@ -2537,7 +2537,8 @@ xdp_fuse_init (GError **error)
+ main_ch = fuse_mount (path, &args);
+ if (main_ch == NULL)
+ {
+- g_set_error (error, XDG_DESKTOP_PORTAL_ERROR, XDG_DESKTOP_PORTAL_ERROR_FAILED, "Can't mount fuse fs");
++ g_set_error (error, XDG_DESKTOP_PORTAL_ERROR, XDG_DESKTOP_PORTAL_ERROR_FAILED,
++ "Can't mount fuse fs on %s: %s", path, g_strerror (errno));
+ return FALSE;
+ }
+
+diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc
+index fcc6a76..7418b69 100644
+--- a/tests/Makefile.am.inc
++++ b/tests/Makefile.am.inc
+@@ -13,10 +13,11 @@ testdb_LDADD = \
+ $(NULL)
+ testdb_SOURCES = tests/testdb.c $(DB_SOURCES)
+
+-test_doc_portal_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS)
++test_doc_portal_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(FUSE_CFLAGS)
+ test_doc_portal_LDADD = \
+ $(AM_LDADD) \
+ $(BASE_LIBS) \
++ $(FUSE_LIBS) \
+ $(NULL)
+ test_doc_portal_SOURCES = tests/test-doc-portal.c
+ nodist_test_doc_portal_SOURCES = document-portal/document-portal-dbus.c
+diff --git a/tests/test-doc-portal.c b/tests/test-doc-portal.c
+index 10b9b5d..fb199d3 100644
+--- a/tests/test-doc-portal.c
++++ b/tests/test-doc-portal.c
+@@ -11,6 +11,10 @@
+
+ #include <gio/gio.h>
+ #include <gio/gunixfdlist.h>
++#include <glib/gstdio.h>
++
++#define FUSE_USE_VERSION 26
++#include <fuse_lowlevel.h>
+
+ #include "document-portal/document-portal-dbus.h"
+
+@@ -22,7 +26,7 @@ GTestDBus *dbus;
+ GDBusConnection *session_bus;
+ XdpDbusDocuments *documents;
+ char *mountpoint;
+-static gboolean have_fuse;
++static gchar *cannot_use_fuse = NULL;
+
+ static gboolean
+ set_contents_trunc (const gchar *filename,
+@@ -352,9 +356,9 @@ test_create_doc (void)
+ const char *basename = "a-file";
+ GError *error = NULL;
+
+- if (!have_fuse)
++ if (cannot_use_fuse != NULL)
+ {
+- g_test_skip ("this test requires FUSE");
++ g_test_skip (cannot_use_fuse);
+ return;
+ }
+
+@@ -467,9 +471,9 @@ test_recursive_doc (void)
+ g_autofree char *path = NULL;
+ g_autofree char *app_path = NULL;
+
+- if (!have_fuse)
++ if (cannot_use_fuse != NULL)
+ {
+- g_test_skip ("this test requires FUSE");
++ g_test_skip (cannot_use_fuse);
+ return;
+ }
+
+@@ -509,9 +513,9 @@ test_create_docs (void)
+ const char *basenames[] = { "doc1", "doc2" };
+ int i;
+
+- if (!have_fuse)
++ if (cannot_use_fuse != NULL)
+ {
+- g_test_skip ("this test requires FUSE");
++ g_test_skip (cannot_use_fuse);
+ return;
+ }
+
+@@ -582,9 +586,9 @@ test_add_named (void)
+ GError *error = NULL;
+ gboolean res;
+
+- if (!have_fuse)
++ if (cannot_use_fuse != NULL)
+ {
+- g_test_skip ("this test requires FUSE");
++ g_test_skip (cannot_use_fuse);
+ return;
+ }
+
+@@ -696,23 +700,78 @@ test_add_named (void)
+ assert_doc_not_exist (id1, basename1, "com.test.App2");
+ }
+
++/*
++ * If we cannot use FUSE, set cannot_use_fuse and return %FALSE.
++ */
++static gboolean
++check_fuse (void)
++{
++ g_autofree gchar *fusermount = NULL;
++ g_autofree gchar *path = NULL;
++ char *argv[] = { "xdp-fuse-test" };
++ struct fuse_args args = FUSE_ARGS_INIT (G_N_ELEMENTS (argv), argv);
++ struct fuse_chan *chan = NULL;
++ g_autoptr(GError) error = NULL;
++
++ if (cannot_use_fuse != NULL)
++ return FALSE;
++
++ if (access ("/dev/fuse", W_OK) != 0)
++ {
++ cannot_use_fuse = g_strdup_printf ("access /dev/fuse: %s",
++ g_strerror (errno));
++ return FALSE;
++ }
++
++ fusermount = g_find_program_in_path ("fusermount");
++
++ if (fusermount == NULL)
++ {
++ cannot_use_fuse = g_strdup ("fusermount not found in PATH");
++ return FALSE;
++ }
++
++ if (!g_file_test (fusermount, G_FILE_TEST_IS_EXECUTABLE))
++ {
++ cannot_use_fuse = g_strdup_printf ("%s not executable", fusermount);
++ return FALSE;
++ }
++
++ path = g_dir_make_tmp ("xdp-test.XXXXXX", &error);
++ g_assert_no_error (error);
++
++ chan = fuse_mount (path, &args);
++
++ if (chan == NULL)
++ {
++ cannot_use_fuse = g_strdup_printf ("fuse_mount: %s",
++ g_strerror (errno));
++ return FALSE;
++ }
++
++ g_test_message ("Successfully set up test FUSE fs on %s", path);
++
++ fuse_unmount (path, chan);
++
++ if (g_rmdir (path) != 0)
++ g_error ("rmdir %s: %s", path, g_strerror (errno));
++
++ return TRUE;
++}
++
+ static void
+ global_setup (void)
+ {
+ gboolean inited;
+- g_autofree gchar *fusermount = NULL;
+ GError *error = NULL;
+ g_autofree gchar *services = NULL;
+ int fd;
+
+- fusermount = g_find_program_in_path ("fusermount");
+- /* cache result so subsequent tests can be marked as skipped */
+- have_fuse = (access ("/dev/fuse", W_OK) == 0 &&
+- fusermount != NULL &&
+- g_file_test (fusermount, G_FILE_TEST_IS_EXECUTABLE));
+-
+- if (!have_fuse)
+- return;
++ if (!check_fuse ())
++ {
++ g_assert_cmpstr (cannot_use_fuse, !=, NULL);
++ return;
++ }
+
+ g_mkdtemp (outdir);
+ g_print ("outdir: %s\n", outdir);
+@@ -805,7 +864,7 @@ global_teardown (void)
+ g_autoptr(GFile) outdir_file = g_file_new_for_path (outdir);
+ int res, i;
+
+- if (!have_fuse)
++ if (cannot_use_fuse != NULL)
+ return;
+
+ res = stat (by_app_dir, &buf);
+@@ -858,9 +917,9 @@ global_teardown (void)
+ static void
+ test_version (void)
+ {
+- if (!have_fuse)
++ if (cannot_use_fuse != NULL)
+ {
+- g_test_skip ("this test requires FUSE");
++ g_test_skip (cannot_use_fuse);
+ return;
+ }
+
diff --git a/debian/patches/validate-icon-Add-a-define-for-bwrap.patch b/debian/patches/validate-icon-Add-a-define-for-bwrap.patch
new file mode 100644
index 0000000..2bfcaae
--- /dev/null
+++ b/debian/patches/validate-icon-Add-a-define-for-bwrap.patch
@@ -0,0 +1,19 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Fri, 25 Jan 2019 20:35:42 +0000
+Subject: validate-icon: Add a #define for bwrap
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ src/Makefile.am.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am.inc b/src/Makefile.am.inc
+index a8242f1..d8a6657 100644
+--- a/src/Makefile.am.inc
++++ b/src/Makefile.am.inc
+@@ -204,4 +204,4 @@ xdg_desktop_portal_CPPFLAGS = \
+
+ xdg_desktop_portal_validate_icon_SOURCES = src/validate-icon.c
+ xdg_desktop_portal_validate_icon_LDADD = $(GDK_PIXBUF_LIBS)
+-xdg_desktop_portal_validate_icon_CFLAGS = $(GDK_PIXBUF_CFLAGS)
++xdg_desktop_portal_validate_icon_CFLAGS = $(GDK_PIXBUF_CFLAGS) -DHELPER=\"$(BWRAP)\"
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..32f8a31
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export LC_ALL=C.UTF-8
+
+include /usr/share/dpkg/default.mk
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ dh_auto_configure -- \
+ --enable-docbook-docs \
+ --enable-geoclue \
+ --enable-installed-tests \
+ --disable-pipewire \
+ $(NULL)
+
+override_dh_missing:
+ dh_missing --fail-missing
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644
index 0000000..0c22dc4
--- /dev/null
+++ b/debian/salsa-ci.yml
@@ -0,0 +1,3 @@
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..8094e12
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: gnome-desktop-testing
+Restrictions: flaky, isolation-machine
+Depends:
+ gnome-desktop-testing,
+ xdg-desktop-portal-tests,
diff --git a/debian/tests/gnome-desktop-testing b/debian/tests/gnome-desktop-testing
new file mode 100755
index 0000000..41323c2
--- /dev/null
+++ b/debian/tests/gnome-desktop-testing
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+exec 2>&1
+
+exec gnome-desktop-testing-runner xdg-desktop-portal
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000..7866f17
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,8 @@
+---
+Name: xdg-desktop-portal
+Repository: https://github.com/flatpak/xdg-desktop-portal
+Repository-Browse: https://github.com/flatpak/xdg-desktop-portal
+Bug-Database: https://github.com/flatpak/xdg-desktop-portal/issues
+Bug-Submit: https://github.com/flatpak/xdg-desktop-portal/issues/new
+...
+# vim:set ft=yaml:
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..4da3b26
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=4
+https://github.com/flatpak/@PACKAGE@/releases .*/@PACKAGE@-(\d+\.\d*[02468]\.[\-+\.:\~\da-zA-Z]*)@ARCHIVE_EXT@
diff --git a/debian/xdg-desktop-portal-dev.doc-base b/debian/xdg-desktop-portal-dev.doc-base
new file mode 100644
index 0000000..bcbb95b
--- /dev/null
+++ b/debian/xdg-desktop-portal-dev.doc-base
@@ -0,0 +1,8 @@
+Document: xdg-desktop-portal-dev
+Title: Portal API Reference
+Author: Matthias Clasen
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/xdg-desktop-portal/portal-docs.html
+Files: /usr/share/doc/xdg-desktop-portal/portal-docs.html /usr/share/doc/xdg-desktop-portal/docbook.css
diff --git a/debian/xdg-desktop-portal-dev.install b/debian/xdg-desktop-portal-dev.install
new file mode 100644
index 0000000..62e5ec5
--- /dev/null
+++ b/debian/xdg-desktop-portal-dev.install
@@ -0,0 +1,4 @@
+usr/share/dbus-1/interfaces
+usr/share/doc/xdg-desktop-portal/docbook.css
+usr/share/doc/xdg-desktop-portal/portal-docs.html
+usr/share/pkgconfig/xdg-desktop-portal.pc
diff --git a/debian/xdg-desktop-portal-tests.install b/debian/xdg-desktop-portal-tests.install
new file mode 100644
index 0000000..6d3b245
--- /dev/null
+++ b/debian/xdg-desktop-portal-tests.install
@@ -0,0 +1,2 @@
+usr/libexec/installed-tests/xdg-desktop-portal
+usr/share/installed-tests/xdg-desktop-portal
diff --git a/debian/xdg-desktop-portal.docs b/debian/xdg-desktop-portal.docs
new file mode 100644
index 0000000..edc0071
--- /dev/null
+++ b/debian/xdg-desktop-portal.docs
@@ -0,0 +1 @@
+NEWS
diff --git a/debian/xdg-desktop-portal.install b/debian/xdg-desktop-portal.install
new file mode 100644
index 0000000..3b574fd
--- /dev/null
+++ b/debian/xdg-desktop-portal.install
@@ -0,0 +1,7 @@
+usr/lib/systemd/user
+usr/libexec/xdg-desktop-portal
+usr/libexec/xdg-desktop-portal-validate-icon
+usr/libexec/xdg-document-portal
+usr/libexec/xdg-permission-store
+usr/share/dbus-1/services
+usr/share/locale/*/*/xdg-desktop-portal.mo