Add support for snap packaging
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
This commit is contained in:
parent
d6d0094179
commit
cbc7d5b08b
2 changed files with 25 additions and 1 deletions
|
@ -42,7 +42,7 @@ apps:
|
||||||
parts:
|
parts:
|
||||||
ddclient:
|
ddclient:
|
||||||
plugin: autotools
|
plugin: autotools
|
||||||
source: https://github.com/ddclient/ddclient.git
|
source: .
|
||||||
autotools-configure-parameters:
|
autotools-configure-parameters:
|
||||||
- --prefix=/usr
|
- --prefix=/usr
|
||||||
- --sysconfdir=/etc/ddclient
|
- --sysconfdir=/etc/ddclient
|
||||||
|
|
24
ddclient-snap-wrapper
Executable file
24
ddclient-snap-wrapper
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# handle --help as special case
|
||||||
|
|
||||||
|
config_file="${SNAP_COMMON}/etc/ddclient/ddclient.conf"
|
||||||
|
|
||||||
|
print_help() {
|
||||||
|
echo -e "${SNAP_NAME} uses config file as way to configuration."
|
||||||
|
echo -e "Edit ${config_file} with desired configuration."
|
||||||
|
echo -e "Once config is ready, enable service with:"
|
||||||
|
echo -e "\t$ snap start --enable ${SNAP_NAME}.daemon"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "${1}" = "--help" ]; then
|
||||||
|
print_help
|
||||||
|
else
|
||||||
|
mkdir -p -m 700 /tmp/cache
|
||||||
|
"${SNAP}"/usr/bin/ddclient \
|
||||||
|
-file "${config_file}" \
|
||||||
|
-cache /tmp/cache/ddclient.cache \
|
||||||
|
-pid /tmp/ddclient.pid \
|
||||||
|
--foreground
|
||||||
|
${@}
|
||||||
|
fi
|
Loading…
Reference in a new issue