# -*- 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                macports.sqlext
version             2.6.3
categories          sysutils
maintainers         nomaintainer
license             BSD

description         MacPorts registry SQLite extension

long_description    macports.sqlext is an SQLite extension supporting \
                    the custom collations used in the MacPorts \
                    registry database.

homepage            https://www.macports.org/
master_sites        macports_distfiles
dist_subdir         MacPorts

distname            MacPorts-${version}
use_bzip2           yes
checksums           rmd160 c4009fc935603377867af1ab09ad34f980695ca4 \
                    sha256 c784f0556102bf7947b1cb8f4607bfa76351a4da8cbdab0dcc89c56f18834f01

depends_lib         port:sqlite3

patchfiles          configure.patch

configure.args      --with-sqlite3prefix=${prefix} \
                    --disable-flag-sanitization

build.dir           ${worksrcpath}/src/cregistry
build.target        macports.sqlext

destroot {
    xinstall -d ${destroot}${prefix}/lib/sqlite3
    xinstall ${build.dir}/macports.sqlext ${destroot}${prefix}/lib/sqlite3
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${build.dir}/README.sqlext ${destroot}${prefix}/share/doc/${name}
}

notes "To use ${name}, run this in the sqlite3 shell:
.load ${prefix}/lib/sqlite3/macports.sqlext"
