From owner-freebsd-ports Wed May 19 14:34:10 1999 Delivered-To: freebsd-ports@freebsd.org Received: from octopus.originative (originat.demon.co.uk [158.152.220.9]) by hub.freebsd.org (Postfix) with ESMTP id 5F91615824 for ; Wed, 19 May 1999 14:34:01 -0700 (PDT) (envelope-from paul@originative.co.uk) Received: by octopus with Internet Mail Service (5.5.2232.9) id ; Wed, 19 May 1999 22:31:56 +0100 Message-ID: From: paul@originative.co.uk To: ports@FreeBSD.org Subject: Mozilla LDAP sdk and file reference counts Date: Wed, 19 May 1999 22:31:55 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I'm working on port of the Mozilla LDAP sdk and the installation step has raised a few issues. The Mozilla directory structure is a little bit involved. The root of the tree is ./mozilla and then under that sit a number of the components that make up the Mozilla product, such as the browser, the portability code (nsprpub) and the ldap code (in ./mozilla/directory). The build mechanism creates OS specific object directories local to the actual sources, for instance mozilla/directory/c-sdk/ldap/libraries/libldap/FreeBSD4.0_DBG.OBJ in the case of libldap, where the source files are held in the libldap directory. When you run the install step it uses the mozilla specific nsinstall program which creates a link farm rooted at ./mozilla/dist/FreeBSD4.0_DBG.OBJ where the links point into the object directories in the src tree. The directory layout under /mozilla/dist/FreeBSD4.0_DBG.OBJ can't really be changed since other software (such as the perldap) expect to be passed the root directory and find all the required bits (include files, libraries etc) in the right places underneath. So, probably the only way to install this is to put it somewhere like /usr/local/mozilla. I took a look at the mozilla browser port and that puts the common binaries in /usr/local/lib/mozilla/bin and the actual browser binary in /usr/local/bin. This makes sense but it's going to become a mess if we start to add other components of the mozilla project as ports. This leads to the real problem, reference counting of installed files. If we agree to put the mozilla installed files under /usr/local/mozilla (for instance) then each port will need to install its own copies of the shared components, i.e. nsinstall etc. When you install a second component it will also need to install those same components into the same place. That's OK, but when you uninstall one of these sub-ports how does it know whether to remove the binary that's shared. If it removes it then the other sub-port stops working. If nothing ever removes it then the uninstall mechanism will leave cruft around. My current solutions is to treat the ldap port as totally distinct from the mozilla port but that's not a good solution. We need a more complex installation tool that records what files are installed by the ports mechanism and which port did the installing. When a port tries to uninstall a file the ports mechanism should be able to remove it as *one* of the owners of that file and not actually remove the file until the last owner tries to remove it. If you've used installation tools under Windows you'll have seen this crop up a lot :-) The reference counting problem is something that needs thinking about and eventually solving but in the meantime I'd like to commit my port asap so what's the current thinking on where to install the mozilla components to? Paul Richards. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message