-vendor: tools/glide glide.yaml
- ./tools/glide install --strip-vendor
-
-tools/glide:
- @echo "Downloading glide"
- mkdir -p tools
- curl --silent -L https://glide.sh/get | GOBIN=./tools sh
+.PHONY: install
+install:
+ @test -e $(LOCAL_BINDIR)/xds-server$(EXT) -a -d webapp/dist || { echo "Please execute first: make all"; exit 1; }
+ @test -d $(LOCAL_BINDIR)/xds-utils || { echo "Please execute first: make all"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/syncthing$(EXT) -a -e $(LOCAL_BINDIR)/syncthing-inotify$(EXT) || { echo "Please execute first: make all"; exit 1; }
+ mkdir -p $(DESTDIR) \
+ && cp -a $(LOCAL_BINDIR)/* $(DESTDIR)
+ mkdir -p $(DESTDIR_WWW) \
+ && cp -a webapp/dist/* $(DESTDIR_WWW)
+
+.PHONY: _package
+_package: clean
+ make -f $(ROOT_SRCDIR)/Makefile all install DESTDIR=$(PACKAGE_DIR)/xds-server
+ make -f $(ROOT_SRCDIR)/Makefile conffile DESTDIR=$(PACKAGE_DIR)/xds-server DESTDIR_WWW=www
+ cp -r $(ROOT_SRCDIR)/conf.d $(PACKAGE_DIR)/xds-server
+ rm -f $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE)
+ (cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./xds-server)
+
+# On support Linux for now
+.PHONY: package
+package:
+ @echo "# Build linux amd64..."
+ GOOS=linux GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile _package
+ make -f $(ROOT_SRCDIR)/Makefile clean
+
+.PHONY: package-all
+package-all: package
+
+.PHONY: gomod
+gomod:
+ go get
+
+gomod/debug:
+ @echo "replace gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git => $(ROOT_SRCDIR)/../xds-common" >> $(ROOT_SRCDIR)/go.mod
+ @echo "Add replace in go.mod file - done."
+
+vendor: gomod
+ go mod vendor
+
+vendor/debug: vendor
+ (cd vendor/gerrit.automotivelinux.org/gerrit/src/xds && \
+ rm -rf xds-common.git && ln -s ../../../../../../xds-common xds-common.git )