Re: Port install issue with versioned directory

"Mark Duling" <[email protected]> Thu, 24 Aug 2006 10:01:17 -0700
Newsgroups gmane.os.opendarwin.darwinports
Message-ID <[email protected]>
Ryan Wilcox <[email protected]> writes:
>I'm writing a portfile (for javascriptlint), and I get the following
>error testing my port install phase...
>
>DEBUG: Executing com.apple.install (javascript-lint)
>DEBUG: installing file:
>/opt/local/var/db/dports/software/javascript-lint/0.2.6_0/jsl
>Error: Target com.apple.install returned: error copying
>"/opt/local/var/db/dports/build/_Users_aias_Development_zOSS_Projects_darwinports_dports_lang_jsl/work/destroot/jsl"
>to "/opt/local/var/db/dports/software/javascript-lint/0.2.6_0/jsl": no
>such file or directory
>
>
>Looking in /opt/local/var/db/dports/software/ I see all the software I've
>installed through DP, but I don't see a folder for javascript-lint.
>
>Because javascriptlint's makefile doesn't have an install target, I have
>to do it manually, with (I think):
>
>destroot { 
>	file copy ${worksrcpath}/src/Darwin_DBG.OBJ/jsl ${destroot}
>}
>
>If someone could point me in the right direction on this, that would be
>great. A CC would be even better, 'cause I'm on the digest.

You will want to use ${prefix} also, else your files will get written to
/.  But a 'file copy' won't create directories.  So in your destroot
phase, you'll want something like:

xinstall -m 755 -d ${destroot}${prefix}/jsl
file copy ${worksrcpath}/src/.....  ${destroot}${prefix}/jsl

If you are wanting to copy directories, I can't recall if file copy copies
recursively or not.  If it does then creating the directory before the
copy is all you need.  If not, then another command can be used.  That is
something that seriously needs to be addressed in our new docs.  What are
the preferred commands, since there are several ways of doing copies.  I
think xinstall is preferred when it works but it does not do recursive
copies so it can't be used in many circumstances.  But if you get things
written to destroot properly (you can check by doing 'port destroot
myport' and checking what gets written) the rest will work fine also.

Mark