why does "make install" write to files outside of DESTDIR ?

Danilo G. Baio dbaio at FreeBSD.org
Mon Jul 30 00:55:04 UTC 2018


On Tue, Jun 19, 2018 at 06:12:32PM -0700, Eitan Adler wrote:
> On 13 June 2018 at 05:21, Eitan Adler <lists at eitanadler.com> wrote:
> > Steps to reproduce:
> >
> > rm -rf /srv/www/devbox/
> > mkdir /srv/www/devbox/
> > env DESTDIR=/srv/www/devbox/docs/docs make -s all install
> >
> > Expected behavior: no files are written to outside of /srv/www/devbox/docs/docs
> > Actual behavior: /srv/www/devbox/articles and /srv/www/devbox/books exist
> >
> > Why is this? Is there some way to avoid this?
> 
> anyone? This is particularly annoying when testing subsets of
> documentation. Is there any variable to set that will work similarly
> to MAKEOBJIRPREFIX from src?
> I'd like to run "make install" from a doc directory and have it
> install to the "expected" place so that browsing documentation from
> the webserver still works.


You should try DOCDIR instead of DESTDIR.
It will create all the structure, see this:

$ rm -rf /tmp/devbox
$ mkdir /tmp/devbox

$ env DESTDIR=/tmp/devbox/doc/doc make ENGLISH_ONLY=yes WEB_ONLY=yes all install

$ tree -d /tmp/devbox
/tmp/devbox
├── articles
│   ├── building-products
│   ├── gjournal-desktop
│   ├── releng
│   ├── vinum
│   └── vm-design
├── books
│   ├── design-44bsd
│   ├── dev-model
│   ├── developers-handbook
│   │   └── sockets
│   └── handbook
│       ├── advanced-networking
│       ├── basics
│       ├── bsdinstall
│       ├── geom
│       ├── mail
│       ├── security
│       └── virtualization
└── doc
    └── doc
        └── imagelib
            └── callouts

23 directories



$ rm -rf /tmp/devbox
$ mkdir /tmp/devbox

$ env DOCDIR=/tmp/devbox/doc/doc make ENGLISH_ONLY=yes WEB_ONLY=yes all install

$ tree -d /tmp/devbox
/tmp/devbox
└── doc
    └── doc
        ├── en -> en_US.ISO8859-1
        ├── en_US.ISO8859-1
        │   ├── articles
        │   │   ├── bsdl-gpl
        │   │   ├── building-products
        │   │   ├── committers-guide
        │   │   │   └── imagelib
        │   │   │       └── callouts
        │   │   ├── contributing
        │   │   ├── contributors
        │   │   ├── cups
        │   │   ├── explaining-bsd
        │   │   ├── filtering-bridges
        │   │   ├── fonts
        │   │   ├── freebsd-questions
        │   │   ├── freebsd-releng
        │   │   ├── freebsd-update-server
        │   │   │   └── imagelib
        │   │   │       └── callouts
        │   │   ├── geom-class
        │   │   ├── gjournal-desktop
        │   │   ├── hubs
        │   │   ├── ipsec-must
        │   │   ├── ldap-auth
        │   │   ├── leap-seconds
        │   │   ├── linux-emulation
        │   │   ├── linux-users
        │   │   ├── mailing-list-faq
        │   │   ├── nanobsd
        │   │   │   └── imagelib
        │   │   │       └── callouts
        │   │   ├── new-users
        │   │   ├── pam
        │   │   ├── pgpkeys
        │   │   ├── port-mentor-guidelines
        │   │   ├── pr-guidelines
        │   │   ├── problem-reports
        │   │   ├── rc-scripting
        │   │   │   └── imagelib
        │   │   │       └── callouts
        │   │   ├── releng
        │   │   ├── remote-install
        │   │   │   └── imagelib
        │   │   │       └── callouts
        │   │   ├── serial-uart
        │   │   ├── solid-state
        │   │   ├── vinum
        │   │   └── vm-design
        │   └── books
        │       ├── arch-handbook
        │       │   └── imagelib
        │       │       └── callouts
        │       ├── design-44bsd
        │       ├── dev-model
        │       ├── developers-handbook
        │       │   └── sockets
        │       ├── faq
        │       ├── fdp-primer
        │       │   └── imagelib
        │       │       └── callouts
        │       ├── handbook
        │       │   ├── advanced-networking
        │       │   ├── basics
        │       │   ├── bsdinstall
        │       │   ├── geom
        │       │   ├── imagelib
        │       │   │   └── callouts
        │       │   ├── mail
        │       │   ├── security
        │       │   └── virtualization
        │       ├── pmake
        │       └── porters-handbook
        │           └── imagelib
        │               └── callouts
        ├── faq -> en_US.ISO8859-1/books/faq
        └── handbook -> en_US.ISO8859-1/books/handbook

78 directories


Regards
-- 
Danilo G. Baio (dbaio)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-doc/attachments/20180729/f62f1ed2/attachment.sig>


More information about the freebsd-doc mailing list