# -*- 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

name                apgdiff
version             2.4
categories          databases
platforms           any
maintainers         gmail.com:eerien openmaintainer
license             MIT
supported_archs     noarch

description         PostgreSQL diff tool that is useful for comparison/diffing of database schemas.

long_description    Another PostgreSQL Diff Tool (also known as apgdiff) is \
                    free PostgreSQL diff tool that is useful for comparison/diffing \
                    of database schemas. The tool compares two database dump \
                    files and creates output with DDL statements that can be used \
                    to update old database schema to new one or to see in what \
                    exactly both databases differ. It is already being used by many \
                    developers all over the world.

homepage            https://apgdiff.com/
master_sites        ${homepage}download/
use_zip             yes
distfiles           ${distname}-bin${extract.suffix}

checksums           rmd160  29d3ede1e3daff4c60780757411b682525d18d8f \
                    sha256  12d95fbb0b8188d7f90e7aaf8bdd29d0eecac26e08d6323624b5b7e3f7c7a3f7

use_configure       no

build {}

destroot {
    xinstall -d ${destroot}${prefix}/share/java/${name}
    xinstall ${worksrcpath}/apgdiff-${version}.jar \
        ${destroot}${prefix}/share/java/apgdiff-${version}.jar
    xinstall -m 755 ${filespath}/apgdiff.in ${destroot}${prefix}/bin/apgdiff
    reinplace "s|@APGDIFF_JAR_PATH@|${prefix}/share/java/apgdiff-${version}.jar|g" \
        ${destroot}${prefix}/bin/apgdiff
}

livecheck.type      regex
livecheck.url       ${homepage}download.php
livecheck.regex     ${name}-(\[0-9.\]+)-bin${extract.suffix}
