# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0

name                pushbroom
version             1.0.0
revision            1

categories          sysutils python
platforms           {darwin any}
supported_archs     noarch
license             MIT
maintainers         nomaintainer

description         Sweep your filesystem clear of clutter
long_description    ${name} is a command line utility that removes old files \
                    from given file paths. Old files can either be deleted \
                    or moved into another directory (such as a trash directory).

homepage            https://sr.ht/~gpanders/pushbroom

checksums           rmd160  c31601f66566cf6472289aaeea928cbee0f53931 \
                    sha256  ec1fa9542f1b3cb1157bc4dadca3cf61ce1a35f4d1b1aa69949083a4f627ae36 \
                    size    8224

python.default_version 314
python.pep517_backend poetry

patchfiles          patch-poetry-pyproject.toml.diff

post-destroot {
    set examples_dir ${prefix}/share/examples/${name}
    xinstall -d ${destroot}${examples_dir}
    xinstall -m 0644 ${worksrcpath}/pushbroom.conf ${destroot}${examples_dir}
    xinstall -m 0644 ${filespath}/${name}.plist ${destroot}${examples_dir}/${startupitem.plist}

    reinplace "s|@LABEL@|${startupitem.uniquename}|" ${destroot}${examples_dir}/${startupitem.plist}
    reinplace "s|@PREFIX@|${prefix}|" ${destroot}${examples_dir}/${startupitem.plist}
}

notes "
A sample configuration file is provided at ${prefix}/share/examples/${name}/pushbroom.conf.

A launchd plist file is provided to run ${name} periodically. To use it:

1. Copy ${prefix}/share/examples/${name}/${startupitem.plist} to ~/Library/LaunchAgents
2. Edit ${startupitem.plist} to change the StartInterval to the desired period (in seconds)
3. Run 'launchctl load ~/Library/LaunchAgents/${startupitem.plist}'
"
