summaryrefslogtreecommitdiffstats
path: root/snap
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-07-02 04:33:45 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-07-02 04:33:45 -0400
commit195c45911e79c33cf0bb986721365fb06df5a153 (patch)
treeac0c9b6ef40bea7aa7ab0c5c3cb500eb510668fa /snap
Import Upstream version 1.8.7upstream/1.8.7
Diffstat (limited to 'snap')
-rwxr-xr-xsnap/local/launchers/gallery-dl-launch32
-rw-r--r--snap/snapcraft.yaml110
2 files changed, 142 insertions, 0 deletions
diff --git a/snap/local/launchers/gallery-dl-launch b/snap/local/launchers/gallery-dl-launch
new file mode 100755
index 0000000..908f303
--- /dev/null
+++ b/snap/local/launchers/gallery-dl-launch
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# This is the maintainence launcher for the snap, make necessary runtime environment changes to make the snap work here. You may also insert security confinement/deprecation/obsoletion notice of the snap here.
+
+set \
+ -o errexit \
+ -o errtrace \
+ -o nounset \
+ -o pipefail
+
+# Use user's real home directory for canonical configuration path access
+declare REALHOME="$(
+ getent passwd "${USER}" \
+ | cut --delimiter=: --fields=6
+)"
+HOME="${REALHOME}"
+
+if ! test -f "${SNAP_USER_COMMON}"/marker_disable_interface_warning; then
+ # Warn if the `removable-media` interface isn't connected
+ if ! ls /media &>/dev/null; then
+ printf -- \
+ "It seems that this snap isn't connected to the \`removable-media\` security confinement interface. If you want to save the files under \`/media\`, \`/run/media\`, or \`/mnt\` directories you need to connect this snap to the \`removable-media\` interface by running the following command in a terminal:\\n\\n sudo snap connect %s:removable-media\\n\\n" \
+ "${SNAP_NAME}" \
+ >&2
+ printf -- \
+ "To disable this warning create an empty file at the following path:\\n\\n %s/marker_disable_interface_warning\\n\\n" \
+ "${SNAP_USER_COMMON}" \
+ >&2
+ fi
+fi
+
+# Finally run the next part of the command chain
+exec "${@}"
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
new file mode 100644
index 0000000..f8e26fa
--- /dev/null
+++ b/snap/snapcraft.yaml
@@ -0,0 +1,110 @@
+%YAML 1.1
+---
+# Snapcraft Recipe for gallery-dl
+# ------------------------------
+# This file is in the YAML data serialization format:
+# http://yaml.org
+# For the spec. of writing this file refer the following documentation:
+# * The snapcraft format
+# https://docs.snapcraft.io/the-snapcraft-format/8337
+# * Snap Documentation
+# https://docs.snapcraft.io
+# * Topics under the doc category in the Snapcraft Forum
+# https://forum.snapcraft.io/c/doc
+# For support refer to the snapcraft section in the Snapcraft Forum:
+# https://forum.snapcraft.io/c/snapcraft
+name: gallery-dl
+license: GPL-2.0
+base: core
+summary: Download image-galleries and -collections from several image hosting sites
+description: |
+ `gallery-dl` is a command-line program to download image-galleries and -collections from several image hosting sites (see [Supported Sites][1]). It is a cross-platform tool with many configuration options and powerful filenaming capabilities.
+
+ [1]: https://github.com/mikf/gallery-dl/blob/master/docs/supportedsites.rst
+
+adopt-info: gallery-dl
+confinement: strict
+grade: stable
+
+plugs:
+ # For `xdg-open` command access for opening OAuth authentication webpages
+ desktop:
+
+ # Storage access
+ home:
+ removable-media: # Non-A/C
+
+ # Network access
+ network:
+
+ # For network service for recieving OAuth callback tokens
+ network-bind:
+
+ # Configuration access
+ config-gallery-dl:
+ interface: personal-files
+ read:
+ - $HOME/.config/gallery-dl
+ - $HOME/.gallery-dl.conf
+ etc-gallery-dl:
+ interface: system-files
+ read:
+ - /etc/gallery-dl.conf
+
+parts:
+ # Launcher programs to fix problems at runtime
+ launchers:
+ source: snap/local/launchers
+ plugin: dump
+ organize:
+ '*': bin/
+
+ # Check out the tagged release revision if it isn’t promoted to the stable channel
+ # https://forum.snapcraft.io/t/selective-checkout-check-out-the-tagged-release-revision-if-it-isnt-promoted-to-the-stable-channel/10617
+ selective-checkout:
+ plugin: nil
+ build-packages:
+ - git
+ stage-snaps:
+ - selective-checkout
+ prime:
+ - -*
+
+ gallery-dl:
+ after:
+ - selective-checkout
+
+ source: .
+ override-pull: |
+ snapcraftctl pull
+ $SNAPCRAFT_STAGE/scriptlets/selective-checkout
+
+ plugin: python
+ build-packages:
+ - make
+ python-packages:
+ - youtube_dl
+ override-build: |
+ # build manpages and bash completion
+ make man completion
+
+ snapcraftctl build
+
+ ffmpeg:
+ plugin: nil
+ stage-packages:
+ - ffmpeg
+
+apps:
+ gallery-dl:
+ adapter: full
+ command-chain:
+ - bin/gallery-dl-launch
+ command: bin/gallery-dl
+ completer: etc/bash_completion.d/gallery-dl.bash_completion
+ environment:
+ LANG: C.UTF-8
+ LC_ALL: C.UTF-8
+
+ # Satisfy FFmpeg's libpulsecommon dependency
+ LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio