Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use DESTDIR in Makefile for debian #424

Closed
joshrabinowitz opened this issue Mar 15, 2019 · 4 comments
Closed

use DESTDIR in Makefile for debian #424

joshrabinowitz opened this issue Mar 15, 2019 · 4 comments

Comments

@joshrabinowitz
Copy link
Collaborator

joshrabinowitz commented Mar 15, 2019

This is part of #386

The TL;DR:

We should probably be installing into $DESTDIR/$PREFIX

Details:

According to the Debian Upstream Guide https://wiki.debian.org/UpstreamGuide we should be using DESTDIR (they don't mention PREFIX)

Installation
Please honor the DESTDIR environment variable or make variable and use its contents as a prefix in front of all installation paths. ...

Gnu coding standards agree at https://www.gnu.org/prep/standards/html_node/DESTDIR.html

DESTDIR is a variable prepended to each installed target file, like this:

$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a

The DESTDIR variable is specified by the user on the make command line as an absolute file
name. For example:

make DESTDIR=/tmp/stage install

FreeBSD docs at https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-prefix.html give even more details:

PREFIX determines where the port will be installed. It defaults to /usr/local, but can be set by the user to a custom path like /opt. The port must respect the value of this variable.

DESTDIR, if set by the user, determines the complete alternative environment, usually a jail or an installed system mounted somewhere other than /.

@joshrabinowitz
Copy link
Collaborator Author

@sobolevn @simbo1905 Please let me know if you have thoughts about this issue.

@simbo1905
Copy link
Collaborator

Seems like a good idea. Will it effect fedora and alpine?

@joshrabinowitz
Copy link
Collaborator Author

joshrabinowitz commented Mar 21, 2019

@simbo1905 they actually document cases where it works just as it does in Debian:

https://wiki.archlinux.org/index.php/creating_packages indicates that arch linux expects it to work as debian does,

https://fedoraproject.org/wiki/Archive:PackagingDrafts/MakeInstall indicates Fedora is the same.

Edit: Repeated point removed apparently it's a GNU thing: https://www.gnu.org/prep/standards/standards.html#DESTDIR

@joshrabinowitz
Copy link
Collaborator Author

joshrabinowitz commented Mar 21, 2019

https://nullprogram.com/blog/2017/08/20/ also talks about DESTDIR and PREFIX both being makefile conventions.
The article also shows an example of a program being installed in $(DESTDIR)$(PREFIX)/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants