helpers: really fix install race
[platform/upstream/gstreamer.git] / libs / gst / helpers / Makefile.am
1 if ENABLE_BASH_COMPLETION
2 bin_PROGRAMS = gst-completion-helper-@GST_API_VERSION@
3
4 gst_completion_helper_@GST_API_VERSION@_SOURCES = gst-completion-helper.c
5 gst_completion_helper_@GST_API_VERSION@_CFLAGS = $(GST_OBJ_CFLAGS)
6 gst_completion_helper_@GST_API_VERSION@_LDADD = $(GST_OBJ_LIBS)
7
8 bashhelpersdir = $(BASH_HELPERS_DIR)
9 dist_bashhelpers_DATA = gst
10 endif
11
12 helpers_PROGRAMS = gst-plugin-scanner
13 helpersdir=$(libexecdir)/gstreamer-$(GST_API_VERSION)
14
15 gst_plugin_scanner_SOURCES = gst-plugin-scanner.c
16 gst_plugin_scanner_CFLAGS = $(GST_OBJ_CFLAGS)
17 gst_plugin_scanner_LDADD = $(GST_OBJ_LIBS)
18
19 if HAVE_PTP
20 helpers_PROGRAMS += gst-ptp-helper
21 gst_ptp_helper_SOURCES = gst-ptp-helper.c
22 gst_ptp_helper_CFLAGS = $(GST_OBJ_CFLAGS) $(GIO_CFLAGS)
23 gst_ptp_helper_LDADD = $(GST_OBJ_LIBS) $(GIO_LIBS) $(CAP_LIBS)
24 endif
25
26 if ENABLE_BASH_COMPLETION
27 install-exec-hook:
28         $(MKDIR_P) $(DESTDIR)$(BASH_HELPERS_DIR) && \
29         cd $(DESTDIR)$(bindir) && \
30         $(INSTALL) `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT) \
31         $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT) && \
32         rm `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT)
33
34 uninstall-hook:
35         rm -f $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT)
36 endif
37
38 install-data-hook:
39 if HAVE_PTP
40 if HAVE_PTP_HELPER_SETUID
41         - chown root $(DESTDIR)$(helpersdir)/gst-ptp-helper
42         - chmod u+s $(DESTDIR)$(helpersdir)/gst-ptp-helper
43 endif
44 if HAVE_PTP_HELPER_CAPABILITIES
45         - $(SETCAP) cap_net_bind_service,cap_net_admin+ep $(DESTDIR)$(helpersdir)/gst-ptp-helper
46 endif
47 endif
48
49 # clean out the old one to make sure everything is udpated correctly
50 # remove again after release
51 CLEANFILES = plugin-scanner
52
53 if ENABLE_BASH_COMPLETION
54 CLEANFILES += gst-completion-helper-@GST_API_VERSION@
55 endif