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

Add DESTDIR variable to FLiT's Makefile #292

Closed
mikebentley15 opened this issue Sep 24, 2019 · 2 comments · Fixed by #295
Closed

Add DESTDIR variable to FLiT's Makefile #292

mikebentley15 opened this issue Sep 24, 2019 · 2 comments · Fixed by #295
Labels
enhancement good first issue A good place to start make Involves touching GNU Makefiles tests Involves touching tests

Comments

@mikebentley15
Copy link
Collaborator

Feature Request

Describe the new feature:
When installing, apparently the PREFIX variable within the Makefile is not sufficient for some things. Specifically, I was looking at creating deb packages for Debian-based systems.

We would add another DESTDIR variable that would be before the PREFIX variable. The difference between them is that from the files that are installed, the DESTDIR should be the location of the root directory (i.e., /). Even absolute paths should be relative to DESTDIR.

Suggested change:
Rework the top-level Makefile to use DESTDIR, and add some tests to test its functionality.

Alternative approaches:
Don't use any absolute paths at all and only do relative paths. That way, we can simply prepend DESTDIR in front of PREFIX and no other work is necessary.

@mikebentley15 mikebentley15 added enhancement good first issue A good place to start make Involves touching GNU Makefiles tests Involves touching tests labels Sep 24, 2019
@IanBriggs
Copy link
Collaborator

I'm unfamiliar with the purpose of DESTDIR, and it looks like the description from bsd matches with the alternative approach.

Is there a reason we wouldn't want to use the alternative approach?

@mikebentley15
Copy link
Collaborator Author

There are some placed in our installation that we use absolute paths, such as in the autogenerated flitconfig.py (that has paths to the pieces of the installation). We could change all of those to be relative paths instead.

I found out about DESTDIR when trying to make a Debian package containing FLiT. They use the DESTDIR as a root for the installation and PREFIX to be the base of the installation. If the installation uses absoolute paths, the absolute paths need to not include DESTDIR.

Another way to think about it is that we want to install into ~/install/ with a prefix of /usr/. We could then do a chroot into ~/install and use the software perfectly fine. Does that make sense?

I am fine with the alternative approach. It would probably make our package a little more robust. For example, if you install into a PREFIX, then decide you wanted it installed somewhere else, you can just move all of the files to a different directory and it would work just fine (as long as you kept the same directory structure).

Yeah, I like the idea of using the alternative method. Thanks for your input :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue A good place to start make Involves touching GNU Makefiles tests Involves touching tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants