1 From 0862099d0bf5a3ec8b2e9d538458d612897741a2 Mon Sep 17 00:00:00 2001
2 From: Mike Gelfand <mikedld@mikedld.com>
3 Date: Sat, 23 Apr 2016 16:13:25 +0000
4 Subject: [PATCH] #5921: Use libsystemd instead of libsystemd-daemon (original
5 patches by Sandro Tosi and Mike Gilbert)
7 In systemd v209, released over two years ago, the various libsystemd-*
8 libraries (libsystemd-journal.so, libsystemd-login.so, libsystem-daemon.so,
9 libsystemd-id128.so) were merged into a single libsystemd.so library to
10 reduce code duplication and avoid cyclic dependencies.
12 Downloaded from upstream commit:
13 https://github.com/transmission/transmission/commit/0862099d0bf5a3ec8b2e9d538458d612897741a2
15 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
17 CMakeLists.txt | 4 ++--
18 configure.ac | 16 ++++++++--------
19 daemon/CMakeLists.txt | 8 ++++----
20 daemon/Makefile.am | 4 ++--
21 daemon/daemon.c | 2 +-
22 5 files changed, 17 insertions(+), 17 deletions(-)
24 diff --git a/CMakeLists.txt b/CMakeLists.txt
25 index 8b324dc..356fc2f 100644
28 @@ -398,9 +398,9 @@ endif()
30 tr_get_required_flag(WITH_SYSTEMD SYSTEMD_IS_REQUIRED)
32 - pkg_check_modules(SYSTEMD_DAEMON ${SYSTEMD_IS_REQUIRED} libsystemd-daemon)
33 + pkg_check_modules(SYSTEMD ${SYSTEMD_IS_REQUIRED} libsystemd)
35 - tr_fixup_auto_option(WITH_SYSTEMD SYSTEMD_DAEMON_FOUND SYSTEMD_IS_REQUIRED)
36 + tr_fixup_auto_option(WITH_SYSTEMD SYSTEMD_FOUND SYSTEMD_IS_REQUIRED)
39 include_directories(${CMAKE_BINARY_DIR})
40 diff --git a/configure.ac b/configure.ac
41 index 92e4372..b64f2a3 100644
44 @@ -240,15 +240,15 @@ dnl
45 dnl file monitoring for the daemon
47 # Check whether to enable systemd startup notification.
48 -# This requires libsystemd-daemon.
49 -AC_ARG_WITH([systemd-daemon], AS_HELP_STRING([--with-systemd-daemon],
50 +# This requires libsystemd.
51 +AC_ARG_WITH([systemd], AS_HELP_STRING([--with-systemd],
52 [Add support for systemd startup notification (default is autodetected)]),
53 - [USE_SYSTEMD_DAEMON=$withval], [USE_SYSTEMD_DAEMON=auto])
54 -AS_IF([test "x$USE_SYSTEMD_DAEMON" != "xno"], [
55 - PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
56 - [AC_DEFINE(USE_SYSTEMD_DAEMON,1,[Use systemd startup notification])],
57 - [AS_IF([test "x$USE_SYSTEMD_DAEMON" = "xyes"],
58 - [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd-daemon not found.])]
59 + [USE_SYSTEMD=$withval], [USE_SYSTEMD=auto])
60 +AS_IF([test "x$USE_SYSTEMD" != "xno"], [
61 + PKG_CHECK_MODULES([SYSTEMD], [libsystemd],
62 + [AC_DEFINE(USE_SYSTEMD,1,[Use systemd startup notification])],
63 + [AS_IF([test "x$USE_SYSTEMD" = "xyes"],
64 + [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd not found.])]
68 diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt
69 index e8f8b34..8ec3b95 100644
70 --- a/daemon/CMakeLists.txt
71 +++ b/daemon/CMakeLists.txt
76 - add_definitions(-DUSE_SYSTEMD_DAEMON)
77 + add_definitions(-DUSE_SYSTEMD)
81 @@ -37,14 +37,14 @@ add_executable(${TR_NAME}-daemon
82 ${${PROJECT_NAME}_WIN32_RC_FILE})
84 set_target_properties(${TR_NAME}-daemon PROPERTIES
85 - COMPILE_FLAGS "${SYSTEMD_DAEMON_CFLAGS}"
86 - LINK_FLAGS "${SYSTEMD_DAEMON_LDFLAGS}"
87 + COMPILE_FLAGS "${SYSTEMD_CFLAGS}"
88 + LINK_FLAGS "${SYSTEMD_LDFLAGS}"
91 target_link_libraries(${TR_NAME}-daemon
94 - ${SYSTEMD_DAEMON_LIBRARIES}
95 + ${SYSTEMD_LIBRARIES}
98 tr_win32_app_info(${PROJECT_NAME}_remote_WIN32_RC_FILE
99 diff --git a/daemon/Makefile.am b/daemon/Makefile.am
100 index 677f765..34d7076 100644
101 --- a/daemon/Makefile.am
102 +++ b/daemon/Makefile.am
103 @@ -3,7 +3,7 @@ AM_CPPFLAGS = -I@top_srcdir@ -DEMBEDDED
107 - @SYSTEMD_DAEMON_CFLAGS@ \
112 @@ -29,7 +29,7 @@ LDADD = \
116 - @SYSTEMD_DAEMON_LIBS@ \
121 diff --git a/daemon/daemon.c b/daemon/daemon.c
122 index 40ac5a6..62ac715 100644
123 --- a/daemon/daemon.c
124 +++ b/daemon/daemon.c
126 #include <libtransmission/version.h>
127 #include <libtransmission/watchdir.h>
129 -#ifdef USE_SYSTEMD_DAEMON
131 #include <systemd/sd-daemon.h>
133 static void sd_notify (int status UNUSED, const char * str UNUSED) { }