Fixed unprivileged 'rpm' builds.
[captive.git] / src / client / fuse / Makefile.am
index 30de43f..ee1bbc8 100644 (file)
@@ -77,6 +77,27 @@ if ENABLE_SBIN_MOUNT
 mount_captive_cond=mount.captive
 initd_SCRIPTS_cond=captive
 
+if ENABLE_STANDALONE
+libexec_PROGRAMS_cond=captive-fusermount
+
+install-exec-hook-captive-fusermount:
+       chown root.fuse $(DESTDIR)/$(libexecdir)/captive-fusermount
+       chmod 4754      $(DESTDIR)/$(libexecdir)/captive-fusermount
+       if grep -q '^fuse:' /etc/group;then true;else \
+               echo "ERROR: Add 'fuse' to your '/etc/group'; see groupadd(8)"; \
+               exit 1; \
+       fi;
+
+else
+install-exec-hook-captive-fusermount:
+       @true
+
+endif
+
+# Do not: libexecPROGRAMS_INSTALL=${INSTALL} -o root -g fuse -m 4754
+# as it works only on Fedora Core based systems, at least SuSE 10.0 correctly fails.
+#      https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=176708
+
 install-exec-hook:
        $(mkinstalldirs) $(DESTDIR)$(enable_sbin_mountdir)
        IFS=:; \
@@ -88,10 +109,7 @@ install-exec-hook:
                fi; \
                done
        if test `id -u` -eq 0 -a -z "$(DESTDIR)";then \
-               if grep -q '^fuse:' /etc/group;then true;else \
-                       echo "ERROR: Add 'fuse' to your '/etc/group'; see groupadd(8)"; \
-                       exit 1; \
-               fi; \
+               $(MAKE) $(AM_MAKEFLAGS) install-exec-hook-captive-fusermount; \
        fi
 
 else
@@ -129,10 +147,3 @@ captive_fusermount_SOURCES= \
 captive_fusermount_CFLAGS=
 captive_fusermount_LDADD =$(captive_library)
 libexec_PROGRAMS=$(libexec_PROGRAMS_cond)
-libexecPROGRAMS_INSTALL=${INSTALL} -o root -g fuse -m 4754
-
-if ENABLE_FUSE
-if ENABLE_STANDALONE
-libexec_PROGRAMS_cond=captive-fusermount
-endif
-endif