summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--cmd/podman/main.go6
-rw-r--r--cmd/podman/varlink.go4
-rw-r--r--cmd/podman/varlink_dummy.go9
4 files changed, 24 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index b808e09b3..0ab8443a4 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,12 @@ ETCDIR ?= ${DESTDIR}/etc
ETCDIR_LIBPOD ?= ${ETCDIR}/crio
TMPFILESDIR ?= ${PREFIX}/lib/tmpfiles.d
SYSTEMDDIR ?= ${PREFIX}/lib/systemd/system
-BUILDTAGS ?= seccomp $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh) $(shell hack/btrfs_installed_tag.sh) $(shell hack/ostree_tag.sh) $(shell hack/selinux_tag.sh)
+BUILDTAGS ?= seccomp $(shell hack/btrfs_tag.sh) $(shell hack/libdm_tag.sh) $(shell hack/btrfs_installed_tag.sh) $(shell hack/ostree_tag.sh) $(shell hack/selinux_tag.sh) varlink
+
+ifneq (,$(findstring varlink,$(BUILDTAGS)))
+ PODMAN_VARLINK_DEPENDENCIES = cmd/podman/varlink/ioprojectatomicpodman.go
+endif
+
PYTHON ?= /usr/bin/python3
HAS_PYTHON3 := $(shell command -v python3 2>/dev/null)
@@ -92,7 +97,7 @@ test/copyimg/copyimg: .gopathok $(wildcard test/copyimg/*.go)
test/checkseccomp/checkseccomp: .gopathok $(wildcard test/checkseccomp/*.go)
$(GO) build -ldflags '$(LDFLAGS)' -tags "$(BUILDTAGS) containers_image_ostree_stub" -o $@ $(PROJECT)/test/checkseccomp
-podman: .gopathok API.md cmd/podman/varlink/ioprojectatomicpodman.go
+podman: .gopathok $(PODMAN_VARLINK_DEPENDENCIES)
$(GO) build -i -ldflags '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS)" -o bin/$@ $(PROJECT)/cmd/podman
python-podman:
diff --git a/cmd/podman/main.go b/cmd/podman/main.go
index 8ee86dd92..f936a332f 100644
--- a/cmd/podman/main.go
+++ b/cmd/podman/main.go
@@ -75,10 +75,14 @@ func main() {
topCommand,
umountCommand,
unpauseCommand,
- varlinkCommand,
versionCommand,
waitCommand,
}
+
+ if varlinkCommand != nil {
+ app.Commands = append(app.Commands, *varlinkCommand)
+ }
+
app.Before = func(c *cli.Context) error {
logLevel := c.GlobalString("log-level")
if logLevel != "" {
diff --git a/cmd/podman/varlink.go b/cmd/podman/varlink.go
index ca3159460..f1bf2db6b 100644
--- a/cmd/podman/varlink.go
+++ b/cmd/podman/varlink.go
@@ -1,3 +1,5 @@
+// +build varlink
+
package main
import (
@@ -25,7 +27,7 @@ var (
Value: 1000,
},
}
- varlinkCommand = cli.Command{
+ varlinkCommand = &cli.Command{
Name: "varlink",
Usage: "Run varlink interface",
Description: varlinkDescription,
diff --git a/cmd/podman/varlink_dummy.go b/cmd/podman/varlink_dummy.go
new file mode 100644
index 000000000..ec4bbb208
--- /dev/null
+++ b/cmd/podman/varlink_dummy.go
@@ -0,0 +1,9 @@
+// +build !varlink
+
+package main
+
+import (
+ "github.com/urfave/cli"
+)
+
+var varlinkCommand *cli.Command