From f3831bbd801135d7e618725cdfd7ff99f52e33a6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 14 Aug 2007 14:32:45 +0200 Subject: [PATCH] build-sys: add --disable-makeinstall-chown A chown-like operations are unexpected when you execute "make install" as non-root user. For example RPM defines owner+permissions in .spec file -- you needn't to use root account to create useful RPM package. Signed-off-by: Karel Zak --- configure.ac | 6 ++++++ login-utils/Makefile.am | 6 +++--- misc-utils/Makefile.am | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index f0756ac2..36923703 100644 --- a/configure.ac +++ b/configure.ac @@ -476,6 +476,12 @@ if test x$enable_use_tty_group = xyes; then AC_DEFINE(USE_TTY_GROUP, 1, [Should wall and write be installed setgid tty?]) fi +AC_ARG_ENABLE([makeinstall-chown], + AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]), + [], enable_makeinstall_chown=yes +) +AM_CONDITIONAL(MAKEINSTALL_DO_CHOWN, test x$enable_makeinstall_chown = xyes) + AC_ARG_VAR([SUID_CFLAGS], [CFLAGS used for binaries which are usually with the suid bit]) diff --git a/login-utils/Makefile.am b/login-utils/Makefile.am index 639db58c..de45f26f 100644 --- a/login-utils/Makefile.am +++ b/login-utils/Makefile.am @@ -26,7 +26,7 @@ if NEED_LIBCRYPT simpleinit_LDADD = -lcrypt endif -endif +endif if BUILD_LAST usrbinexec_PROGRAMS += last @@ -101,17 +101,17 @@ man_MANS += mesg.1 endif if BUILD_WALL - usrbinexec_PROGRAMS += wall wall_SOURCES = wall.c ttymsg.c ttymsg.h man_MANS += wall.1 if USE_TTY_GROUP +if MAKEINSTALL_DO_CHOWN install-exec-hook:: chgrp tty $(DESTDIR)$(usrbinexecdir)/wall chmod g+s $(DESTDIR)$(usrbinexecdir)/wall endif - +endif endif if BUILD_INIT diff --git a/misc-utils/Makefile.am b/misc-utils/Makefile.am index 794be494..e9f304f4 100644 --- a/misc-utils/Makefile.am +++ b/misc-utils/Makefile.am @@ -68,11 +68,12 @@ write_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) write_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS) if USE_TTY_GROUP +if MAKEINSTALL_DO_CHOWN install-exec-hook:: chgrp tty $(DESTDIR)$(usrbinexecdir)/write chmod g+s $(DESTDIR)$(usrbinexecdir)/write endif - +endif endif noinst_PROGRAMS = cal_test -- 2.39.5