From 7146d24aeaac6bf5a9f1fbe0c786a846410145ff Mon Sep 17 00:00:00 2001 From: Sven Eden Date: Fri, 2 Jun 2017 11:18:12 +0200 Subject: [PATCH] Prep v230: Move installed headers The headers are now installed into /usr/include/elogind/systemd and the pkg-config file now returns -I/usr/include/elogind for CFLAGS. Further /usr/include/elogind contains symlinks to the headers, so existing packages already including will not be broken. This way no software has to change their include lines anywhere to support elogind any more. All they have to do is either add LIBSYSTEMD_CFLAGS or LIBELOGIND_CFLAGS from pkg-config and be done with it. So most patching can be avoided, just some configure adaption is needed. However, this can lead to systemd/elogind bug confusion if there is anything mixed up on a system that shouldn't. Downstreams, chose any of the two ways to your own discretion! See https://bugs.freedesktop.org/show_bug.cgi?id=101251 --- Makefile.am | 14 +++++++++++++- src/libelogind/libelogind.pc.in | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2305caff6..bf9082428 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,7 +58,7 @@ PKTTYAGENT=$(bindir)/pkttyagent # Our own, non-special dirs pkgsysconfdir=$(sysconfdir)/elogind -pkgincludedir=$(includedir)/elogind +pkgincludedir=$(includedir)/elogind/systemd udevrulesdir=@udevrulesdir@ udevbindir=@udevbindir@ udevlibexecdir=$(udevbindir) @@ -625,6 +625,18 @@ pkginclude_HEADERS += \ src/systemd/sd-id128.h \ src/systemd/_sd-common.h +header-install-hook: + $(MKDIR_P) $(DESTDIR)/$(pkgincludedir) + cd $(DESTDIR)/$(includedir)/elogind && \ + for hdr in $(notdir $(pkginclude_HEADERS)) ; do \ + $(LN_S) systemd/$$hdr $$hdr ; \ + done + +header-uninstall-hook: + m -f $(DESTDIR)/$(includedir)/elogind/*.h + +INSTALL_EXEC_HOOKS += header-install-hook +UNINSTALL_EXEC_HOOKS += header-uninstall-hook lib_LTLIBRARIES += \ libelogind.la diff --git a/src/libelogind/libelogind.pc.in b/src/libelogind/libelogind.pc.in index 17a92b130..0b0fd87dd 100644 --- a/src/libelogind/libelogind.pc.in +++ b/src/libelogind/libelogind.pc.in @@ -8,7 +8,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -includedir=@includedir@ +includedir=@includedir@/elogind Name: elogind Description: elogind Library -- 2.30.2