Ticket #38834: Portfile.diff

File Portfile.diff, 4.8 KB (added by ajdudman, 11 years ago)
  • (a) ../Portfile.old vs. (b) /tmp/Portfile

    a b  
    33PortSystem 1.0
    44
    55name                    samba4
    6 version                 4.0.0tp5
    7 revision                1
     6version                 4.0.5
     7revision                0
     8maintainers             mww
    89categories              net
    910platforms               darwin
    10 maintainers             mww
    1111license                 GPL-3
    12 description             SMB/CIFS server and client, ALPHA release
     12description             SMB/CIFS server and client, beta-grade, stable release
    1313long_description        Samba is an software suite that provides seamless file \
    1414                        and print services to SMB/CIFS clients. \
    15                         This is an ALPHA release!
     15                        This is a BETA-grade, stable release!
     16notes                   "This is a BETA-grade, stable release!"
    1617
    1718homepage                http://www.samba.org/
    18 master_sites            http://download.samba.org/samba/ftp/samba4/ \
    19                         ftp://de.samba.org/samba.org/samba4/
     19master_sites            https://ftp.samba.org/pub/samba/stable/ \
     20                        ftp://de.samba.org/pub/samba/stable/
    2021distname                samba-${version}
    21 checksums           md5     dbc2e04455d67b01d2020808065b96df \
    22                     sha1    8897cc7a824a594b3543245cdbbceaea32e9e08d \
    23                     rmd160  1870f67aa851751e381a3b03dadfa1d0afa28a12
     22checksums               md5     58ec2fec08872b72f8fd526f2da20a9e \
     23                        sha1    6e6faeb5741bb96816936c0acc3f5522d630b0ee \
     24                        rmd160  294c96a14f978a0fda42f0fb6fdd5710547faacf
     25
     26conflicts               samba3 talloc tdb
     27
     28depends_build           port:docbook-xsl \
     29                        port:perl5 \
     30                        port:pkgconfig \
     31                        port:python27 \
     32                        port:libxslt
     33
     34depends_lib             port:db47 \
     35                        port:gnutls \
     36                        port:libiconv \
     37                        port:openldap \
     38                        port:popt \
     39                        port:readline \
     40                        port:sqlite3 \
     41                        port:zlib
     42
     43# The wafadmin patches came by running 'buildtools/update-waf.sh'.
     44patch.pre_args          -p1 -b -z .orig
     45patchfiles              patch-buildtools-wafadmin-Tools-python.py.diff \
     46                        patch-buildtools-wafadmin-Utils.py.diff \
     47                        patch-buildtools-wafsamba-wafsamba.py.diff \
     48                        patch-buildtools-wafsamba-wscript.diff \
     49                        patch-lib-ldb-tests-test-ldap.sh.diff \
     50                        patch-lib-testtools-testtools-tests-test_compat.py.diff \
     51                        patch-source4-scripting-bin-samba_backup.diff
    2452
    25 depends_lib             port:gnutls port:readline port:libiconv port:popt port:sqlite3 port:zlib port:gettext
     53post-patch {
     54        reinplace "s|JOBS=1|JOBS=${build.jobs}|" ${worksrcpath}/configure
     55}
    2656
    27 worksrcdir              samba-${version}/source
     57pre-configure {
     58        if {![catch {set vers [lindex [registry_active samba4] 0]}]} {
     59                ui_error "Linking conflicts may occur.  Please deactivate samba4 while building samba4."
     60                return -code error "conflict"
     61        }
     62        if {![variant_isset mitkrb5] && ![catch {set vers [lindex [registry_active kerberos5] 0]}]} {
     63                ui_error "Linking conflicts may occur.  Please deactivate kerberos5 while building samba4."
     64                return -code error "conflict"
     65        }
     66}
    2867
    29 configure.args          --with-fhs \
    30                         --mandir=${prefix}/share/man \
    31                         --with-libiconv=${prefix} --with-readline=${prefix} --with-sqlite3
     68# waf
     69configure.args          --enable-fhs \
     70                        --with-libiconv=${prefix} \
     71                        --destdir=${destroot}
    3272
    33 destroot.target-append  installman
    3473post-destroot {
    35         # add a postfix of '4' to all executables to avoid file conflicts
    36         foreach dir {bin sbin} {
    37                 foreach bin [glob -directory "${destroot}${prefix}/${dir}" -type f *] {
    38                         file rename "${bin}" "${bin}4"
     74        set change [list]
     75        set dlist [list]
     76        set bogus ${destroot}${prefix}/lib/libnss_wins
     77        if {[file isfile ${bogus}.so.2]} {
     78                file rename ${bogus}.so.2 ${bogus}.2.dylib
     79                file delete ${bogus}.so
     80                ln -s [file tail ${bogus}.2.dylib] ${bogus}.dylib
     81        }
     82        fs-traverse f ${destroot}${prefix}/lib {
     83                switch -exact -- "[file type $f][file extension $f]" {
     84                file.dylib -
     85                file.so {
     86                        set o [exec otool -D $f | sed "1d;s/.inst.dylib/.dylib/"]
     87                        set n [string range $f [string length ${destroot}] end]
     88                        lappend change "-change '$o' '$n'"
     89                        lappend dlist $f
     90                        system "install_name_tool -id '$n' '$f'"
     91                        }
    3992                }
    4093        }
    41         # ..and also to the manpages
    42         foreach dir [glob -directory "${destroot}${prefix}/share/man" "man\[138\]"] {
    43                 foreach man [glob -directory "${dir}" -type f *] {
    44                         file rename "${man}" [string range "${man}" 0 [expr [string last . "${man}"] - 1]]4[string range "${man}" [string last . "${man}"] [string length "${man}"]]
     94        foreach f [glob ${destroot}${prefix}/*bin/*] {
     95                if {[string equal [file type $f] "file"] && [file executable $f] &&
     96                    ![catch {exec /usr/bin/file $f | grep -qw Mach-O} res]} {
     97                        lappend dlist $f
    4598                }
    4699        }
     100        foreach f $dlist {
     101                exec xargs -J % install_name_tool % "$f" << [join ${change} "\n"]
     102        }
     103}
     104
     105variant mitkrb5 description "Build with MIT Kerberos 5" {
     106        depends_lib-append      kerberos5
     107        config.args-append      --with-system-mitkrb5
    47108}
    48109
    49110livecheck.type  regex
    50 livecheck.url   http://us4.samba.org/samba/ftp/samba4/?M=D
     111livecheck.url   [lindex ${master_sites} 0]
    51112livecheck.regex samba-(\[0-9a-z.\]+)\\.tar\\.gz
    52113