chiark / gitweb /
build-sys: properly mkdir with DESTDIR set
[elogind.git] / Makefile.am
index 7e408798a62cf9eb06107900f7b31d58c1de2e15..1b8ed92237ce6660456113445d89125930cd5185 100644 (file)
@@ -31,29 +31,29 @@ SUBDIRS = . po
 # keep intermediate files
 .SECONDARY:
 
-LIBUDEV_CURRENT=3
-LIBUDEV_REVISION=1
-LIBUDEV_AGE=2
+LIBUDEV_CURRENT=4
+LIBUDEV_REVISION=4
+LIBUDEV_AGE=3
 
 LIBGUDEV_CURRENT=1
 LIBGUDEV_REVISION=3
 LIBGUDEV_AGE=1
 
-LIBSYSTEMD_LOGIN_CURRENT=3
-LIBSYSTEMD_LOGIN_REVISION=11
-LIBSYSTEMD_LOGIN_AGE=3
+LIBSYSTEMD_LOGIN_CURRENT=7
+LIBSYSTEMD_LOGIN_REVISION=0
+LIBSYSTEMD_LOGIN_AGE=7
 
 LIBSYSTEMD_DAEMON_CURRENT=0
-LIBSYSTEMD_DAEMON_REVISION=7
+LIBSYSTEMD_DAEMON_REVISION=10
 LIBSYSTEMD_DAEMON_AGE=0
 
 LIBSYSTEMD_ID128_CURRENT=0
-LIBSYSTEMD_ID128_REVISION=17
+LIBSYSTEMD_ID128_REVISION=22
 LIBSYSTEMD_ID128_AGE=0
 
-LIBSYSTEMD_JOURNAL_CURRENT=8
-LIBSYSTEMD_JOURNAL_REVISION=0
-LIBSYSTEMD_JOURNAL_AGE=8
+LIBSYSTEMD_JOURNAL_CURRENT=10
+LIBSYSTEMD_JOURNAL_REVISION=1
+LIBSYSTEMD_JOURNAL_AGE=10
 
 # Dirs of external packages
 dbuspolicydir=@dbuspolicydir@
@@ -90,6 +90,7 @@ udevhomedir=$(udevlibexecdir)
 udevrulesdir=$(udevlibexecdir)/rules.d
 udevhwdbdir=$(udevlibexecdir)/hwdb.d
 catalogdir=$(prefix)/lib/systemd/catalog
+kernelinstalldir = $(prefix)/lib/kernel/install.d
 
 # And these are the special ones for /
 rootprefix=@rootprefix@
@@ -97,6 +98,7 @@ rootbindir=$(rootprefix)/bin
 rootlibexecdir=$(rootprefix)/lib/systemd
 
 CLEANFILES = $(BUILT_SOURCES)
+DISTCLEANFILES =
 EXTRA_DIST =
 BUILT_SOURCES =
 INSTALL_EXEC_HOOKS =
@@ -104,17 +106,18 @@ UNINSTALL_EXEC_HOOKS =
 INSTALL_DATA_HOOKS =
 UNINSTALL_DATA_HOOKS =
 DISTCLEAN_LOCAL_HOOKS =
+CLEAN_LOCAL_HOOKS =
 pkginclude_HEADERS =
 noinst_LTLIBRARIES =
 lib_LTLIBRARIES =
 include_HEADERS =
+noinst_DATA =
 pkgconfiglib_DATA =
 polkitpolicy_in_in_files =
 polkitpolicy_in_files =
 polkitpolicy_files =
 dist_udevrules_DATA =
 nodist_udevrules_DATA =
-dist_man_MANS =
 dist_pkgsysconf_DATA =
 dist_pkgdata_DATA =
 dist_dbuspolicy_DATA =
@@ -122,22 +125,27 @@ dbusinterface_DATA =
 dist_dbussystemservice_DATA =
 check_PROGRAMS =
 check_DATA =
-noinst_tests=
-noinst_PROGRAMS = $(noinst_tests)
-TESTS = $(noinst_tests)
+tests=
+manual_tests =
+if ENABLE_TESTS
+noinst_PROGRAMS = $(manual_tests) $(tests)
+TESTS = $(tests)
+else
+noinst_PROGRAMS =
+TESTS =
+endif
 udevlibexec_PROGRAMS =
 
 AM_CPPFLAGS = \
        -include $(top_builddir)/config.h \
-       -DSYSTEM_CONFIG_FILE=\"$(pkgsysconfdir)/system.conf\" \
+       -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
        -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
        -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
        -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
        -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
-       -DUSER_CONFIG_FILE=\"$(pkgsysconfdir)/user.conf\" \
        -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
        -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
-       -DCATALOG_PATH=\"$(catalogstatedir)\" \
+       -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
        -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
        -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
        -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
@@ -156,6 +164,7 @@ AM_CPPFLAGS = \
        -DX_SERVER=\"$(bindir)/X\" \
        -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
        -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
+       -DQUOTACHECK=\"$(QUOTACHECK)\" \
        -I $(top_srcdir)/src \
        -I $(top_srcdir)/src/shared \
        -I $(top_srcdir)/src/login \
@@ -165,6 +174,7 @@ AM_CPPFLAGS = \
        -I $(top_srcdir)/src/core \
        -I $(top_srcdir)/src/libudev \
        -I $(top_srcdir)/src/udev \
+       -I $(top_srcdir)/src/libsystemd-bus \
        $(OUR_CPPFLAGS)
 
 AM_CFLAGS = $(OUR_CFLAGS)
@@ -176,7 +186,7 @@ define move-to-rootlibdir
                $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
                so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
                so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
-               ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
+               $(LN_S) -f $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
                mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
        fi
 endef
@@ -192,8 +202,8 @@ SHUTDOWN_TARGET_WANTS =
 LOCAL_FS_TARGET_WANTS =
 MULTI_USER_TARGET_WANTS =
 SYSINIT_TARGET_WANTS =
-BASIC_TARGET_WANTS =
 SOCKETS_TARGET_WANTS =
+TIMERS_TARGET_WANTS =
 
 SYSTEM_UNIT_ALIASES =
 USER_UNIT_ALIASES =
@@ -210,8 +220,8 @@ install-target-wants-hook:
        what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants)
        what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && $(add-wants)
        what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants)
-       what="$(BASIC_TARGET_WANTS)" && wants=basic.target && $(add-wants)
        what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants)
+       what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants)
 
 define add-wants
        [ -z "$$what" ] || ( \
@@ -219,7 +229,7 @@ define add-wants
          $(MKDIR_P) -m 0755 $$dir && \
          cd $$dir && \
          rm -f $$what && \
-         for i in $$what; do ln -s ../$$i . || exit $$? ; done )
+         for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
 endef
 
 install-directories-hook:
@@ -234,10 +244,10 @@ install-aliases-hook:
                dir= && $(install-aliases)
 
 define install-aliases
-       $(MKDIR_P) /$(DESTDIR)$$dir && \
+       $(MKDIR_P) $(DESTDIR)$$dir && \
        while [ -n "$$1" ]; do \
                rm -f $(DESTDIR)$$dir/$$2 && \
-               ln -s $$1 $(DESTDIR)$$dir/$$2 && \
+               $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
                shift 2 || exit $$?; \
        done
 endef
@@ -260,6 +270,10 @@ AM_V_GPERF = $(AM_V_GPERF_$(V))
 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
 AM_V_GPERF_0 = @echo "  GPERF   " $@;
 
+AM_V_LN = $(AM_V_LN_$(V))
+AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
+AM_V_LN_0 = @echo "  LN      " $@;
+
 # ------------------------------------------------------------------------------
 rootbin_PROGRAMS = \
        systemctl \
@@ -278,11 +292,12 @@ bin_PROGRAMS = \
        systemd-delta \
        systemd-analyze
 
-bin_SCRIPTS = \
+dist_bin_SCRIPTS = \
        src/kernel-install/kernel-install
 
-EXTRA_DIST += \
-       src/kernel-install/kernel-install
+dist_kernelinstall_SCRIPTS = \
+       src/kernel-install/50-depmod.install \
+       src/kernel-install/90-loaderentry.install
 
 rootlibexec_PROGRAMS = \
        systemd \
@@ -318,6 +333,7 @@ systemd_analyze_LDADD = \
 dist_bashcompletion_DATA = \
        shell-completion/bash/journalctl \
        shell-completion/bash/systemctl \
+       shell-completion/bash/systemd-analyze \
        shell-completion/bash/udevadm
 
 dist_tmpfiles_DATA = \
@@ -325,6 +341,9 @@ dist_tmpfiles_DATA = \
        tmpfiles.d/tmp.conf \
        tmpfiles.d/x11.conf
 
+dist_sysctl_DATA = \
+       sysctl.d/50-default.conf
+
 if HAVE_SYSV_COMPAT
 dist_tmpfiles_DATA += \
        tmpfiles.d/legacy.conf
@@ -342,9 +361,13 @@ dist_systemunit_DATA = \
        units/kexec.target \
        units/local-fs.target \
        units/local-fs-pre.target \
+       units/initrd.target \
+       units/initrd-fs.target \
+       units/initrd-root-fs.target \
        units/remote-fs.target \
        units/remote-fs-pre.target \
        units/network.target \
+       units/network-online.target \
        units/nss-lookup.target \
        units/nss-user-lookup.target \
        units/hibernate.target \
@@ -360,6 +383,8 @@ dist_systemunit_DATA = \
        units/sigpwr.target \
        units/sleep.target \
        units/sockets.target \
+       units/timers.target \
+       units/paths.target \
        units/suspend.target \
        units/swap.target \
        units/systemd-initctl.socket \
@@ -382,11 +407,7 @@ dist_systemunit_DATA = \
        units/systemd-udevd-control.socket \
        units/systemd-udevd-kernel.socket \
        units/system-update.target \
-       units/initrd-parse-etc.service \
-       units/initrd-cleanup.service \
-       units/initrd-switch-root.target \
-       units/initrd-udevadm-cleanup-db.service \
-       units/initrd-switch-root.service
+       units/initrd-switch-root.target
 
 nodist_systemunit_DATA = \
        units/getty@.service \
@@ -398,6 +419,7 @@ nodist_systemunit_DATA = \
        units/systemd-remount-fs.service \
        units/systemd-update-utmp-runlevel.service \
        units/systemd-update-utmp-shutdown.service \
+       units/systemd-tmpfiles-setup-dev.service \
        units/systemd-tmpfiles-setup.service \
        units/systemd-tmpfiles-clean.service \
        units/systemd-ask-password-wall.service \
@@ -418,7 +440,12 @@ nodist_systemunit_DATA = \
        units/systemd-udevd.service \
        units/systemd-udev-trigger.service \
        units/systemd-udev-settle.service \
-       units/debug-shell.service
+       units/debug-shell.service \
+       units/initrd-parse-etc.service \
+       units/initrd-cleanup.service \
+       units/initrd-udevadm-cleanup-db.service \
+       units/initrd-switch-root.service \
+       units/systemd-nspawn@.service
 
 dist_userunit_DATA = \
        units/user/default.target \
@@ -438,6 +465,7 @@ EXTRA_DIST += \
        units/systemd-remount-fs.service.in \
        units/systemd-update-utmp-runlevel.service.in \
        units/systemd-update-utmp-shutdown.service.in \
+       units/systemd-tmpfiles-setup-dev.service.in \
        units/systemd-tmpfiles-setup.service.in \
        units/systemd-tmpfiles-clean.service.in \
        units/systemd-ask-password-wall.service.in \
@@ -460,8 +488,12 @@ EXTRA_DIST += \
        units/systemd-hybrid-sleep.service.in \
        units/systemd-suspend.service.in \
        units/quotaon.service.in \
-       introspect.awk \
-       man/custom-html.xsl
+       units/initrd-parse-etc.service.in \
+       units/initrd-cleanup.service.in \
+       units/initrd-udevadm-cleanup-db.service.in \
+       units/initrd-switch-root.service.in \
+       units/systemd-nspawn@.service.in \
+       introspect.awk
 
 CLEANFILES += \
        units/console-shell.service.m4 \
@@ -500,33 +532,49 @@ include Makefile-man.am
 
 XML_FILES = \
        ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
+HTML_FILES = \
+       ${XML_FILES:.xml=.html}
+HTML_ALIAS = \
+       ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
 
 if ENABLE_MANPAGES
 man_MANS = \
        $(MANPAGES) \
        $(MANPAGES_ALIAS)
 
-noinst_DATA = \
-       ${XML_FILES:.xml=.html}
+noinst_DATA += \
+       $(HTML_FILES) \
+       $(HTML_ALIAS)
 
 CLEANFILES += \
-       $(MANPAGES) \
-       $(MANPAGES_ALIAS) \
-       ${XML_FILES:.xml=.html}
+       $(man_MANS) \
+       $(HTML_FILES) \
+       $(HTML_ALIAS)
+
+docs/html/man:
+       $(AM_V_at)$(MKDIR_P) $(dir $@)
+       $(AM_V_LN)$(LN_S) -f ../../man $@
+
+noinst_DATA += \
+       docs/html/man
+
+CLEANFILES += \
+       docs/html/man
 
 if HAVE_PYTHON
+man/index.html: man/systemd.index.html
+       $(AM_V_LN)$(LN_S) -f systemd.index.html $@
+
 noinst_DATA += \
        man/index.html
 
 CLEANFILES += \
-       man/index.html
-
-man/index.html:
-       $(AM_V_GEN)$(LN_S) -f systemd.index.html $@
+       man/index.html
 
+XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
+SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
 
-XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_srcdir)/man/*.xml.in $(top_builddir)/man/*.xml)
 update-man-list: make-man-rules.py $(XML_GLOB)
        $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
        $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
@@ -534,28 +582,33 @@ update-man-list: make-man-rules.py $(XML_GLOB)
 
 man/systemd.index.xml: make-man-index.py $(NON_INDEX_XML_FILES)
        $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(PYTHON) $^ > $@
+       $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
 
-man/systemd.directives.xml: make-directive-index.py $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
+man/systemd.directives.xml: make-directive-index.py $(SOURCE_XML_FILES)
        $(AM_V_at)$(MKDIR_P) $(dir $@)
-       $(AM_V_GEN)$(PYTHON) $^ > $@
+       $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
 
 EXTRA_DIST += \
        man/systemd.index.xml \
        man/index.html \
        man/systemd.directives.xml
 
+CLEANFILES += \
+       man/systemd.index.xml \
+       man/systemd.directives.xml
+
 endif
 
 endif
 
 EXTRA_DIST += \
        $(XML_FILES) \
-       ${XML_FILES:.xml=.html} \
-       $(MANPAGES) \
-       $(MANPAGES_ALIAS) \
+       $(HTML_FILES) \
+       $(HTML_ALIAS) \
+       $(dist_MANS) \
        make-man-index.py \
-       make-directive-index.py
+       make-directive-index.py \
+       xml_helper.py
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -587,6 +640,10 @@ libsystemd_shared_la_SOURCES = \
        src/shared/set.h \
        src/shared/fdset.c \
        src/shared/fdset.h \
+       src/shared/prioq.c \
+       src/shared/prioq.h \
+       src/shared/sleep-config.c \
+       src/shared/sleep-config.h \
        src/shared/strv.c \
        src/shared/strv.h \
        src/shared/env-util.c \
@@ -624,8 +681,6 @@ libsystemd_shared_la_SOURCES = \
        src/shared/watchdog.h \
        src/shared/spawn-ask-password-agent.c \
        src/shared/spawn-ask-password-agent.h \
-       src/shared/specifier.c \
-       src/shared/specifier.h \
        src/shared/replace-var.c \
        src/shared/replace-var.h \
        src/shared/spawn-polkit-agent.c \
@@ -638,7 +693,9 @@ libsystemd_shared_la_SOURCES = \
        src/shared/calendarspec.h \
        src/shared/fileio.c \
        src/shared/fileio.h \
-       src/shared/output-mode.h
+       src/shared/output-mode.h \
+       src/shared/MurmurHash3.c \
+       src/shared/MurmurHash3.h
 
 #-------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -669,7 +726,9 @@ libsystemd_units_la_SOURCES = \
        src/shared/install-printf.c \
        src/shared/install-printf.h \
        src/shared/path-lookup.c \
-       src/shared/path-lookup.h
+       src/shared/path-lookup.h \
+       src/shared/specifier.c \
+       src/shared/specifier.h
 
 libsystemd_units_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -758,7 +817,8 @@ libsystemd_acl_la_CFLAGS = \
        $(ACL_CFLAGS)
 
 libsystemd_acl_la_LIBADD = \
-       $(ACL_LIBS)
+       $(ACL_LIBS) \
+       libsystemd-shared.la
 endif
 
 # ------------------------------------------------------------------------------
@@ -842,6 +902,8 @@ libsystemd_core_la_SOURCES = \
        src/core/selinux-access.h \
        src/core/selinux-setup.c \
        src/core/selinux-setup.h \
+       src/core/smack-setup.c \
+       src/core/smack-setup.h \
        src/core/ima-setup.c \
        src/core/ima-setup.h \
        src/core/locale-setup.h \
@@ -1014,7 +1076,7 @@ CLEANFILES += \
        src/core/org.freedesktop.systemd1.policy.in
 
 # ------------------------------------------------------------------------------
-noinst_PROGRAMS += \
+manual_tests += \
        test-engine \
        test-ns \
        test-loopback \
@@ -1025,11 +1087,12 @@ noinst_PROGRAMS += \
        test-watchdog \
        test-log
 
-noinst_tests += \
+tests += \
        test-job-type \
        test-env-replace \
        test-strbuf \
        test-strv \
+       test-path-util \
        test-strxcpyx \
        test-unit-name \
        test-unit-file \
@@ -1040,7 +1103,11 @@ noinst_tests += \
        test-sched-prio \
        test-calendarspec \
        test-strip-tab-ansi \
-       test-cgroup-util
+       test-cgroup-util \
+       test-prioq \
+       test-fileio \
+       test-time \
+       test-hashmap
 
 EXTRA_DIST += \
        test/sched_idle_bad.service \
@@ -1092,7 +1159,7 @@ test_hostname_LDADD = \
        libsystemd-core.la
 
 if ENABLE_EFI
-noinst_PROGRAMS += \
+manual_tests += \
        test-efivars
 
 test_efivars_SOURCES = \
@@ -1131,6 +1198,42 @@ test_util_CFLAGS = \
 test_util_LDADD = \
        libsystemd-core.la
 
+test_hashmap_SOURCES = \
+       src/test/test-hashmap.c
+
+test_hashmap_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_hashmap_LDADD = \
+       libsystemd-core.la
+
+test_prioq_SOURCES = \
+       src/test/test-prioq.c
+
+test_prioq_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_prioq_LDADD = \
+       libsystemd-core.la
+
+test_fileio_SOURCES = \
+       src/test/test-fileio.c
+
+test_fileio_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_fileio_LDADD = \
+       libsystemd-core.la
+
+test_time_SOURCES = \
+       src/test/test-time.c
+
+test_time_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_time_LDADD = \
+       libsystemd-core.la
+
 test_log_SOURCES = \
        src/test/test-log.c
 
@@ -1205,8 +1308,15 @@ test_strv_SOURCES = \
 
 test_strv_LDADD = \
        libsystemd-shared.la \
+       libsystemd-units.la \
        libsystemd-id128-internal.la
 
+test_path_util_SOURCES = \
+       src/test/test-path-util.c
+
+test_path_util_LDADD = \
+       libsystemd-shared.la
+
 test_strxcpyx_SOURCES = \
        src/test/test-strxcpyx.c
 
@@ -1316,12 +1426,10 @@ rootlibexec_PROGRAMS += \
 
 nodist_systemunit_DATA += \
        units/systemd-modules-load.service
+
 SYSINIT_TARGET_WANTS += \
        systemd-modules-load.service
 
-dist_udevrules_DATA += \
-       rules/80-drivers.rules
-
 endif
 
 EXTRA_DIST += \
@@ -1551,7 +1659,9 @@ systemd_stdio_bridge_SOURCES = \
        src/stdio-bridge/stdio-bridge.c
 
 systemd_stdio_bridge_LDADD = \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-daemon.la
 
 # ------------------------------------------------------------------------------
 systemd_tty_ask_password_agent_SOURCES = \
@@ -1566,7 +1676,7 @@ libsystemd_daemon_la_SOURCES = \
        src/libsystemd-daemon/sd-daemon.c
 
 libsystemd_daemon_internal_la_SOURCES = \
-        $(libsystemd_daemon_la_SOURCES)
+       $(libsystemd_daemon_la_SOURCES)
 
 libsystemd_daemon_la_CFLAGS = \
        $(AM_CFLAGS) \
@@ -1595,7 +1705,7 @@ lib_LTLIBRARIES += \
        libsystemd-daemon.la
 
 noinst_LTLIBRARIES += \
-        libsystemd-daemon-internal.la
+       libsystemd-daemon-internal.la
 
 pkgconfiglib_DATA += \
        src/libsystemd-daemon/libsystemd-daemon.pc
@@ -1604,10 +1714,134 @@ EXTRA_DIST += \
        src/libsystemd-daemon/libsystemd-daemon.pc.in \
        src/libsystemd-daemon/libsystemd-daemon.sym
 
+# ------------------------------------------------------------------------------
+libsystemd_bus_la_SOURCES = \
+       src/systemd/sd-bus.h \
+       src/systemd/sd-bus-protocol.h \
+       src/libsystemd-bus/sd-bus.c \
+       src/libsystemd-bus/bus-control.c \
+       src/libsystemd-bus/bus-control.h \
+       src/libsystemd-bus/bus-error.c \
+       src/libsystemd-bus/bus-error.h \
+       src/libsystemd-bus/bus-internal.c \
+       src/libsystemd-bus/bus-internal.h \
+       src/libsystemd-bus/bus-socket.c \
+       src/libsystemd-bus/bus-socket.h \
+       src/libsystemd-bus/bus-kernel.c \
+       src/libsystemd-bus/bus-kernel.h \
+       src/libsystemd-bus/bus-message.c \
+       src/libsystemd-bus/bus-message.h \
+       src/libsystemd-bus/bus-signature.c \
+       src/libsystemd-bus/bus-signature.h \
+       src/libsystemd-bus/bus-type.c \
+       src/libsystemd-bus/bus-type.h \
+       src/libsystemd-bus/bus-match.c \
+       src/libsystemd-bus/bus-match.h \
+       src/libsystemd-bus/bus-bloom.c \
+       src/libsystemd-bus/bus-bloom.h \
+       src/libsystemd-bus/kdbus.h
+
+libsystemd_bus_la_LIBADD =  \
+       libsystemd-id128-internal.la \
+       libsystemd-shared.la \
+       libsystemd-daemon.la
+
+noinst_LTLIBRARIES += \
+       libsystemd-bus.la
+
+tests += \
+       test-bus-marshal \
+       test-bus-signature \
+       test-bus-chat \
+       test-bus-server \
+       test-bus-match \
+       test-bus-kernel
+
+noinst_PROGRAMS += \
+       busctl
+
+test_bus_marshal_SOURCES = \
+       src/libsystemd-bus/test-bus-marshal.c
+
+test_bus_marshal_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       $(GLIB_LIBS) \
+       $(DBUS_LIBS)
+
+test_bus_marshal_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(GLIB_CFLAGS) \
+       $(DBUS_CFLAGS)
+
+test_bus_signature_SOURCES = \
+       src/libsystemd-bus/test-bus-signature.c
+
+test_bus_signature_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la
+
+test_bus_chat_SOURCES = \
+       src/libsystemd-bus/test-bus-chat.c
+
+test_bus_chat_CFLAGS = \
+       $(AM_CFLAGS) \
+       -pthread
+
+test_bus_chat_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-id128-internal.la
+
+test_bus_server_SOURCES = \
+       src/libsystemd-bus/test-bus-server.c
+
+test_bus_server_CFLAGS = \
+       $(AM_CFLAGS) \
+       -pthread
+
+test_bus_server_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-id128-internal.la
+
+test_bus_match_SOURCES = \
+       src/libsystemd-bus/test-bus-match.c
+
+test_bus_match_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_bus_match_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-id128-internal.la
+
+test_bus_kernel_SOURCES = \
+       src/libsystemd-bus/test-bus-kernel.c
+
+test_bus_kernel_CFLAGS = \
+       $(AM_CFLAGS)
+
+test_bus_kernel_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la \
+       libsystemd-id128-internal.la
+
+busctl_SOURCES = \
+       src/libsystemd-bus/busctl.c
+
+busctl_LDADD = \
+       libsystemd-shared.la \
+       libsystemd-bus.la
+
 # ------------------------------------------------------------------------------
 if ENABLE_GTK_DOC
 SUBDIRS += \
        docs/libudev
+
+noinst_DATA += \
+       docs/html/libudev \
+       docs/html/gudev
 endif
 
 include_HEADERS += \
@@ -1650,7 +1884,17 @@ EXTRA_DIST += \
        src/libudev/libudev.sym
 
 CLEANFILES += \
-       src/libudev/libudev.pc
+       src/libudev/libudev.pc \
+       docs/html/libudev \
+       docs/html/gudev
+
+docs/html/libudev:
+       $(AM_V_at)$(MKDIR_P) $(dir $@)
+       $(AM_V_LN)$(LN_S) -f ../libudev/html $@
+
+docs/html/gudev:
+       $(AM_V_at)$(MKDIR_P) $(dir $@)
+       $(AM_V_LN)$(LN_S) -f ../gudev/html $@
 
 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
 libudev-install-hook:
@@ -1700,9 +1944,9 @@ dist_udevrules_DATA += \
        rules/95-udev-late.rules
 
 dist_udevhwdb_DATA = \
-       hwdb/20-pci-vendor-product.hwdb \
+       hwdb/20-pci-vendor-model.hwdb \
        hwdb/20-pci-classes.hwdb \
-       hwdb/20-usb-vendor-product.hwdb \
+       hwdb/20-usb-vendor-model.hwdb \
        hwdb/20-usb-classes.hwdb \
        hwdb/20-bluetooth-vendor-product.hwdb \
        hwdb/20-acpi-vendor.hwdb \
@@ -1741,7 +1985,7 @@ SYSINIT_TARGET_WANTS += \
        systemd-udevd.service \
        systemd-udev-trigger.service
 
-bin_PROGRAMS += \
+rootbin_PROGRAMS += \
        udevadm
 
 rootlibexec_PROGRAMS += \
@@ -1759,7 +2003,6 @@ libudev_core_la_SOURCES = \
        src/udev/udev-ctrl.c \
        src/udev/udev-builtin.c \
        src/udev/udev-builtin-btrfs.c \
-       src/udev/udev-builtin-firmware.c \
        src/udev/udev-builtin-hwdb.c \
        src/udev/udev-builtin-input_id.c \
        src/udev/udev-builtin-net_id.c \
@@ -1783,9 +2026,20 @@ libudev_core_la_CPPFLAGS = \
        $(AM_CPPFLAGS) \
        -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
 
+if ENABLE_FIRMWARE
+libudev_core_la_SOURCES += \
+       src/udev/udev-builtin-firmware.c
+
+dist_udevrules_DATA += \
+       rules/50-firmware.rules
+endif
+
 if HAVE_KMOD
 libudev_core_la_SOURCES += \
        src/udev/udev-builtin-kmod.c
+
+dist_udevrules_DATA += \
+       rules/80-drivers.rules
 endif
 
 if HAVE_BLKID
@@ -1827,7 +2081,7 @@ udevadm_LDADD = \
 # Update hwdb on installation. Do not bother if installing
 # in DESTDIR, since this is likely for packaging purposes.
 hwdb-update-hook:
-       -test -n "$(DESTDIR)" || $(bindir)/udevadm hwdb --update
+       -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
 
 INSTALL_DATA_HOOKS += \
        hwdb-update-hook
@@ -1840,7 +2094,7 @@ TESTS += \
        test/udev-test.pl \
        test/rules-test.sh
 
-noinst_PROGRAMS += \
+manual_tests += \
        test-libudev \
        test-udev
 
@@ -2188,6 +2442,7 @@ dist_udevkeymap_DATA = \
        keymaps/hewlett-packard-tablet \
        keymaps/hewlett-packard-tx2 \
        keymaps/hewlett-packard_elitebook-8440p \
+       keymaps/hewlett-packard_elitebook-8460p \
        keymaps/hewlett-packard-hdx9494nr \
        keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
        keymaps/inventec-symphony_6.0_7.0 \
@@ -2279,7 +2534,8 @@ libsystemd_id128_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
 
 libsystemd_id128_la_LIBADD = \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-daemon-internal.la
 
 libsystemd_id128_internal_la_SOURCES = \
        $(libsystemd_id128_la_SOURCES)
@@ -2291,7 +2547,7 @@ test_id128_LDADD = \
        libsystemd-shared.la \
        libsystemd-id128-internal.la
 
-noinst_tests += \
+tests += \
        test-id128
 
 pkginclude_HEADERS += \
@@ -2361,6 +2617,11 @@ journalctl_LDADD = \
        libsystemd-id128-internal.la \
        libsystemd-logs.la
 
+if HAVE_ACL
+journalctl_LDADD += \
+       libsystemd-acl.la
+endif
+
 if HAVE_QRENCODE
 journalctl_SOURCES += \
        src/journal/journal-qrcode.c \
@@ -2566,7 +2827,7 @@ endif
 # "adm" and "wheel".
 libsystemd-journal-install-hook:
        libname=libsystemd-journal.so && $(move-to-rootlibdir)
-       $(MKDIR_P) $(DESTDIR)/var/log/journal
+       -$(MKDIR_P) $(DESTDIR)/var/log/journal
        -chown 0:0 $(DESTDIR)/var/log/journal
        -chmod 755 $(DESTDIR)/var/log/journal
        -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
@@ -2594,18 +2855,18 @@ catalog-remove-hook:
 UNINSTALL_DATA_HOOKS += \
        catalog-remove-hook
 
-noinst_PROGRAMS += \
-       test-journal-enum \
-       test-catalog
+manual_tests += \
+       test-journal-enum
 
-noinst_tests += \
+tests += \
        test-journal \
        test-journal-send \
        test-journal-syslog \
        test-journal-match \
        test-journal-stream \
        test-journal-verify \
-       test-mmap-cache
+       test-mmap-cache \
+       test-catalog
 
 pkginclude_HEADERS += \
        src/systemd/sd-journal.h \
@@ -2676,6 +2937,7 @@ systemd_journal_gatewayd_LDADD = \
        libsystemd-journal-internal.la \
        libsystemd-id128-internal.la \
        libsystemd-daemon.la \
+       libsystemd-bus.la \
        $(MICROHTTPD_LIBS)
 
 systemd_journal_gatewayd_CFLAGS = \
@@ -2729,14 +2991,14 @@ dist_bashcompletion_DATA += \
        shell-completion/bash/systemd-coredumpctl
 
 sysctl_DATA = \
-       sysctl.d/coredump.conf
+       sysctl.d/50-coredump.conf
 
 CLEANFILES += \
-       sysctl.d/coredump.conf
+       sysctl.d/50-coredump.conf
 endif
 
 EXTRA_DIST += \
-       sysctl.d/coredump.conf.in
+       sysctl.d/50-coredump.conf.in
 
 # ------------------------------------------------------------------------------
 if ENABLE_BINFMT
@@ -2833,11 +3095,14 @@ if ENABLE_BOOTCHART
 systemd_bootchart_SOURCES = \
        src/bootchart/bootchart.c \
        src/bootchart/bootchart.h \
-       src/bootchart/log.c \
-       src/bootchart/svg.c
+       src/bootchart/store.c \
+       src/bootchart/store.h \
+       src/bootchart/svg.c \
+       src/bootchart/svg.h
 
 systemd_bootchart_LDADD = \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-journal.la
 
 rootlibexec_PROGRAMS += \
        systemd-bootchart
@@ -3216,8 +3481,8 @@ systemd_logind_CFLAGS = \
 
 systemd_logind_LDADD = \
        libsystemd-label.la \
-       libsystemd-shared.la \
        libsystemd-audit.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        libsystemd-dbus.la \
        libudev.la
@@ -3291,7 +3556,7 @@ test_inhibit_CFLAGS = \
        $(AM_CFLAGS) \
        $(DBUS_CFLAGS)
 
-noinst_PROGRAMS += \
+manual_tests += \
        test-login \
        test-inhibit
 
@@ -3308,7 +3573,8 @@ libsystemd_login_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/login/libsystemd-login.sym
 
 libsystemd_login_la_LIBADD = \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-daemon-internal.la
 
 libsystemd_login_internal_la_SOURCES = \
        $(libsystemd_login_la_SOURCES)
@@ -3332,10 +3598,10 @@ pam_systemd_la_LDFLAGS = \
        -export-symbols-regex '^pam_sm_.*'
 
 pam_systemd_la_LIBADD = \
-       libsystemd-daemon.la \
        libsystemd-audit.la \
        libsystemd-dbus.la \
        libsystemd-shared.la \
+       libsystemd-daemon-internal.la \
        $(PAM_LIBS)
 
 pamlib_LTLIBRARIES = \
@@ -3431,6 +3697,7 @@ if HAVE_PYTHON_DEVEL
 pkgpyexec_LTLIBRARIES = \
        _journal.la \
        id128.la \
+       _daemon.la \
        _reader.la
 
 _journal_la_SOURCES = \
@@ -3438,7 +3705,7 @@ _journal_la_SOURCES = \
 
 _journal_la_CFLAGS = \
        $(AM_CFLAGS) \
-        -fvisibility=default \
+       -fvisibility=default \
        $(PYTHON_CFLAGS)
 
 _journal_la_LDFLAGS = \
@@ -3459,7 +3726,7 @@ id128_la_SOURCES = \
 
 id128_la_CFLAGS = \
        $(AM_CFLAGS) \
-        -fvisibility=default \
+       -fvisibility=default \
        $(PYTHON_CFLAGS) \
        -I$(top_builddir)/src/python-systemd
 
@@ -3473,6 +3740,27 @@ id128_la_LIBADD = \
        $(PYTHON_LIBS) \
        libsystemd-id128.la
 
+_daemon_la_SOURCES = \
+       src/python-systemd/_daemon.c \
+       src/python-systemd/pyutil.c \
+       src/python-systemd/pyutil.h
+
+_daemon_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       -fvisibility=default \
+       $(PYTHON_CFLAGS) \
+       -I$(top_builddir)/src/python-systemd
+
+_daemon_la_LDFLAGS = \
+       $(AM_LDFLAGS) \
+       -shared \
+       -module \
+       -avoid-version
+
+_daemon_la_LIBADD = \
+       $(PYTHON_LIBS) \
+       libsystemd-daemon.la
+
 _reader_la_SOURCES = \
        src/python-systemd/_reader.c \
        src/python-systemd/pyutil.c \
@@ -3480,7 +3768,7 @@ _reader_la_SOURCES = \
 
 _reader_la_CFLAGS = \
        $(AM_CFLAGS) \
-        -fvisibility=default \
+       -fvisibility=default \
        $(PYTHON_CFLAGS)
 
 _reader_la_LDFLAGS = \
@@ -3493,10 +3781,12 @@ _reader_la_LIBADD = \
        $(PYTHON_LIBS) \
        libsystemd-journal.la \
        libsystemd-id128.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-daemon-internal.la
 
 dist_pkgpyexec_PYTHON = \
        src/python-systemd/journal.py \
+       src/python-systemd/daemon.py \
        src/python-systemd/__init__.py
 
 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h Makefile
@@ -3505,63 +3795,72 @@ src/python-systemd/id128-constants.h: src/systemd/sd-messages.h Makefile
 
 BUILT_SOURCES += \
        src/python-systemd/id128-constants.h
-endif
 
-PAPER = $(shell cat /etc/papersize 2>/dev/null || echo a4)
-SPHINXOPTS = -D latex_paper_size=$(PAPER)
+SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
 sphinx-%:
        $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
-       $(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/man/python-systemd/
-       $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/man/python-systemd/
+       $(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/docs/html/python-systemd/
+       $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
 
 destdir-sphinx: all
        dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
                $(MAKE) DESTDIR="$$dir" install && \
-               $(MAKE) DESTDIR="$$dir" sphinx-html && \
+               $(MAKE) DESTDIR="$$dir" sphinx-html && \
                rm -rf "$$dir"
 
+endif
+
+CLEAN_LOCAL_HOOKS += clean-sphinx
+
+clean-sphinx:
+       -rm -rf docs/html/python-systemd/
+
 # ------------------------------------------------------------------------------
+substitutions = \
+       '|rootlibexecdir=$(rootlibexecdir)|' \
+       '|rootbindir=$(rootbindir)|' \
+       '|bindir=$(bindir)|' \
+       '|SYSTEMCTL=$(rootbindir)/systemctl|' \
+       '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
+       '|pkgsysconfdir=$(pkgsysconfdir)|' \
+       '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
+       '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
+       '|pkgdatadir=$(pkgdatadir)|' \
+       '|systemunitdir=$(systemunitdir)|' \
+       '|userunitdir=$(userunitdir)|' \
+       '|systempresetdir=$(systempresetdir)|' \
+       '|userpresetdir=$(userpresetdir)|' \
+       '|udevhwdbdir=$(udevhwdbdir)|' \
+       '|udevrulesdir=$(udevrulesdir)|' \
+       '|catalogdir=$(catalogdir)|' \
+       '|tmpfilesdir=$(tmpfilesdir)|' \
+       '|sysctldir=$(sysctldir)|' \
+       '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
+       '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
+       '|PACKAGE_URL=$(PACKAGE_URL)|' \
+       '|RANDOM_SEED=$(localstatedir)/lib/random-seed|' \
+       '|prefix=$(prefix)|' \
+       '|exec_prefix=$(exec_prefix)|' \
+       '|libdir=$(libdir)|' \
+       '|includedir=$(includedir)|' \
+       '|VERSION=$(VERSION)|' \
+       '|rootprefix=$(rootprefix)|' \
+       '|udevlibexecdir=$(udevlibexecdir)|' \
+       '|SUSHELL=$(SUSHELL)|' \
+       '|DEBUGTTY=$(DEBUGTTY)|' \
+       '|KILL=$(KILL)|' \
+       '|QUOTAON=$(QUOTAON)|' \
+       '|QUOTACHECK=$(QUOTACHECK)|' \
+       '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
+       '|VARLOGDIR=$(varlogdir)|' \
+       '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
+       '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
+       '|PYTHON=$(PYTHON)|' \
+       '|PYTHON_BINARY=$(PYTHON_BINARY)|'
+
 SED_PROCESS = \
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
-       $(SED)  -e 's,@rootlibexecdir\@,$(rootlibexecdir),g' \
-               -e 's,@rootbindir\@,$(rootbindir),g' \
-               -e 's,@bindir\@,$(bindir),g' \
-               -e 's,@SYSTEMCTL\@,$(rootbindir)/systemctl,g' \
-               -e 's,@SYSTEMD_NOTIFY\@,$(rootbindir)/systemd-notify,g' \
-               -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
-               -e 's,@SYSTEM_CONFIG_UNIT_PATH\@,$(pkgsysconfdir)/system,g' \
-               -e 's,@USER_CONFIG_UNIT_PATH\@,$(pkgsysconfdir)/user,g' \
-               -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
-               -e 's,@systemunitdir\@,$(systemunitdir),g' \
-               -e 's,@userunitdir\@,$(userunitdir),g' \
-               -e 's,@systempresetdir\@,$(systempresetdir),g' \
-               -e 's,@userpresetdir\@,$(userpresetdir),g' \
-               -e 's,@udevhwdbdir\@,$(udevhwdbdir),g' \
-               -e 's,@udevrulesdir\@,$(udevrulesdir),g' \
-               -e 's,@catalogdir\@,$(catalogdir),g' \
-               -e 's,@tmpfilesdir\@,$(tmpfilesdir),g' \
-               -e 's,@sysctldir\@,$(sysctldir),g' \
-               -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
-               -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
-               -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
-               -e 's,@RANDOM_SEED\@,$(localstatedir)/lib/random-seed,g' \
-               -e 's,@prefix\@,$(prefix),g' \
-               -e 's,@exec_prefix\@,$(exec_prefix),g' \
-               -e 's,@libdir\@,$(libdir),g' \
-               -e 's,@includedir\@,$(includedir),g' \
-               -e 's,@VERSION\@,$(VERSION),g' \
-               -e 's,@rootprefix\@,$(rootprefix),g' \
-               -e 's,@udevlibexecdir\@,$(udevlibexecdir),g' \
-               -e 's,@sushell\@,$(sushell),g' \
-               -e 's,@KILL\@,$(KILL),g' \
-               -e 's,@QUOTAON\@,$(QUOTAON),g' \
-               -e 's,@QUOTACHECK\@,$(QUOTACHECK),g' \
-               -e 's,@SYSTEM_SYSVINIT_PATH\@,$(sysvinitdir),g' \
-               -e 's,@VARLOGDIR\@,$(varlogdir),g' \
-               -e 's,@RC_LOCAL_SCRIPT_PATH_START\@,$(RC_LOCAL_SCRIPT_PATH_START),g' \
-               -e 's,@RC_LOCAL_SCRIPT_PATH_STOP\@,$(RC_LOCAL_SCRIPT_PATH_STOP),g' \
-               -e 's,@PYTHON\@,$(PYTHON),g' \
-               -e 's,@PYTHON_BINARY\@,$(PYTHON_BINARY),g' \
+       $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
                < $< > $@
 
 units/%: units/%.in Makefile
@@ -3618,52 +3917,64 @@ EXTRA_DIST += \
 CLEANFILES += \
        $(nodist_systemunit_DATA) \
        $(nodist_userunit_DATA) \
-       $(nodist_man_MANS) \
        $(pkgconfigdata_DATA) \
        $(pkgconfiglib_DATA) \
        $(nodist_polkitpolicy_DATA)
 
 # ------------------------------------------------------------------------------
 if ENABLE_MANPAGES
+man/custom-entities.ent: Makefile
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@)
+       $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
+        echo '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">,$(substitutions))))') \
+        > $@ # '
+
+DISTCLEANFILES += \
+       man/custom-entities.ent
+
 XSLTPROC_FLAGS = \
        --nonet \
        --stringparam man.output.quietly 1 \
        --stringparam funcsynopsis.style ansi \
-       --stringparam man.th.extra1.suppress 1 \
        --stringparam man.authors.section.enabled 0 \
-       --stringparam man.copyright.section.enabled 0
+       --stringparam man.copyright.section.enabled 0 \
+       --stringparam systemd.version $(VERSION) \
+       --path '$(builddir)/man:$(srcdir)/man'
 
 XSLTPROC_PROCESS_MAN = \
-       $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
-       $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+       $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
 
 XSLTPROC_PROCESS_HTML = \
-       $(AM_V_XSLT)$(MKDIR_P) $(dir $@) && \
-       $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
+       $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
 
-man/%.1: man/%.xml
+man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.3: man/%.xml
+man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.5: man/%.xml
+man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.7: man/%.xml
+man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.8: man/%.xml
+man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
        $(XSLTPROC_PROCESS_MAN)
 
-man/%.html: man/%.xml man/custom-html.xsl
+man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
        $(XSLTPROC_PROCESS_HTML)
 
-CLEANFILES += \
-       $(dist_man_MANS) \
-       ${XML_FILES:.xml=.html}
+define html-alias
+       $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
+endef
+
 endif
 
+EXTRA_DIST += \
+       man/custom-html.xsl \
+       man/custom-man.xsl
+
 # ------------------------------------------------------------------------------
 DBUS_PREPROCESS = $(CPP) -P $(CFLAGS) $(DBUS_CFLAGS) -imacros dbus/dbus-protocol.h
 
@@ -3726,10 +4037,11 @@ SYSINIT_TARGET_WANTS += \
        sys-kernel-config.mount \
        sys-kernel-debug.mount \
        sys-fs-fuse-connections.mount \
+       systemd-tmpfiles-setup-dev.service \
        systemd-tmpfiles-setup.service \
        systemd-sysctl.service \
        systemd-ask-password-console.path
-BASIC_TARGET_WANTS += \
+TIMERS_TARGET_WANTS += \
        systemd-tmpfiles-clean.timer
 
 if HAVE_SYSV_COMPAT
@@ -3751,9 +4063,12 @@ SYSTEM_UNIT_ALIASES += \
 USER_UNIT_ALIASES += \
        $(systemunitdir)/shutdown.target shutdown.target \
        $(systemunitdir)/sockets.target sockets.target \
+       $(systemunitdir)/timers.target timers.target \
+       $(systemunitdir)/paths.target paths.target \
        $(systemunitdir)/bluetooth.target bluetooth.target \
        $(systemunitdir)/printer.target printer.target \
-       $(systemunitdir)/sound.target sound.target
+       $(systemunitdir)/sound.target sound.target \
+       $(systemunitdir)/smartcard.target smartcard.target
 
 GENERAL_ALIASES += \
        $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
@@ -3777,6 +4092,8 @@ INSTALL_DIRS += \
        $(sysconfdir)/modules-load.d \
        $(prefix)/lib/sysctl.d \
        $(sysconfdir)/sysctl.d \
+       $(prefix)/lib/kernel/install.d \
+       $(sysconfdir)/kernel/install.d \
        $(systemshutdowndir) \
        $(systemsleepdir) \
        $(systemgeneratordir) \
@@ -3798,10 +4115,10 @@ install-data-hook: $(INSTALL_DATA_HOOKS)
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 
-clean-local:
+clean-local: $(CLEAN_LOCAL_HOOKS)
        rm -rf $(abs_srcdir)/install-tree
        rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
-              $(abs_srcdir)/hwdb/iab.txt
+             $(abs_srcdir)/hwdb/iab.txt
 
 DISTCHECK_CONFIGURE_FLAGS = \
        --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
@@ -3832,10 +4149,14 @@ hwdb-update:
        ( cd $(top_srcdir)/hwdb && \
        wget -N http://www.linux-usb.org/usb.ids \
                http://pci-ids.ucw.cz/v2.2/pci.ids \
-               http://standards.ieee.org/develop/regauth/oui/oui.txt \
+               http://standards.ieee.org/develop/regauth/oui/oui.txt \
                http://standards.ieee.org/develop/regauth/iab/iab.txt && \
        ./ids-update.pl )
 
+kdbus-update:
+       ( cd $(top_srcdir)/src/libsystemd-bus/ && \
+       wget -N https://d-bus.googlecode.com/git/kdbus.h )
+
 upload: all distcheck
        cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
        scp systemd-$(VERSION).tar.xz fdo:/srv/www.freedesktop.org/www/software/systemd/
@@ -3844,11 +4165,11 @@ upload: all distcheck
 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
 doc-sync: all destdir-sphinx
        gtkdoc-rebase --html-dir=docs/libudev/html --online
-       rsync -av --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
+       rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
        gtkdoc-rebase --html-dir=docs/gudev/html --online
-       rsync -av --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
-       rsync -av --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
-       rsync -av --delete --omit-dir-times man/python-systemd/ $(www_target)/man/python-systemd/
+       rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
+       rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
+       rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
 
 git-tag:
        git tag "v$(VERSION)" -m "systemd $(VERSION)"