Staging DOs & DON'Ts
Peter Pentchev
roam at ringlet.net
Thu Oct 31 15:46:50 UTC 2013
On Thu, Oct 31, 2013 at 10:30:03AM +0200, Kimmo Paasiala wrote:
> Could we have this as an example what not to in the Makefile. It is
> from the latest change to the Makefile of sysutils/kiconvtool.
>
>
> MAKE_ARGS= PREFIX="${STAGEDIR}${PREFIX}"
>
> This breaks stuff that edits scripts in place trying to replace paths
> that depend on the value of PREFIX.
The proper way to do this - and the way it's done on other OSs and other
packaging systems that have the staging directory feature - is to:
1. Pass ${STAGEDIR} as a separate build option to the actual build;
it's traditional to pass it as the DESTDIR option:
MAKE_ARGS+= DESTDIR="${STAGEDIR}"
2. Make sure that the actual build honors DESTDIR. Yes, this does mean
that in some cases you have to patch the upstream build system; please
do this, and please forward the patches to the upstream authors, so
that their piece of software builds properly everywhere and is that
much easier to package for everyone :)
Yes, this does involve a bit more work for the port maintainer in cases
when the upstream build system is not yet DESTDIR-aware. Yes, this is
actually a good thing, this is practically an omission of the upstream
authors that will be corrected sooner or later by somebody, either
the FreeBSD port maintainer or some other packager :)
G'luck,
Peter
--
Peter Pentchev roam at ringlet.net roam at FreeBSD.org p.penchev at storpool.com
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13
If you think this sentence is confusing, then change one pig.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20131031/dac0de00/attachment.sig>
More information about the freebsd-ports
mailing list