Cello icon indicating copy to clipboard operation
Cello copied to clipboard

Make install should use "install --mode=..." instead of "cp"

Open notorand-it opened this issue 6 years ago • 2 comments

When running "sudo make install" or simply "make install" as root, the Makefile assumes root umask is something like 0022. Which is just an ... assumption, not a fact. Many system administrator set root umask to 0077 (no file is created world-readable or world-executable).

The command "install" (from GNU coreutils) has the "--mode" option to enforce file and directory permissions during the file copy. Which very likely is "0644" for Cello.h and libCello.a, and "0755" for libCello.so.

notorand-it avatar Apr 20 '18 16:04 notorand-it

Thanks for the report. Sorry I'm not really a unix expert. So the issue is that installing libraries with cp does not work in some cases? So what is the fix for this?

orangeduck avatar Apr 22 '18 14:04 orangeduck

To be really fool prof you'd:

install --mode=0755 -d /usr/local
install --mode=0755 -d /usr/local/lib
install --mode=0755 -d /usr/local/include

# this creates the directory tree with proper permissions for normal users

install --mode=0644 libCello.a /usr/local/lib
install --mode=0755 libCello.so /usr/local/lib
install --mode=0644 include/Cello.h /usr/local/include
ldconfig

# this last command updates the dynamic loader cache

This also covers my other ticket about the shared object not being installed.

notorand-it avatar Apr 22 '18 15:04 notorand-it