Skip to content

Commit

Permalink
Rename --disable-man-group option to --disable-file-attr
Browse files Browse the repository at this point in the history
This option was originally intended to prevent the configuration process
from setting the group ID for manual pages that were installed.
It is now also used to tell the build process to not set the user and
group of the /var/log/sa directory when it is created.
This option may be useful when creating an RPM package with a non
privileged user.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
  • Loading branch information
sysstat committed Jan 19, 2015
1 parent 32f27d3 commit fcd4de4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 39 deletions.
8 changes: 5 additions & 3 deletions Makefile.in
Expand Up @@ -101,10 +101,10 @@ INSTALL_CRON = @INSTALL_CRON@
CRON_OWNER = @CRON_OWNER@

MAN_GROUP = @MAN_GROUP@
ifndef IGNORE_MAN_GROUP
IGNORE_MAN_GROUP = @IGNORE_MAN_GROUP@
ifndef IGNORE_FILE_ATTRIBUTES
IGNORE_FILE_ATTRIBUTES = @IGNORE_FILE_ATTRIBUTES@
endif
ifeq ($(IGNORE_MAN_GROUP),y)
ifeq ($(IGNORE_FILE_ATTRIBUTES),y)
MANGRPARG =
else
MANGRPARG = -g $(MAN_GROUP)
Expand Down Expand Up @@ -368,7 +368,9 @@ endif

install_all: install_base cron/crontab sysstat \
cron/sysstat.crond cron/sysstat.cron.daily cron/sysstat.cron.hourly
ifneq ($(IGNORE_FILE_ATTRIBUTES),y)
$(CHOWN) $(CRON_OWNER) $(DESTDIR)$(SA_DIR)
endif
if [ ! -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
if [ -d $(DESTDIR)/etc/cron.d ]; then \
$(INSTALL_DATA) cron/sysstat.crond $(DESTDIR)/etc/cron.d/sysstat; \
Expand Down
9 changes: 9 additions & 0 deletions build/ignore-file-attr
@@ -0,0 +1,9 @@

Here again, don't bother too much with that. When set, this parameter prevents
the installation process from setting the attributes (eg. user, group...) of
files being installed.
For example, when this parameter is used, the contents of the man_group variable
won't be taken into account, the installation process won't try to set the
user and group attributes of the /var/log/sa directory...
This parameter is only used by some distros to package sysstat.

6 changes: 0 additions & 6 deletions build/ignore-man-group

This file was deleted.

26 changes: 13 additions & 13 deletions configure
Expand Up @@ -640,7 +640,7 @@ INSTALL_CRON
CLEAN_SA_DIR
INSTALL_ISAG
COMPRESS_MANPG
IGNORE_MAN_GROUP
IGNORE_FILE_ATTRIBUTES
MAN_GROUP
man_group
PREALLOC_FACTOR
Expand Down Expand Up @@ -736,7 +736,7 @@ enable_sensors
enable_largefile
enable_nls
enable_yesterday
enable_man_group
enable_file_attr
enable_compress_manpg
enable_install_isag
enable_clean_sa_dir
Expand Down Expand Up @@ -1379,7 +1379,7 @@ Optional Features:
--disable-largefile omit support for large files
--disable-nls disable National Language Support
--enable-yesterday tell sa2 to use data file of the day before
--disable-man-group ignore man_group variable value
--disable-file-attr do not set attributes on files being installed
--enable-compress-manpg compress sysstat manual pages
--enable-install-isag install isag script
--enable-clean-sa-dir clean system activity directory
Expand Down Expand Up @@ -3787,7 +3787,7 @@ $as_echo "no" >&6; }
fi
for ac_prog in bzip2 gzip
for ac_prog in xz bzip2 gzip
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
Expand Down Expand Up @@ -4849,7 +4849,7 @@ echo .
# --disable-largefile omit support for large files
# --disable-nls disable National Language Support
# --enable-yesterday tell sa2 to use "yesterday" data files
# --disable-man-group ignore man_group variable value
# --disable-file-attr don't set attributes on files being installed
# --enable-install-cron tell sysstat to install cron scripts
# --collect-all tell sadc to collect all possible data
# --enable-clean-sa-dir clean system activity directory
Expand Down Expand Up @@ -5105,21 +5105,21 @@ $as_echo "$MAN_GROUP" >&6; }
fi
# Ignore manual pages group?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether man_group variable should be ignored" >&5
$as_echo_n "checking whether man_group variable should be ignored... " >&6; }
# Check whether --enable-man-group was given.
if test "${enable_man_group+set}" = set; then :
enableval=$enable_man_group; AUX_IMG=$enableval
# Don't set attributes on files being installed?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether attributes should not be set on files being installed" >&5
$as_echo_n "checking whether attributes should not be set on files being installed... " >&6; }
# Check whether --enable-file-attr was given.
if test "${enable_file_attr+set}" = set; then :
enableval=$enable_file_attr; AUX_IMG=$enableval
else
AUX_IMG=yes
fi
if test $AUX_IMG != "no"; then
IGNORE_MAN_GROUP=n
IGNORE_FILE_ATTRIBUTES=n
AUX_IMG=no
else
IGNORE_MAN_GROUP=y
IGNORE_FILE_ATTRIBUTES=y
AUX_IMG=yes
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUX_IMG" >&5
Expand Down
18 changes: 9 additions & 9 deletions configure.in
Expand Up @@ -129,7 +129,7 @@ echo .
# --disable-largefile omit support for large files
# --disable-nls disable National Language Support
# --enable-yesterday tell sa2 to use "yesterday" data files
# --disable-man-group ignore man_group variable value
# --disable-file-attr don't set attributes on files being installed
# --enable-install-cron tell sysstat to install cron scripts
# --collect-all tell sadc to collect all possible data
# --enable-clean-sa-dir clean system activity directory
Expand Down Expand Up @@ -356,21 +356,21 @@ else
fi
AC_SUBST(MAN_GROUP)

# Ignore manual pages group?
AC_MSG_CHECKING(whether man_group variable should be ignored)
AC_ARG_ENABLE(man-group,
AC_HELP_STRING([--disable-man-group],
[ignore man_group variable value]),
# Don't set attributes on files being installed?
AC_MSG_CHECKING(whether attributes should not be set on files being installed)
AC_ARG_ENABLE(file-attr,
AC_HELP_STRING([--disable-file-attr],
[do not set attributes on files being installed]),
AUX_IMG=$enableval,AUX_IMG=yes)
if test $AUX_IMG != "no"; then
IGNORE_MAN_GROUP=n
IGNORE_FILE_ATTRIBUTES=n
AUX_IMG=no
else
IGNORE_MAN_GROUP=y
IGNORE_FILE_ATTRIBUTES=y
AUX_IMG=yes
fi
AC_MSG_RESULT($AUX_IMG)
AC_SUBST(IGNORE_MAN_GROUP)
AC_SUBST(IGNORE_FILE_ATTRIBUTES)

# Compress manual pages?
AC_MSG_CHECKING(whether manual pages should be compressed)
Expand Down
16 changes: 8 additions & 8 deletions iconfig
Expand Up @@ -100,13 +100,13 @@ if [ "${MAN}" != "" ]; then
MAN="man_group=${MAN} "
fi

# Ignore man_group variable
IGNORE_MAN=`${ASK} 'Ignore contents of man_group variable? (y/n)' "--disable-man-group" "ignore-man-group"`
if [ "${IGNORE_MAN}" = "y" ]; then
IGNORE_MAN="--disable-man-group "
# Don't set attributes on files being installed
IGNORE_FILE_ATTR=`${ASK} 'Do not set attributes on files being installed? (y/n)' "--disable-file-attr" "ignore-file-attr"`
if [ "${IGNORE_FILE_ATTR}" = "y" ]; then
IGNORE_FILE_ATTR="--disable-file-attr "
else
IGNORE_MAN=""
echo "Parameter --disable-man-group is NOT set"
IGNORE_FILE_ATTR=""
echo "Parameter --disable-file-attr is NOT set"
fi

# Crontab
Expand Down Expand Up @@ -212,11 +212,11 @@ fi

echo
echo "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR} \
${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}"
echo

./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_MAN}${CRON}${RCDIR} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR} \
${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}

0 comments on commit fcd4de4

Please sign in to comment.