helpers: use $(INSTALL) to ... install the helper.
[platform/upstream/gstreamer.git] / libs / gst / helpers / Makefile.am
index 523b2df..a616721 100644 (file)
@@ -8,11 +8,14 @@ gst_completion_helper_@GST_API_VERSION@_LDADD = $(GST_OBJ_LIBS)
 bashhelpersdir = $(BASH_HELPERS_DIR)
 dist_bashhelpers_DATA = gst
 
-install-data-hook:
+install-exec-hook:
        cd $(DESTDIR)$(bindir) && \
-       mv `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT) \
-       $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT)
-       chmod 755 $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT)
+       $(INSTALL) `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT) \
+       -D $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT) && \
+       rm `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT)
+
+uninstall-hook:
+       rm -f $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT)
 endif
 
 helpers_PROGRAMS = gst-plugin-scanner
@@ -34,3 +37,7 @@ Android.mk: Makefile.am
 # clean out the old one to make sure everything is udpated correctly
 # remove again after release
 CLEANFILES = plugin-scanner
+
+if ENABLE_BASH_COMPLETION
+CLEANFILES += gst-completion-helper-@GST_API_VERSION@
+endif