#257 Can't install as non-root because of file ownership issues

open
nobody
None
5
2015-04-13
2015-04-13
No

Hello,

When installing as non root, such as:

mkdir export
make DESTDIR=$PWD/export install

I get the following:

make -f Makefile.gnu install 
make[1]: Entering directory '/tmp/FreeImage'
install -d /tmp/FreeImage/export/usr/include /tmp/FreeImage/export/usr/lib
install -m 644 -o root -g root Source/FreeImage.h /tmp/FreeImage/export/usr/include
install: cannot change ownership of '/tmp/FreeImage/export/usr/include/FreeImage.h': Operation not permitted
Makefile.gnu:73: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/tmp/FreeImage'
Makefile:30: recipe for target 'install' failed
make: *** [install] Error 2

This prevents for installing as non-root, which is useful e.g. when cross-compiling.

I would suggest simply removing the "-o root -g root" arguments (see attached patch), to the install statement. That way we rely on the current user/umask, which should be correct in most cases.

Does it make sense ?

1 Attachments

Discussion


Log in to post a comment.