summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-04 09:59:09 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-04 10:16:48 +0200
commit6ed5ef9819c143b65a9f92c63b65d66feac59506 (patch)
tree380795fc70e5ae2e319694101bf4cfe346c66ada
parent7810d22171bbff1301397357afd4146016a60bde (diff)
downloadsystemd-6ed5ef9819c143b65a9f92c63b65d66feac59506.tar.gz
meson: create /var/log/journal/{,remote/} conditionally
Not everybody has those dirs in the filesystem (and they don't need to). When creating an installation package using $DESTDIR, it is easy enough to remove or ignore those directories, but if installing into a real root, it is ugly to create and remove them. Let's add an option so people can skip it if they want. Inspired by #12930.
-rw-r--r--docs/var-log/meson.build2
-rw-r--r--meson_options.txt2
-rw-r--r--src/journal-remote/meson.build12
-rw-r--r--src/journal/meson.build26
4 files changed, 24 insertions, 18 deletions
diff --git a/docs/var-log/meson.build b/docs/var-log/meson.build
index 0ddff20ce5..993eb31d67 100644
--- a/docs/var-log/meson.build
+++ b/docs/var-log/meson.build
@@ -5,7 +5,7 @@ file = configure_file(
output : 'README',
configuration : substs)
-if conf.get('HAVE_SYSV_COMPAT') == 1
+if conf.get('HAVE_SYSV_COMPAT') == 1 and get_option('create-log-dirs')
install_data(file,
install_dir : varlogdir)
endif
diff --git a/meson_options.txt b/meson_options.txt
index e56d33760b..7c8a769bbc 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -95,6 +95,8 @@ option('timesyncd', type : 'boolean',
description : 'install the systemd-timesyncd daemon')
option('remote', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'support for "journal over the network"')
+option('create-log-dirs', type : 'boolean',
+ description : 'create /var/log/journal{,/remote}')
option('nss-myhostname', type : 'boolean',
description : 'install nss-myhostname module')
option('nss-mymachines', type : 'combo', choices : ['auto', 'true', 'false'],
diff --git a/src/journal-remote/meson.build b/src/journal-remote/meson.build
index 2887daa4bf..87b8ba6495 100644
--- a/src/journal-remote/meson.build
+++ b/src/journal-remote/meson.build
@@ -63,9 +63,11 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
install_data('browse.html',
install_dir : join_paths(pkgdatadir, 'gatewayd'))
- meson.add_install_script('sh', '-c',
- mkdir_p.format('/var/log/journal/remote'))
- meson.add_install_script('sh', '-c',
- '''chown 0:0 $DESTDIR/var/log/journal/remote &&
- chmod 755 $DESTDIR/var/log/journal/remote || :''')
+ if get_option('create-log-dirs')
+ meson.add_install_script('sh', '-c',
+ mkdir_p.format('/var/log/journal/remote'))
+ meson.add_install_script('sh', '-c',
+ '''chown 0:0 $DESTDIR/var/log/journal/remote &&
+ chmod 755 $DESTDIR/var/log/journal/remote || :''')
+ endif
endif
diff --git a/src/journal/meson.build b/src/journal/meson.build
index e03d6dc232..5796f77cac 100644
--- a/src/journal/meson.build
+++ b/src/journal/meson.build
@@ -111,20 +111,22 @@ endif
install_data('journald.conf',
install_dir : pkgsysconfdir)
-meson.add_install_script(
- 'sh', '-c',
- mkdir_p.format('/var/log/journal'))
-meson.add_install_script(
- 'sh', '-c',
- '''chown 0:0 $DESTDIR/var/log/journal &&
- chmod 755 $DESTDIR/var/log/journal || :''')
-if get_option('adm-group')
+if get_option('create-log-dirs')
meson.add_install_script(
'sh', '-c',
- 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :')
-endif
-if get_option('wheel-group')
+ mkdir_p.format('/var/log/journal'))
meson.add_install_script(
'sh', '-c',
- 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
+ '''chown 0:0 $DESTDIR/var/log/journal &&
+ chmod 755 $DESTDIR/var/log/journal || :''')
+ if get_option('adm-group')
+ meson.add_install_script(
+ 'sh', '-c',
+ 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :')
+ endif
+ if get_option('wheel-group')
+ meson.add_install_script(
+ 'sh', '-c',
+ 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
+ endif
endif