Ticket #23405: openldap.Portfile.trac23405_v1.diff

File openldap.Portfile.trac23405_v1.diff, 1.1 KB (added by cgilmour@…, 15 years ago)

Diff for adding "no_root" variant

  • Portfile

    old new  
    4848        configure.args-append --enable-aci
    4949}
    5050
     51variant no_root description {Install openldap as MacPorts install user.} {
     52        startupitem.create      no
     53}
     54
    5155pre-build {
    5256        system "cd ${workpath}/${worksrcdir} && \
    5357                        make depend"
     
    5559
    5660pre-destroot {
    5761        # should be in pre-deploy....
    58         addgroup ldap
    59         set gid [existsgroup ldap]
    60         adduser ldap gid=${gid}
     62        if { ! [variant_isset no_root] } {
     63                addgroup ldap
     64                set gid [existsgroup ldap]
     65                adduser ldap gid=${gid}
     66        }
    6167}
    6268
    6369post-destroot {
    64         xinstall -d -g ldap -m 700 -o ldap \
    65                 "${destroot}${prefix}/var/run/openldap-data"
     70        if { ! [variant_isset no_root] } {
     71                xinstall -d -g ldap -m 700 -o ldap \
     72                        "${destroot}${prefix}/var/run/openldap-data"
     73        }
    6674# Delete the duplicate .conf files (leaves .conf.default) so upgrades won't overwrite .conf files.
    6775        file delete -force ${destroot}${prefix}/etc/openldap/slapd.conf
    6876        file delete -force ${destroot}${prefix}/etc/openldap/ldap.conf