← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~troyanov/maas:maas-netmon-deb into maas:master

 

Anton Troyanov has proposed merging ~troyanov/maas:maas-netmon-deb into maas:master.

Commit message:
ci: add maas-netmon deb

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~troyanov/maas/+git/maas/+merge/441660
-- 
Your team MAAS Maintainers is requested to review the proposed merge of ~troyanov/maas:maas-netmon-deb into maas:master.
diff --git a/debian/control b/debian/control
index 76dd414..2b45cdd 100644
--- a/debian/control
+++ b/debian/control
@@ -213,6 +213,7 @@ Depends: avahi-utils,
          maas-common (=${binary:Version}),
          maas-dhcp (=${binary:Version}),
          maas-proxy (= ${binary:Version}),
+         maas-netmon (= ${binary:Version}),
          chrony,
          pxelinux | syslinux-common (<< 3:6.00~pre4+dfsg-5),
          python3-httplib2,
@@ -294,3 +295,8 @@ Conflicts: squid-deb-proxy
 Description: MAAS Caching Proxy
  This package installs and configures a Caching Proxy server that can be
  used by MAAS. It enhances the overall MAAS user experience.
+
+Package: maas-netmon
+Architecture: any
+Description: MAAS Network Monitor
+ This package installs MAAS Network Monitor binary that is used by MAAS.
diff --git a/debian/maas-netmon.install b/debian/maas-netmon.install
new file mode 100644
index 0000000..92555dd
--- /dev/null
+++ b/debian/maas-netmon.install
@@ -0,0 +1 @@
+usr/bin/maas-netmon usr/sbin
diff --git a/debian/not-installed b/debian/not-installed
new file mode 100644
index 0000000..80ea2e9
--- /dev/null
+++ b/debian/not-installed
@@ -0,0 +1,7 @@
+# Remove unneeded test scripts
+/usr/bin/test.*
+/usr/bin/maas-sampledata
+
+# Temporary explude maas-agent 
+/usr/bin/maas-agent
+
diff --git a/debian/rules b/debian/rules
index c21c6a6..419ff76 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,9 +21,6 @@ override_dh_installsystemd:
 
 override_dh_auto_install:
 	dh_auto_install
-	# remove unneeded test scripts
-	rm $(CURDIR)/debian/tmp/usr/bin/test.*
-	rm $(CURDIR)/debian/tmp/usr/bin/maas-sampledata
 
 	# Collect static files
 	install -d -m 755  $(CURDIR)/debian/tmp/usr/share/maas/web/
@@ -33,6 +30,9 @@ override_dh_auto_install:
 	# Build resources binaries
 	make -C $(CURDIR)/src/host-info install DESTDIR=$(CURDIR)/debian/tmp
 
+	# Build MAAS Agent binaries
+	make -C $(CURDIR)/src/maasagent install DESTDIR=$(CURDIR)/debian/tmp/usr/bin OUT_PREFIX=maas-
+
 	# install the apparmor profile
 	install -d -m 755 $(CURDIR)/debian/tmp/etc/apparmor.d/dhcpd.d
 	install -m 644 $(CURDIR)/debian/maas-dhcp.apparmor \
diff --git a/src/maasagent/Makefile b/src/maasagent/Makefile
index 6daef8b..75591d3 100644
--- a/src/maasagent/Makefile
+++ b/src/maasagent/Makefile
@@ -18,10 +18,16 @@ default: build test
 $(BIN_DIR): ; mkdir -p $@
 
 ARTIFACTS := $(subst /,,$(subst cmd/,,$(wildcard cmd/*/)))
+
+.PHONY: build
 build: vendor $(addprefix $(BUILD_DIR)/,$(ARTIFACTS))
 
 $(BUILD_DIR)/%:
-	CGO_ENABLED=0 $(GO) build -o $(BUILD_DIR)/$* $(LDFLAGS) cmd/$*/*.go
+	CGO_ENABLED=0 $(GO) build -o $(BUILD_DIR)/$(OUT_PREFIX)$* $(LDFLAGS) cmd/$*/*.go
+
+.PHONY: install
+install: build
+	install -t $(DESTDIR) -D $(BUILD_DIR)/*
 
 .PHONY: test
 test:

Follow ups