1 | # -*- 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 |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup legacysupport 1.1 |
---|
5 | |
---|
6 | name samba4 |
---|
7 | conflicts samba3 |
---|
8 | version 4.15.3 |
---|
9 | revision 0 |
---|
10 | checksums rmd160 0d4a2443d6e3f53268389e3504ef97765ac8b9be \ |
---|
11 | sha256 519399404391550345846768ea4dd0fe7fcb04e20c2b891b5eeb02e5554137db \ |
---|
12 | size 19272345 |
---|
13 | |
---|
14 | categories net |
---|
15 | platforms darwin |
---|
16 | maintainers nomaintainer |
---|
17 | license GPL-3 |
---|
18 | description SMB/CIFS server and client |
---|
19 | long_description Samba is an software suite that provides seamless file \ |
---|
20 | and print services to SMB/CIFS clients. |
---|
21 | |
---|
22 | homepage http://www.samba.org/ |
---|
23 | master_sites https://download.samba.org/pub/samba/stable |
---|
24 | distname samba-${version} |
---|
25 | |
---|
26 | depends_build port:pkgconfig |
---|
27 | depends_lib port:cctools \ |
---|
28 | port:gettext \ |
---|
29 | port:gnutls \ |
---|
30 | port:gpgme \ |
---|
31 | port:jansson \ |
---|
32 | port:libarchive \ |
---|
33 | port:libiconv \ |
---|
34 | path:lib/libldap.dylib:openldap \ |
---|
35 | port:p5.32-parse-yapp \ |
---|
36 | port:popt \ |
---|
37 | port:python39 \ |
---|
38 | port:readline \ |
---|
39 | port:zlib |
---|
40 | |
---|
41 | patch.pre_args -p1 |
---|
42 | |
---|
43 | # patch to disable building documentation on MacOS |
---|
44 | # this enables us to have a working samba4 port without docs, |
---|
45 | # rather than not having samba4 at all. Can be removed when |
---|
46 | # doc build issues are resolved. |
---|
47 | patchfiles-append patch-no-xsltproc.diff |
---|
48 | |
---|
49 | configure.perl ${prefix}/bin/perl5.32 |
---|
50 | configure.python ${prefix}/bin/python3.9 |
---|
51 | configure.env-append \ |
---|
52 | YAPP=${prefix}/bin/yapp-5.32 |
---|
53 | configure.cmd ${configure.python} ./buildtools/bin/waf configure |
---|
54 | configure.args -C \ |
---|
55 | --enable-fhs \ |
---|
56 | --mandir=${prefix}/share/man \ |
---|
57 | --with-libiconv=${prefix} \ |
---|
58 | --without-acl-support \ |
---|
59 | --without-ad-dc \ |
---|
60 | --disable-avahi \ |
---|
61 | --with-gpgme \ |
---|
62 | --disable-spotlight |
---|
63 | |
---|
64 | build.cmd ${configure.python} ./buildtools/bin/waf -v |
---|
65 | build.pre_args |
---|
66 | build.env-append DESTDIR=${destroot} |
---|
67 | |
---|
68 | destroot.cmd ${configure.python} ./buildtools/bin/waf -v |
---|
69 | destroot.env-append DESTDIR=${destroot} |
---|
70 | destroot.destdir |
---|
71 | |
---|
72 | # this will be used on Darwin, to correct the IDs of a binary's library dependencies |
---|
73 | # so that they will be found in the location where they are actually installed. |
---|
74 | options changelist |
---|
75 | changelist |
---|
76 | |
---|
77 | post-destroot { |
---|
78 | platform darwin { |
---|
79 | # install a file missed by the build system: |
---|
80 | xinstall -m 755 ${worksrcpath}/bin/shared/private/libdnsserver-common-samba4.dylib ${destroot}${prefix}/lib/samba |
---|
81 | |
---|
82 | # On Darwin the build system fails to set library install names AND uses absolute paths |
---|
83 | # into the build directory (-o ${build.dir}/path/to/libfoo.dylib). |
---|
84 | # We want to run without need for ${build.dir} so we need to fix the IDs and the "rpaths". |
---|
85 | proc canonical {lf} { |
---|
86 | set l [file normalize ${lf}] |
---|
87 | if {[file type ${l}] eq "link"} { |
---|
88 | set target [file readlink ${l}] |
---|
89 | if {[file pathtype ${target}] eq "relative"} { |
---|
90 | return [file normalize [file join [file dirname ${l}] ${target}]] |
---|
91 | } else { |
---|
92 | return [file normalize ${target}] |
---|
93 | } |
---|
94 | } else { |
---|
95 | return ${l} |
---|
96 | } |
---|
97 | } |
---|
98 | |
---|
99 | # First, find all .dylib files, record their current ID (in changelist) and correct it |
---|
100 | ui_msg "---> Fixing dylib IDs" |
---|
101 | array set libdone {} |
---|
102 | catch {exec -ignorestderr find ${destroot}${prefix} -regex {.*/lib[^.]*\.[0-9]\.dylib}} versioneddylibs err |
---|
103 | foreach lf ${versioneddylibs} { |
---|
104 | # we may get output from `find` that's not a file, so check |
---|
105 | if {[file exists ${lf}]} { |
---|
106 | set l [canonical ${lf}] |
---|
107 | if {[string first ${destroot} ${l}] < 0} { |
---|
108 | # shouldn't happen but better safe than sorry |
---|
109 | ui_warn "${lf} -> ${l} !" |
---|
110 | } else { |
---|
111 | # NB: the install name is based on the symlink, not the target! |
---|
112 | set id [exec otool -D ${lf} | tail -1] |
---|
113 | # the new install name == ID: the full path minus ${destroot}. |
---|
114 | set instname [string map [list ${destroot} ""] ${lf}] |
---|
115 | if {${instname} ne ${id}} { |
---|
116 | system "install_name_tool -id ${instname} ${l}" |
---|
117 | # the current ID must be changed to the new one in all files that depend on it: |
---|
118 | changelist-append -change ${id} ${instname} |
---|
119 | # annoyingly some libraries will still their intermediate library ID |
---|
120 | # and who knows if other binaries depend on those IDs |
---|
121 | # Just change both... |
---|
122 | if {[string last ".inst.dylib" ${id}] >= 0} { |
---|
123 | set id2 "[file rootname [file rootname ${id}]].dylib" |
---|
124 | } else { |
---|
125 | set id2 "[file rootname ${id}].inst.dylib" |
---|
126 | } |
---|
127 | changelist-append -change ${id2} ${instname} |
---|
128 | } |
---|
129 | # mark the actual file we just processed as "done". |
---|
130 | set libdone(${l}) yes |
---|
131 | } |
---|
132 | } |
---|
133 | } |
---|
134 | # idem for the unversioned libraries - by finding all and then ignoring those already processed. |
---|
135 | catch {exec -ignorestderr find ${destroot}${prefix} -name "*.dylib"} otherdylibs err |
---|
136 | foreach lf ${otherdylibs} { |
---|
137 | if {[file exists ${lf}]} { |
---|
138 | set l [canonical ${lf}] |
---|
139 | if {[string first ${destroot} ${l}] < 0} { |
---|
140 | # shouldn't happen but better safe than sorry |
---|
141 | ui_warn "${lf} -> ${l} !" |
---|
142 | } elseif {![info exists libdone(${l})]} { |
---|
143 | set id [exec otool -D ${lf} | tail -1] |
---|
144 | set instname [string map [list ${destroot} ""] ${lf}] |
---|
145 | if {${instname} ne ${id}} { |
---|
146 | system "install_name_tool -id ${instname} ${l}" |
---|
147 | changelist-append -change ${id} ${instname} |
---|
148 | if {[string last ".inst.dylib" ${id}] >= 0} { |
---|
149 | set id2 "[file rootname [file rootname ${id}]].dylib" |
---|
150 | } else { |
---|
151 | set id2 "[file rootname ${id}].inst.dylib" |
---|
152 | } |
---|
153 | changelist-append -change ${id2} ${instname} |
---|
154 | } |
---|
155 | } else { |
---|
156 | ui_debug "Library ${l} has already been fixed" |
---|
157 | } |
---|
158 | } |
---|
159 | } |
---|
160 | ui_debug "Changelist:" |
---|
161 | ui_debug "${changelist}" |
---|
162 | ui_msg "---> Updating all binaries with the new IDs" |
---|
163 | # reset libdone |
---|
164 | array unset libdone |
---|
165 | catch {exec -ignorestderr find ${destroot}${prefix} -name "*.dylib" -o -name "*.so"} alllibs err |
---|
166 | foreach lf ${alllibs} { |
---|
167 | if {[file exists ${lf}]} { |
---|
168 | set exe [canonical ${lf}] |
---|
169 | if {![info exists libdone(${exe})]} { |
---|
170 | system "install_name_tool ${changelist} ${exe}" |
---|
171 | set libdone(${exe}) yes |
---|
172 | } |
---|
173 | } |
---|
174 | } |
---|
175 | foreach exe [glob ${destroot}${prefix}/bin/*] { |
---|
176 | if {[file exists ${exe}]} { |
---|
177 | # catch because we could encounter scripts |
---|
178 | catch {system "install_name_tool ${changelist} ${exe}"} |
---|
179 | } |
---|
180 | } |
---|
181 | foreach exe [glob ${destroot}${prefix}/sbin/*] { |
---|
182 | if {[file exists ${exe}]} { |
---|
183 | # catch because we could encounter scripts |
---|
184 | catch {system "install_name_tool ${changelist} ${exe}"} |
---|
185 | } |
---|
186 | } |
---|
187 | foreach exe [glob ${destroot}${prefix}/libexec/samba/*] { |
---|
188 | if {[file exists ${exe}]} { |
---|
189 | # catch because we could encounter scripts |
---|
190 | catch {system "install_name_tool ${changelist} ${exe}"} |
---|
191 | } |
---|
192 | } |
---|
193 | # All done, "already"! |
---|
194 | } |
---|
195 | } |
---|
196 | |
---|
197 | livecheck.type regex |
---|
198 | livecheck.url http://us4.samba.org/samba/ftp/samba4/?M=D |
---|
199 | livecheck.regex samba-(\[0-9a-z.\]+)\\.tar\\.gz |
---|