diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2014-11-11 19:20:43 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2014-11-11 19:21:33 +0300 |
commit | cfea98feebc9b1668d555d98481698dc4eefe532 (patch) | |
tree | a20b345c404d1a791a912ab7563931f111be0e78 | |
parent | fb6de51e6acdd7cc3a9f4c9c1c9746eb20aeef26 (diff) | |
download | ConsoleKit2-cfea98feebc9b1668d555d98481698dc4eefe532.tar.gz |
Fix installing logrotate file
This ensures the logrotate file will rotate the history file correctly.
It also now installs to the right location.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | data/Makefile.am | 34 | ||||
-rw-r--r-- | data/consolekit.logrotate.in (renamed from data/consolekit.logrotate) | 2 |
4 files changed, 31 insertions, 19 deletions
@@ -51,3 +51,4 @@ po/Rules-quot m4/* autotools/* cov-int/* +data/consolekit.logrotate diff --git a/configure.ac b/configure.ac index 8516c53..12cb074 100644 --- a/configure.ac +++ b/configure.ac @@ -287,18 +287,6 @@ else fi AC_SUBST(PAM_MODULE_DIR) -dnl --------------------------------------------------------------------------- -dnl - Install directory for syslog rotation file -dnl --------------------------------------------------------------------------- - -AC_ARG_WITH(logrotate-dir, - [AS_HELP_STRING([--with-logrotate-dir=<dir>],[directory to install syslog rotation file])]) -if ! test -z "$with_logrotate_dir"; then - LOGROTATE_DIR="$with_logrotate_dir" -else - LOGROTATE_DIR="/etc/logrotate.d" -fi -AC_SUBST(LOGROTATE_DIR) dnl --------------------------------------------------------------------------- dnl - Install directory for xinitrc file @@ -527,7 +515,6 @@ echo " Build PAM module: ${msg_pam_module} Build udev-acl: ${enable_udev_acl} Build docs: ${enable_docbook_docs} - Log rotate dir: ${LOGROTATE_DIR} xinitrc dir: ${XINITRC_DIR} PolicyKit support ${have_polkit} diff --git a/data/Makefile.am b/data/Makefile.am index 173df0e..38876d5 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,12 +1,13 @@ NULL = +BUILT_SOURCES = + dbusconfdir = $(DBUS_SYS_DIR) dbusconf_DATA = ConsoleKit.conf seatdir = $(sysconfdir)/ConsoleKit/seats.d seat_DATA = 00-primary.seat -logdir = $(LOGROTATE_DIR) xinitrcdir = $(XINITRC_DIR) if HAVE_POLKIT @@ -72,14 +73,35 @@ edit = sed \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@CONSOLE_KIT_PID_FILE[@]|$(CONSOLE_KIT_PID_FILE)|g' - -install-log: - $(INSTALL_PROGRAM) consolekit.logrotate $(logdir) - install-xinitrc: $(INSTALL_PROGRAM) 90-consolekit $(xinitrcdir) && \ chmod +x $(xinitrcdir)/90-consolekit +install-data-local: install-logrotate + $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ + +uninstall-local:: uninstall-logrotate + rmdir $(DESTDIR)$(localstatedir)/log/ConsoleKit/ + +LOGROTATE_CONFS = consolekit.logrotate + +BUILT_SOURCES += $(LOGROTATE_CONFS) + +consolekit.logrotate: consolekit.logrotate.in + sed \ + -e 's![@]localstatedir[@]!$(localstatedir)!g' \ + < $< > $@-t + mv $@-t $@ + +install-logrotate: $(LOGROTATE_CONFS) + $(MKDIR_P) $(DESTDIR)$(localstatedir)/log/ConsoleKit/ \ + $(DESTDIR)$(sysconfdir)/logrotate.d/ + $(INSTALL_DATA) consolekit.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/consolekit + + +uninstall-logrotate: + rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/consolekit + EXTRA_DIST = \ ck-log-system-restart \ ck-log-system-start \ @@ -92,6 +114,7 @@ EXTRA_DIST = \ console-kit-log-system-stop.service.in \ console-kit-log-system-restart.service.in \ 90-consolekit \ + consolekit.logrotate.in \ $(NULL) MAINTAINERCLEANFILES = \ @@ -100,6 +123,7 @@ MAINTAINERCLEANFILES = \ CLEANFILES = \ $(service_DATA) \ + $(BUILT_SOURCES) \ console-kit-daemon.service \ console-kit-log-system-start.service \ console-kit-log-system-stop.service \ diff --git a/data/consolekit.logrotate b/data/consolekit.logrotate.in index 6e63e41..656b312 100644 --- a/data/consolekit.logrotate +++ b/data/consolekit.logrotate.in @@ -1,4 +1,4 @@ -/var/log/ConsoleKit/history { +@localstatedir@/log/ConsoleKit/history { monthly rotate 6 delaycompress |