Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jan 2003 12:41:54 -0300
From:      Fernan Aguero <fernan@iib.unsam.edu.ar>
To:        "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>
Cc:        ports@FreeBSD.ORG
Subject:   Re: [newbie porter] how and where to copy extra files?
Message-ID:  <20030108154154.GA67440@iib.unsam.edu.ar>
In-Reply-To: <20030108021616.3aeb2ca6.corecode@corecode.ath.cx>
References:  <20030107203054.GD24749@iib.unsam.edu.ar> <20030108021616.3aeb2ca6.corecode@corecode.ath.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks Simon for your help.

Now I have a better Makefile, but still some problems:

My makefile now looks like this:

post-install:

.if !defined(NOPORTDOCS)
  ${MKDIR} ${DATADIR}
	${MKDIR} ${EXAMPLESDIR}
	${MKDIR} ${DOCSDIR}

.for doc in AUTHORS BUGS Changes DEPRECATED FAQ INSTALL LICENSE PLATFORMS README
	${INSTALL_MAN} ${WRKSRC}/${doc} ${DOCSDIR}
.endfor

	${INSTALL_DATA}   ${WRKSRC}/examples ${EXAMPLESDIR}
	${INSTALL_SCRIPT} ${WRKSRC}/scripts  ${DATADIR}
	${INSTALL_MAN}    ${WRKSRC}/models	${DATADIR}

.endif
							

However, 'examples', 'scripts' and 'models' are all
directories. Except for 'models' which just contains files,
both 'examples' and 'scripts' contain also subdirectories and
files. It seems that $INSTALL does not work recursively on
directories. I've looked at install(1) and the only mention
of directories is for the -d option, which to me appears as
a replacemente of mkdir.

So, to summarize I can do something like:

1. ${CP} -R ${WRKSRC}/examples ${EXAMPLESDIR}
I've tried it and it works fine, except that I don't know
what I'm missing from not using $INSTALL_* (seems that it sets
owner, modes, and privileges differently for data, scripts,
docs). This way I'm just keeping those that were set by the
maker of the tarball. 

or 

2. perhaps there is another invocation of $INSTALL that I'm
missing?

Please comment if you see other options.

Thanks again,

Fernan

+----[ Simon 'corecode' Schubert <corecode@corecode.ath.cx> (07.Jan.2003 22:16):
|
| Lately Fernan Aguero told:
| 
| > I have a tarball with some documentation, examples, models and
| > scripts that I like to have installed under $PREFIX/share
| > 
| > First of all how do I do this in the Makefile? I mean I can
| > just do 'cp work/package-name/documentation/* ${PREFIX}/share/doc'
| > but I've seen that ports Makefiles like to have more generic
| > ways of doing it ... perhaps there are some variables
| > already set that I can use ...
| 
| yes. see /usr/ports/Mk/bsd.port.mk:
| # INSTALL_PROGRAM - A command to install binary executables.
| # INSTALL_SCRIPT - A command to install executable scripts.
| # INSTALL_DATA  - A command to install sharable data.
| # INSTALL_MAN   - A command to install manpages (doesn't compress).
| 
| using these and ${MKDIR} should work fine (and set permissions
| correctly).
| 
| please don't access work/package-name; instead go with ${WRKSRC}
| 
| > Then the second issue is that of playing well with others
| > and avoid polluting $PREFIX/share. hier(7) says nothing
| > about /usr/local/share, but I've seen that 
| > i) there are package specific directories
| > 	-> I can create one for my port and dump everything there
| > ii) there are 'doc' and 'examples' dirs 
| > 	-> I can dump docs and examples there, but what about the
| > 	other extra stuff (scripts and models)?
| 
| # DOCSDIR               - Name of the directory to install the packages docs in
| # EXAMPLESDIR           - Name of the directory to install the packages examples in
| # DATADIR               - Name of the directory to install the packages shared data
| 
| these directories have to be ${MKDIR}'ed
| 
| so: your models and scripts go to ${DATADIR}, docs go to ${DOCSDIR} and
| examples go to ${EXAMPLESDIR}
| 
| cheers
|   simon
| 
| -- 
| /"\   http://corecode.ath.cx/#donate
| \ /
|  \     ASCII Ribbon Campaign
| / \  Against HTML Mail and News


|
+----]

-- 
F e r n a n   A g u e r o
http://genoma.unsam.edu.ar/~fernan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030108154154.GA67440>