# $Id: Portfile 88520 2012-01-04 01:30:11Z mww@macports.org $

PortSystem 1.0
replaced_by ocaml-findlib
PortGroup obsolete 1.0

name                caml-findlib
version             1.2.7
revision            1
categories          devel ml

pre-deactivate {
        # remove our stublibs dir path from ld.conf
        set ocamlfind_destdir [file normalize ${prefix}/lib/ocaml/site-lib/stublibs]
        set ldconfpath [exec ${prefix}/bin/ocamlfind printconf ldconf]
        set ldconfoutpath [file dirname $ldconfpath]/.[file tail $ldconfpath]~
        if {[file exists $ldconfpath]} then {
          set ldconf [open $ldconfpath r]
          set ldconfout [open $ldconfoutpath w]
          while {[gets $ldconf line] != -1} {
            if {![string equal $line $ocamlfind_destdir]} {
              puts $ldconfout $line
            }
          }
          close $ldconfout
          close $ldconf
          file rename -force $ldconfoutpath $ldconfpath
        }
}

