{"thread":{"id":"40905","subject":"Is it possible to build `git` such that the install directory and the deployment prefix is not the same?","startedAt":"2015-11-28T07:19:01Z","lastAt":"2015-11-28T07:58:02Z","messageCount":3,"participants":["Henry Qin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"273804","messageId":"CAO8bsPDQ2BX1U0D9=pa99_nkEeRWzuN6QzsMw+2u0GPqO6M9kw@mail.gmail.com","threadId":"40905","inReplyTo":null,"subject":"Is it possible to build `git` such that the install directory and the deployment prefix is not the same?","fromName":"Henry Qin","fromEmail":"root@hq6.me","sentAt":"2015-11-28T07:19:01Z","receivedAt":"2015-11-28T07:19:01Z","isPatch":false,"sender":{"key":"root@hq6.me","avatar":null},"body":"Dear Git developers,\n\nI've looked around the online forums and also asked this question on\nStackoverflow, but have not gotten an answer.\n\nhttp://stackoverflow.com/questions/33901216/is-it-possible-to-build-git-such-that-the-install-directory-and-the-deployment\n\nHere is the question, copied below for your convenience:\n\n\"\"\"\nI am attempting to build git from source, and I would like make\ninstall to put the binaries into a directory called dist in my source\ndirectory, so I use the following configure line.\n\n./configure --prefix=`pwd`/dist\n\nUnfortunately, this also causes the build output to assume that this\nis the final install location for git, and therefore hardcode the path\ninto various scripts and binaries such as\nlibexec/git-core/git-difftool.\n\nIs there a way to specify during either configure or make that I want\na different path for actual deployment, such as /usr/bin/local, but\nstill have make install go into the directory pwd/dist?\n\"\"\"\n\n\nThanks,\n~Henry\n"},{"id":"273805","messageId":"xmqqmvty8soc.fsf@gitster.mtv.corp.google.com","threadId":"40905","inReplyTo":"CAO8bsPDQ2BX1U0D9=pa99_nkEeRWzuN6QzsMw+2u0GPqO6M9kw@mail.gmail.com","subject":"Re: Is it possible to build `git` such that the install directory and the deployment prefix is not the same?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-11-28T07:54:59Z","receivedAt":"2015-11-28T07:54:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Henry Qin <root@hq6.me> writes:\n\n> Here is the question, copied below for your convenience:\n>\n> \"\"\"\n> I am attempting to build git from source, and I would like make\n> install to put the binaries into a directory called dist in my source\n> directory, so I use the following configure line.\n>\n> ./configure --prefix=`pwd`/dist\n\nYou probably want to use DESTDIR instead, e.g.\n\n    $ make prefix=/usr/local DESTDIR=/var/tmp/dest\n\nThe standard way to phrase your question is \"how do I 'make install'\nto install to a fake location so that I can tar up the result into a\ntarball?\" (the key part being \"so that...\"), I think.\n"},{"id":"273806","messageId":"CAO8bsPB98QRDRRftHNvLYafB-_EA_sbLMmB5SxxEjY+uRhKKCg@mail.gmail.com","threadId":"40905","inReplyTo":"xmqqmvty8soc.fsf@gitster.mtv.corp.google.com","subject":"Re: Is it possible to build `git` such that the install directory and the deployment prefix is not the same?","fromName":"Henry Qin","fromEmail":"root@hq6.me","sentAt":"2015-11-28T07:58:02Z","receivedAt":"2015-11-28T07:58:02Z","isPatch":false,"sender":{"key":"root@hq6.me","avatar":null},"body":"Thanks a lot, Junio and Dennis!\n\n~Henry\n\nOn Fri, Nov 27, 2015 at 11:47 PM, Dennis Kaarsemaker\n<dennis@kaarsemaker.net> wrote:\n> On vr, 2015-11-27 at 23:19 -0800, Henry Qin wrote:\n>\n>> Is there a way to specify during either configure or make that I want\n>> a different path for actual deployment, such as /usr/bin/local, but\n>\n> There is, using the DESTDIR variable:\n>\n> make PREFIX=/usr/local\n> DESTDIR=$(PWD)/dist make install\n> --\n> Dennis Kaarsemaker\n> www.kaarsemaker.net\n>\n>\n\n\nOn Fri, Nov 27, 2015 at 11:54 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Henry Qin <root@hq6.me> writes:\n>\n>> Here is the question, copied below for your convenience:\n>>\n>> \"\"\"\n>> I am attempting to build git from source, and I would like make\n>> install to put the binaries into a directory called dist in my source\n>> directory, so I use the following configure line.\n>>\n>> ./configure --prefix=`pwd`/dist\n>\n> You probably want to use DESTDIR instead, e.g.\n>\n>     $ make prefix=/usr/local DESTDIR=/var/tmp/dest\n>\n> The standard way to phrase your question is \"how do I 'make install'\n> to install to a fake location so that I can tar up the result into a\n> tarball?\" (the key part being \"so that...\"), I think.\n>\n"}]}