chiark / gitweb /
Prep v239: Add new user-runtime-dir main() function as user_runtime_dir().
[elogind.git] / src / login / meson.build
index 401741e6be90d4089b83c87f7768350912661d95..0eac0d3ccbbd4f8a386cb4878cdfdc6a6d42641a 100644 (file)
@@ -1,20 +1,4 @@
 # SPDX-License-Identifier: LGPL-2.1+
-#
-# Copyright 2017 Zbigniew JÄ™drzejewski-Szmek
-#
-# elogind is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# elogind is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with elogind; If not, see <http://www.gnu.org/licenses/>.
-
 #if 0 /// rename to elogind
 # 
 # systemd_logind_sources = files('''
@@ -36,13 +20,6 @@ logind_gperf_c = custom_target(
         output : 'logind-gperf.c',
         command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
 
-#if 0 /// rename to elogind
-# systemd_logind_sources += [logind_gperf_c]
-#else
-elogind_sources += [logind_gperf_c]
-#endif // 0
-
-
 liblogind_core_sources = files('''
         logind-core.c
         logind-device.c
@@ -73,11 +50,14 @@ liblogind_core_sources = files('''
 liblogind_core_sources += [files('''
         elogind-dbus.c
         elogind-dbus.h
+        user-runtime-dir.c
 '''.split()),
         libcore_la_sources,
         sleep_files,
         update_utmp_files]
 #endif // 1
+liblogind_core_sources += [logind_gperf_c]
+
 logind_acl_c = files('logind-acl.c')
 if conf.get('HAVE_ACL') == 1
         liblogind_core_sources += logind_acl_c
@@ -100,110 +80,90 @@ loginctl_sources = files('''
         sysfs-show.c
 '''.split())
 
-#if 1 /// elogind has some additional files:
+#if 0 /// UNNEEDED by elogind
+# user_runtime_dir_sources = files('''
+#         user-runtime-dir.c
+#         logind.h
+# '''.split())
+#endif // 0
+
+#if 1 /// elogind has and needs some additional files:
 loginctl_sources += files('''
         eloginctl.c
         eloginctl.h
 '''.split())
 #endif // 1
-#if 0 /// elogind builds itself unconditionally and with some adaptations
+
+#if 0 /// elogind builds itself unconditionally
 # if conf.get('ENABLE_LOGIND') == 1
-#         logind_conf = configure_file(
-#                 input : 'logind.conf.in',
-#                 output : 'logind.conf',
-#                 configuration : substs)
-#         install_data(logind_conf,
-#                      install_dir : pkgsysconfdir)
-# 
-#         pam_systemd_sym = 'src/login/pam_systemd.sym'
-#         pam_systemd_c = files('pam_systemd.c')
-# 
-#         install_data('org.freedesktop.login1.conf',
-#                      install_dir : dbuspolicydir)
+#endif // 0
+        logind_conf = configure_file(
+                input : 'logind.conf.in',
+                output : 'logind.conf',
+                configuration : substs)
+        install_data(logind_conf,
+                     install_dir : pkgsysconfdir)
+
+        pam_elogind_sym = 'src/login/pam_elogind.sym'
+        pam_elogind_c = files('pam_elogind.c')
+
+        install_data('org.freedesktop.login1.conf',
+                     install_dir : dbuspolicydir)
+#if 0 /// Works a bit differently here, as elogind allows dbus activation.
 #         install_data('org.freedesktop.login1.service',
 #                      install_dir : dbussystemservicedir)
-# 
-#         i18n.merge_file(
-#                 'org.freedesktop.login1.policy',
-#                 input : 'org.freedesktop.login1.policy.in',
-#                 output : 'org.freedesktop.login1.policy',
-#                 po_dir : po_dir,
-#                 data_dirs : po_dir,
-#                 install : install_polkit,
-#                 install_dir : polkitpolicydir)
-# 
-#         install_data('70-power-switch.rules',
-#                      '70-uaccess.rules',
-#                      install_dir : udevrulesdir)
-# 
-#         foreach file : ['71-seat.rules',
-#                         '73-seat-late.rules']
-#                 gen = configure_file(
-#                         input : file + '.in',
-#                         output : file,
-#                         configuration : substs)
-#                 install_data(gen,
-#                              install_dir : udevrulesdir)
-#         endforeach
-# 
-#         custom_target(
-#                 'systemd-user',
-#                 input : 'systemd-user.m4',
-#                 output: 'systemd-user',
-#                 command : [m4, '-P'] + m4_defines + ['@INPUT@'],
-#                 capture : true,
-#                 install : pamconfdir != 'no',
-#                 install_dir : pamconfdir)
-# endif
 #else
-logind_conf = configure_file(
-        input : 'logind.conf.in',
-        output : 'logind.conf',
-        configuration : substs)
-install_data(logind_conf,
-                install_dir : pkgsysconfdir)
-
-pam_elogind_sym = 'src/login/pam_elogind.sym'
-pam_elogind_c = files('pam_elogind.c')
-
-install_data('org.freedesktop.login1.conf',
-                install_dir : dbuspolicydir)
-logind_service = configure_file(
-        input : 'org.freedesktop.login1.service.in',
-        output : 'org.freedesktop.login1.service',
-        configuration : substs)
-install_data(logind_service,
+        logind_service = configure_file(
+                input : 'org.freedesktop.login1.service.in',
+                output : 'org.freedesktop.login1.service',
+                configuration : substs)
+        install_data(logind_service,
                 install_dir : dbussystemservicedir)
+#endif // 0
+        install_data('org.freedesktop.login1.policy',
+                     install_dir : polkitpolicydir)
 
-i18n.merge_file(
-        'org.freedesktop.login1.policy',
-        input : 'org.freedesktop.login1.policy.in',
-        output : 'org.freedesktop.login1.policy',
-        po_dir : po_dir,
-        data_dirs : po_dir,
-        install : install_polkit,
-        install_dir : polkitpolicydir)
-
-install_data('70-power-switch.rules',
-                '70-uaccess.rules',
-                install_dir : udevrulesdir)
+        install_data('70-power-switch.rules', install_dir : udevrulesdir)
+
+        if conf.get('HAVE_ACL') == 1
+                install_data('70-uaccess.rules', install_dir : udevrulesdir)
+        endif
 
-foreach file : ['71-seat.rules',
-                '73-seat-late.rules']
-        gen = configure_file(
-                input : file + '.in',
-                output : file,
+        seat_rules = configure_file(
+                input : '71-seat.rules.in',
+                output : '71-seat.rules',
                 configuration : substs)
-        install_data(gen,
-                        install_dir : udevrulesdir)
-endforeach
-
-custom_target(
-        'elogind-user',
-        input : 'elogind-user.m4',
-        output: 'elogind-user',
-        command : [m4, '-P'] + m4_defines + ['@INPUT@'],
-        capture : true,
-        install : pamconfdir != 'no',
-        install_dir : pamconfdir)
+        install_data(seat_rules,
+                     install_dir : udevrulesdir)
+
+#if 1 /// elogind needs two passes of this file
+        seat_late_rules = configure_file(
+                input : '73-seat-late.rules.in',
+                output : '73-seat-late.rules.m4',
+                configuration : substs)
+#endif // 1
+
+        custom_target(
+                '73-seat-late.rules',
+#if 0 /// elogind must configure the source
+#                 input : '73-seat-late.rules.m4',
+#else
+                input : seat_late_rules,
+#endif // 0
+                output: '73-seat-late.rules',
+                command : [meson_apply_m4, config_h, '@INPUT@'],
+                capture : true,
+                install : true,
+                install_dir : udevrulesdir)
+
+        custom_target(
+                'elogind-user',
+                input : 'elogind-user.m4',
+                output: 'elogind-user',
+                command : [meson_apply_m4, config_h, '@INPUT@'],
+                capture : true,
+                install : pamconfdir != 'no',
+                install_dir : pamconfdir)
+#if 0 /// elogind builds itself unconditionally
+# endif
 #endif //0