diff --git a/package/webinterface-upload-button/package b/package/webinterface-upload-button/package new file mode 100644 index 000000000..8341150ca --- /dev/null +++ b/package/webinterface-upload-button/package @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Copyright (c) 2021 The Toltec Contributors +# SPDX-License-Identifier: MIT + +_pkgname='webinterface-upload-button' +pkgnames=("$_pkgname") +pkgdesc="A simple upload button for the web interface" +url="https://github.com/rM-self-serve/$_pkgname" +pkgver=1.0.1-1 +timestamp=2023-12-06T11:43:00Z +section="utils" +maintainer="rM-self-serve <122753594+rM-self-serve@users.noreply.github.com>" +license=MIT + +source=( + "$url"/archive/1c69d4fcaa1cb8e2cf4b022a190429dc39946498.zip +) +sha256sums=( + a388d1db49a3c35782600efbd94ee449c59f46c223f14c254cb74d9509255d96 +) + +package() { + install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir/$_pkgname" + + touch "$srcdir"/emptyfile + install -D -m 666 -t "$pkgdir"/usr/share/toltec/reenable.d/"$_pkgname" "$srcdir"/emptyfile +} + +configure() { + echo + echo "Applying webinterface-upload-button" + webinterface-upload-button apply -y > /dev/null + echo "Success" + echo +} + +_restore() { + echo + echo "Reverting webinterface-upload-button" + webinterface-upload-button revert -y > /dev/null + echo "Success" + echo +} + +preremove() { + _restore +} + +preupgrade() { + _restore +}