From 965a712d0102269fcf54e1f459e37113c31218af Mon Sep 17 00:00:00 2001
From: Ruben Pollan <meskio@sindominio.net>
Date: Tue, 9 Oct 2018 12:23:02 -0500
Subject: [PATCH] [pkg] make standalone the default build

---
 .gitlab-ci.yml |  2 +-
 Makefile       | 10 +++++-----
 README.md      | 23 ++++++++++++++---------
 bitmaskd.go    |  2 +-
 standalone.go  |  2 +-
 5 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 177fab98..e5fa957c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,7 +14,7 @@ build_test:
     - ln -s "$(pwd)" ${APP_PATH}
     - cd ${APP_PATH}
     - make get
-    - make standalone
+    - make bitmaskd
     - make build
   tags:
     - linux
diff --git a/Makefile b/Makefile
index 9c86e073..066028f1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: all get build standalone icon locales generate_locales clean
+.PHONY: all get build build_bitmaskd icon locales generate_locales clean
 
 TAGS ?= gtk_3_18
 
@@ -6,7 +6,7 @@ all: icon locales get build
 
 get:
 	go get -tags $(TAGS) ./...
-	go get -tags "$(TAGS) standalone" ./...
+	go get -tags "$(TAGS) bitmaskd" ./...
 
 build:
 	go build -tags $(TAGS) -ldflags "-X main.version=`git describe --tags`"
@@ -14,11 +14,11 @@ build:
 test:
 	go test -tags $(TAGS) ./...
 
-standalone:
-	go build -tags "$(TAGS) standalone" -ldflags "-X main.version=`git describe --tags`"
+build_bitmaskd:
+	go build -tags "$(TAGS) bitmaskd" -ldflags "-X main.version=`git describe --tags`"
 
 build_win:
-	powershell -Command '$$version=git describe --tags; go build -tags "standalone" -ldflags "-H windowsgui -X main.version=$$version"'
+	powershell -Command '$$version=git describe --tags; go build -ldflags "-H windowsgui -X main.version=$$version"'
 
 clean:
 	make -C icon clean
diff --git a/README.md b/README.md
index a6f88394..280b975d 100644
--- a/README.md
+++ b/README.md
@@ -50,24 +50,29 @@ They are expected and don't produce any problem on the systray.
 
 Run it
 -------------
-bitmask-systray assumes that you already have bitmaskd running.
+The default build is a standalone systray. It still requires a helper and openvpn installed to work. For linux the helper is
+[bitmask-root](https://0xacab.org/leap/bitmask-dev/blob/master/src/leap/bitmask/vpn/helpers/linux/bitmask-root)
+for windows and OSX there is [a helper written in go](https://0xacab.org/leap/riseup_vpn/tree/master/helper).
 
-Run bitmask and the systray:
+To build and run it:
 ```
-  $ bitmaskd
+  $ go build
   $ ./bitmask-systray
 ```
 
-Standalone
+
+Bitmaskd
 -------------
+Is also posible to compile the systray to use bitmask as backend:
+```
+  $ go build -tags bitmaskd
+```
 
-Is also posible to compile the systray to be standalone (don't depend on bitmask):
+In that case bitmask-systray assumes that you already have bitmaskd running. Run bitmask and the systray:
 ```
-  $ go build -tags standalone
+  $ bitmaskd
+  $ ./bitmask-systray
 ```
-It still requires a helper and openvpn installed to work. For linux the helper is
-[bitmask-root](https://0xacab.org/leap/bitmask-dev/blob/master/src/leap/bitmask/vpn/helpers/linux/bitmask-root)
-for windows and OSX there is [a helper written in go](https://0xacab.org/leap/riseup_vpn/tree/master/helper).
 
 
 i18n
diff --git a/bitmaskd.go b/bitmaskd.go
index d9f8ff0c..b7036a60 100644
--- a/bitmaskd.go
+++ b/bitmaskd.go
@@ -1,4 +1,4 @@
-// +build !standalone
+// +build bitmaskd
 // Copyright (C) 2018 LEAP
 //
 // This program is free software: you can redistribute it and/or modify
diff --git a/standalone.go b/standalone.go
index a9f135d4..e2c9f66d 100644
--- a/standalone.go
+++ b/standalone.go
@@ -1,4 +1,4 @@
-// +build standalone
+// +build !bitmaskd
 // Copyright (C) 2018 LEAP
 //
 // This program is free software: you can redistribute it and/or modify
-- 
GitLab