# Maintainer: Valeria Fadeeva <valeria@fadeeva.me>

pkgname='melawy-skel-liveuser'
pkgver=1.0
pkgrel=1
pkgdesc='Liveuser specific skel setup for Melawy Linux'
arch=('any')
url='https://github.com/Melawy'
license=('AGPL3')
source=(file:///disk/github/active/Melawy/Melawy-Dev/CORE/skel-liveuser_local/liveuser.tar.xz)
sha256sums=('SKIP')

install=ins.install

package() {

    # Clone file structure
    install -d "${pkgdir}/home/"
    cp -r --no-preserve=ownership "${srcdir}/liveuser" "${pkgdir}/home/"

    # Find all scripts
    readarray -d '' scripts < <(find "${pkgdir}/home/liveuser" -type f \( -iname "*.sh" -o -iname "*.bash" \) -print0)

    # Make scripts executable
    for script in "${scripts[@]}";
    do
        [[ -f ${script} ]] && chmod +x "${script}"
    done
}

