-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
162 lines (135 loc) · 5.13 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# -*- 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 muniversal 1.0
PortGroup legacysupport 1.1
name openldap
conflicts openldap-devel
set my_name openldap
version 2.6.8
revision 0
checksums rmd160 84ad02add29add7d1e33716731a9139fa982f09c \
sha256 48969323e94e3be3b03c6a132942dcba7ef8d545f2ad35401709019f696c3c4e \
size 6512544
categories databases
license openldap
maintainers {mascguy @mascguy} openmaintainer
description OpenLDAP Software
long_description OpenLDAP Software is an open source implementation \
of the Lightweight Directory Access Protocol.
homepage https://www.openldap.org/
master_sites https://www.openldap.org/software/download/OpenLDAP/openldap-release/
distname ${my_name}-${version}
dist_subdir ${my_name}
extract.suffix .tgz
# Needed for _posix_memalign
# See: https://trac.macports.org/ticket/46236
# See: https://trac.macports.org/ticket/47630
# Needed for clock_gettime
legacysupport.newest_darwin_requires_legacy \
16
# ../slap-config.h:182: error: redefinition of typedef ‘ConfigArgs’
compiler.c_standard 2011
depends_lib-append \
port:cyrus-sasl2 \
port:db48 \
port:libfetch \
path:lib/libssl.dylib:openssl \
path:bin/perl:perl5 \
port:tcp_wrappers \
path:lib/pkgconfig/icu-uc.pc:icu
# Needed for `gdate` on older macOS releases
depends_test-append \
path:libexec/coreutils/libstdbuf.so:coreutils
patchfiles-append patch-ltmain.diff
patchfiles-append patch-dynamic_lookup-11.diff
patchfiles-append patch-fix_implicit.diff
patchfiles-append patch-libressl.diff
# Use 'gdate', rather than 'date', for tests
patchfiles-append patch-tests-gdate.diff
configure.env-append \
LANG=C
configure.cppflags-append \
-I${prefix}/include/db48 \
-I${prefix}/include/openssl \
-DBIND_8_COMPAT
platform darwin {
configure.cppflags-append \
-DMDB_FDATASYNC=fsync
if {${os.major} <= 9} {
configure.cppflags-append \
-DMDB_DSYNC=O_SYNC
}
if {${os.major} >= 22} {
# The openldap build uses soelim from groff, and newer OS versions do
# not provide groff as part of the base OS install.
depends_build-append \
port:groff
}
}
configure.ldflags-append \
-L${prefix}/lib/db48
configure.args-append \
--enable-crypt \
--enable-ipv6 \
--enable-syncprov \
--enable-wrappers \
--localstatedir=${prefix}/var \
--mandir=${prefix}/share/man \
--with-cyrus-sasl \
--with-fetch \
--with-tls
startupitem.create yes
startupitem.name slapd
startupitem.init "PID=${prefix}/var/run/slapd.pid"
startupitem.start "${prefix}/libexec/slapd -u ldap -f ${prefix}/etc/openldap/slapd.conf"
startupitem.stop "\[ -r \${PID} \] && kill \$(cat \${PID})"
variant aci description {Enable per-object ACIs (experimental)} {
configure.args-append \
--enable-aci
}
variant overlays description {Enable all available overlays} {
configure.args-append \
--enable-overlays
}
variant backends description {Enable additional backends} {
configure.args-append \
--enable-asyncmeta \
--enable-ldap \
--enable-mdb \
--enable-meta \
--enable-null \
--enable-relay \
--enable-sock
}
pre-build {
set dirs {}
if {[variant_exists universal] && [variant_isset universal]} {
foreach arch ${universal_archs_to_use} {
lappend dirs ${worksrcpath}-${arch}
}
} else {
lappend dirs ${worksrcpath}
}
foreach dir ${dirs} {
system -W ${dir} "make depend"
}
}
add_users ldap group=ldap
destroot.keepdirs "${destroot}${prefix}/var/run/openldap-data"
post-destroot {
if {[geteuid] == 0} {
xinstall -d -g ldap -m 700 -o ldap \
"${destroot}${prefix}/var/run/openldap-data"
} else {
xinstall -d -m 700 \
"${destroot}${prefix}/var/run/openldap-data"
}
# Delete the duplicate .conf files (leaves .conf.default) so upgrades won't overwrite .conf files.
file delete -force ${destroot}${prefix}/etc/openldap/slapd.conf
file delete -force ${destroot}${prefix}/etc/openldap/ldap.conf
}
test.run yes
test.target check
livecheck.type regex
livecheck.url https://www.openldap.org/software/download/OpenLDAP/openldap-release/
livecheck.regex "${my_name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"