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

name                        directory-studio
version                     2.0.0.v20180908-M14
categories                  databases
platforms                   darwin
supported_archs             x86_64
license                     Apache-2
maintainers                 {@lhaeger} openmaintainer

description                 Apache Directory Studio - The Eclipse-based LDAP browser and directory client
long_description            Apache Directory Studio is a complete directory tooling platform intended to \
                            be used with any LDAP server however it is particularly designed for use with \
                            ApacheDS. It is an Eclipse RCP application, composed of several Eclipse (OSGi) \
                            plugins, that can be easily upgraded with additional ones. These plugins can \
                            even run within Eclipse itself.

homepage                    https://directory.apache.org/studio/

master_sites                https://www-eu.apache.org/dist/directory/studio/${version}/ \
                            https://www-us.apache.org/dist/directory/studio/${version}/

distname                    ApacheDirectoryStudio-${version}-macosx.cocoa.x86_64
extract.suffix              .dmg

checksums     		        rmd160  055ec155ae83cfd9edc1aa84c353fc4ff0207ebd \
                            sha256  845392529c86e52697c1edac1f0603261324ff2a649e697dbdf566ee5f5f8e5e \
                            size    147573082

extract                     {
                            file mkdir /tmp/${distname}
                            system "hdiutil attach ${distpath}/${distfiles} -private -nobrowse -mountpoint /tmp/${distname}"
                            }

java.version                1.8+
java.fallback               openjdk11

use_configure               no

build                       {}

destroot                    {
                            copy /tmp/${distname}/ApacheDirectoryStudio.app ${destroot}${applications_dir}
                            }

post-destroot               {
                            system "hdiutil detach /tmp/${distname}"
                            delete /tmp/${distname}
                            }

livecheck.type              regex
livecheck.url               ${homepage}/update/product/compositeContent.xml
livecheck.regex             "www.apache.org/dist/directory/studio/(\[0-9\.vM-\]+)/update/eclipse"