3 # Uncomment this to turn on verbose mode.
6 # These are used for cross-compiling and for saving the configure script
7 # from having to guess our platform (since we know it already)
8 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
23 configure: configure-stamp
30 build-stamp: configure-stamp
37 rm -f configure-stamp build-stamp
38 [ ! -f Makefile ] || $(MAKE) distclean
43 INSTALL_XDS_DIR=/opt/AGL/xds/agent
44 INSTALL_BIN_DIR=/opt/AGL/bin
46 DEB_BASE_DIR=debian/$(NAME)
47 DEB_INSTALL_XDS_DIR=$(DEB_BASE_DIR)/$(INSTALL_XDS_DIR)
48 DEB_INSTALL_BIN_DIR=$(DEB_BASE_DIR)/$(INSTALL_BIN_DIR)
55 # Add here commands to install the package into debian/tmp
56 mkdir -p $(DEB_INSTALL_XDS_DIR) $(DEB_INSTALL_BIN_DIR)
57 find . -maxdepth 1 ! -name debian -exec cp -r {} $(DEB_INSTALL_XDS_DIR) \;
58 rm -fr $(DEB_INSTALL_XDS_DIR)/debian $(DEB_INSTALL_XDS_DIR)/*-stamp
59 cd $(DEB_INSTALL_BIN_DIR) && ln -s ../xds/agent/xds-agent
60 # Install service files
61 mkdir -p $(DEB_BASE_DIR)/usr/lib/systemd/user
62 cp $(DEB_INSTALL_XDS_DIR)/conf.d/usr/lib/systemd/user/xds-agent.service $(DEB_BASE_DIR)/usr/lib/systemd/user
63 mkdir -p $(DEB_BASE_DIR)/etc/default $(DEB_BASE_DIR)/etc/xds/agent
64 cp $(DEB_INSTALL_XDS_DIR)/conf.d/etc/default/xds-agent $(DEB_BASE_DIR)/etc/default/
65 cp $(DEB_INSTALL_XDS_DIR)/conf.d/etc/xds/agent/* $(DEB_BASE_DIR)/etc/xds/agent/
66 mkdir -p $(DEB_BASE_DIR)/etc/systemd/user/multi-user.target.wants
67 ln -s /usr/lib/systemd/user/xds-agent.service $(DEB_BASE_DIR)/etc/systemd/user/multi-user.target.wants/
69 # Add XDS in user's PATH
70 mkdir -p $(DEB_BASE_DIR)/etc/profile.d
71 sed -e "s;@XDS_INSTALL_BIN_DIR@;$(INSTALL_BIN_DIR);g" $(DEB_INSTALL_XDS_DIR)/conf.d/etc/profile.d/xds-agent.sh > $(DEB_BASE_DIR)/etc/profile.d/$(NAME).sh
74 rm -rf $(DEB_INSTALL_XDS_DIR)/conf.d
76 # Move all files in their corresponding package
77 dh_install --list-missing -s --sourcedir=debian/tmp
80 if [ -f "/etc/xds-agent/config.json" ]; then
81 install -b -S .rpmsave /etc/xds-agent/config.json /etc/xds/agent/agent-config.json
85 rm -f /etc/xds-agent/*.rpm*
87 # Build architecture-independent files here.
88 binary-indep: build install
89 # We have nothing to do by default.
91 # Build architecture-dependent files here.
92 binary-arch: build install
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install