summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2010-10-11 12:01:04 -0400
committerDavid Zeuthen <davidz@redhat.com>2010-10-11 12:10:02 -0400
commit18f5c802dfd958d9ac52924454eefba182d9ddfb (patch)
tree0dc3a26851d110f6f384b349b7bc20d8b0d1ad28
parentd7cd2b16110c806128747ee245aaa883dd52039d (diff)
Install libgudev-1.0.so in prefix / instead of prefix /usr
This is to match where libudev.so is installed and it works because all dependent libraries are already installed in / instead of /usr on most distros: $ ldd /usr/lib64/libgudev-1.0.so linux-vdso.so.1 => (0x00007fff44dff000) libudev.so.0 => /lib64/libudev.so.0 (0x0000003bf2600000) libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003fb5200000) libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x0000003fb4e00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003d5b000000) librt.so.1 => /lib64/librt.so.1 (0x0000003d5b800000) libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003fb4a00000) libc.so.6 => /lib64/libc.so.6 (0x0000003d5ac00000) /lib64/ld-linux-x86-64.so.2 (0x0000003d5a800000) With this change it is possible to write libgudev applications that can be installed in /bin or /sbin and can run without /usr being mounted. This is needed for e.g. udisks, NetworkManager and other subsystem-specific daemons. Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--Makefile.am16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 3d9773b658..093a10e058 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -433,6 +433,22 @@ typelibs_DATA = extras/gudev/GUdev-1.0.typelib
CLEANFILES += $(gir_DATA) $(typelibs_DATA)
endif # ENABLE_INTROSPECTION
+# move lib from $(libdir) to $(rootlib_execdir) and update devel link, if needed
+libgudev-install-move-hook:
+ if test "$(libdir)" != "$(rootlib_execdir)"; then \
+ mkdir -p $(DESTDIR)$(rootlib_execdir) && \
+ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libgudev-1.0.so) && \
+ so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+ ln -sf $$so_img_rel_target_prefix$(rootlib_execdir)/$$so_img_name $(DESTDIR)$(libdir)/libgudev-1.0.so && \
+ mv $(DESTDIR)$(libdir)/libgudev-1.0.so.* $(DESTDIR)$(rootlib_execdir); \
+ fi
+
+libgudev-uninstall-move-hook:
+ rm -f $(DESTDIR)$(rootlib_execdir)/libgudev-1.0.so*
+
+INSTALL_EXEC_HOOKS += libgudev-install-move-hook
+UNINSTALL_EXEC_HOOKS += libgudev-uninstall-move-hook
+
# ------------------------------------------------------------------------------
# Bluetooth HID devices with special magic to switch the device
# ------------------------------------------------------------------------------