[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
INSTALL_AS_USER and INSTALL_AS_GROUP
From: |
Nicola Pero |
Subject: |
INSTALL_AS_USER and INSTALL_AS_GROUP |
Date: |
Wed, 12 Dec 2001 23:46:48 +0000 (GMT) |
I've just finished implementing INSTALL_AS_USER and INSTALL_AS_GROUP in
gnustep-make.
Most people don't need this ever - but in some cases it's really useful.
It means that now you can define in your GNUmakefile (at the beginning or
in the GNUmakefile.preamble) the variables INSTALL_AS_USER and/or
INSTALL_AS_GROUP, as in the following example -
INSTALL_AS_USER = nicola
INSTALL_AS_GROUP = users
and anything which is installed will get chowned to nicola.users.
If you don't specify them, all works as before - everything is installed
normally with the user and group of the user who is installing.
Setting INSTALL_AS_USER and/or INSTALL_AS_ROOT causes:
* INSTALL, INSTALL_DATA and INSTALL_PROGRAM to specify the owner and/or
group to use when installing the file;
* application.make, bundle.make, and the other makefiles installing
software using tar to recursively chown the installed directory
to the owner and/or group;
* MKINSTALLDIRS to chown the created installation directories to the
appropriate owner and/or group. (MKINSTALLDIRS is a new variable,
the usual one, which is MKDIRS, still creates directories ignoring
INSTALL_AS_USER and INSTALL_AS_GROUP. The idea is that you use
MKDIRS to create local directories, and MKINSTALLDIRS to create
installation directories - difference being the MKINSTALLDIRS
potentially chowns the created dirs).
This means that if you add installation rules in your
GNUmakefile.postamble, those rules will automatically use the appropriate
INSTALL_AS_USER and INSTALL_AS_GROUP if you follow the following simple
guidelines:
* you always install using INSTALL, INSTALL_DATA and INSTALL_PROGRAM;
don't use cp to install (if you do, you have to chown the result
manually);
* you always create installation directories using MKINSTALLDIRS and not
MKDIRS. (but create local dirs using MKDIRS - *not* MKINSTALLDIRS);
* if you install anything manually outside these rules, you need to chown
the installed file/dir/whatever as in the following example -
ifneq ($(CHOWN_TO),)
chown $(CHOWN_TO) $(MY_INSTALLED_FILE)
endif
if it is a directory, use something like 'chown -R $(CHOWN_TO)
$(MY_INSTALLED_DIR)'
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- INSTALL_AS_USER and INSTALL_AS_GROUP,
Nicola Pero <=