package/libfuse: only install udev rules if (e)udev is enabled
authorPeter Korsgaard <peter@korsgaard.com>
Tue, 2 Apr 2019 20:56:01 +0000 (22:56 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 3 Apr 2019 19:39:30 +0000 (21:39 +0200)
No point in installing udev rules if nothing will use it.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/libfuse/libfuse.mk

index 84027ebedb16d3c493af686560c99bffa7fb3ddf..ab0131b057fd53c22aef868e5fa7fd5def757005 100644 (file)
@@ -17,11 +17,18 @@ LIBFUSE_CONF_OPTS = \
        --enable-util \
        UDEV_RULES_PATH=/lib/udev/rules.d
 
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+define LIBFUSE_INSTALL_UDEV
+       mkdir -p $(TARGET_DIR)/lib/udev/rules.d
+       cp $(STAGING_DIR)/lib/udev/rules.d/*-fuse.rules $(TARGET_DIR)/lib/udev/rules.d
+endef
+
+LIBFUSE_POST_INSTALL_TARGET_HOOKS += LIBFUSE_INSTALL_UDEV
+endif
+
 define LIBFUSE_INSTALL_TARGET_CMDS
        cp -dpf $(STAGING_DIR)/usr/bin/fusermount $(TARGET_DIR)/usr/bin/
        cp -dpf $(STAGING_DIR)/usr/lib/libfuse.so* $(TARGET_DIR)/usr/lib/
-       mkdir -p $(TARGET_DIR)/lib/udev/rules.d
-       cp $(STAGING_DIR)/lib/udev/rules.d/*-fuse.rules $(TARGET_DIR)/lib/udev/rules.d
 endef
 
 define LIBFUSE_DEVICES