appid := env_var('APPID')
install-dir := env_var('INSTALL_DIR')

desktop-src := appid + '.desktop'
desktop-dst := install-dir / 'applications' / desktop-src

metainfo-src := appid + '.metainfo.xml'
metainfo-dst := install-dir / 'metainfo' / metainfo-src

default-schema-target := install-dir / 'cosmic' / appid

install:
    install -Dm0644 {{desktop-src}} {{desktop-dst}}
    install -Dm0644 {{metainfo-src}} {{metainfo-dst}}
    find v1 -type f -exec install -Dm0644 {} {{default-schema-target}}/{} \;
uninstall:
    rm {{desktop-dst}} {{metainfo-dst}}
