]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: create /var/log/journal/{,remote/} conditionally
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 4 Jul 2019 07:59:09 +0000 (09:59 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 4 Jul 2019 08:16:48 +0000 (10:16 +0200)
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.

docs/var-log/meson.build
meson_options.txt
src/journal-remote/meson.build
src/journal/meson.build

index 0ddff20ce56bd2bd1513103d9b78219f776cbe44..993eb31d67963e8adc9d44b8013ae92219ce627d 100644 (file)
@@ -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
index e56d33760b4ae7f3be18cb19d44a50a5281b8b15..7c8a769bbc562cb5dac5eafdef901d519b16a4f4 100644 (file)
@@ -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'],
index 2887daa4bf901562aa8a797c7a1d95b5c200f252..87b8ba6495f826ddcb730a50cb3b3f1f3fb8a025 100644 (file)
@@ -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
index e03d6dc232713a35da9e60216e46d9514149f417..5796f77cac365c80c02da0ca3e2e0a1720060f4c 100644 (file)
@@ -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