compilation: virt: Make libvirt support optional
refs #114 Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
7
Makefile
7
Makefile
@@ -37,6 +37,9 @@ RPM = rpmbuild/RPMS/$(PROGRAM)-$(VERSION)-$(RELEASE).$(ARCH).rpm
|
|||||||
USERNAME := $(shell cat ~/.config/copr 2>/dev/null | grep username | awk -F '=' '{print $$2}' | tr -d ' ')
|
USERNAME := $(shell cat ~/.config/copr 2>/dev/null | grep username | awk -F '=' '{print $$2}' | tr -d ' ')
|
||||||
SERVER = 'dl.fedoraproject.org'
|
SERVER = 'dl.fedoraproject.org'
|
||||||
REMOTE_PATH = 'pub/alt/$(USERNAME)/$(PROGRAM)'
|
REMOTE_PATH = 'pub/alt/$(USERNAME)/$(PROGRAM)'
|
||||||
|
ifneq ($(GOTAGS),)
|
||||||
|
BUILD_FLAGS = -tags $(GOTAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# art
|
# art
|
||||||
@@ -105,9 +108,9 @@ $(PROGRAM): main.go
|
|||||||
@echo "Building: $(PROGRAM), version: $(SVERSION)..."
|
@echo "Building: $(PROGRAM), version: $(SVERSION)..."
|
||||||
ifneq ($(OLDGOLANG),)
|
ifneq ($(OLDGOLANG),)
|
||||||
@# avoid equals sign in old golang versions eg in: -X foo=bar
|
@# avoid equals sign in old golang versions eg in: -X foo=bar
|
||||||
time go build -ldflags "-X main.program $(PROGRAM) -X main.version $(SVERSION)" -o $(PROGRAM);
|
time go build -ldflags "-X main.program $(PROGRAM) -X main.version $(SVERSION)" -o $(PROGRAM) $(BUILD_FLAGS);
|
||||||
else
|
else
|
||||||
time go build -ldflags "-X main.program=$(PROGRAM) -X main.version=$(SVERSION)" -o $(PROGRAM);
|
time go build -ldflags "-X main.program=$(PROGRAM) -X main.version=$(SVERSION)" -o $(PROGRAM) $(BUILD_FLAGS);
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(PROGRAM).static: main.go
|
$(PROGRAM).static: main.go
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
* [Meta parameters](#meta-parameters)
|
* [Meta parameters](#meta-parameters)
|
||||||
* [Graph definition file](#graph-definition-file)
|
* [Graph definition file](#graph-definition-file)
|
||||||
* [Command line](#command-line)
|
* [Command line](#command-line)
|
||||||
|
* [Compilation options](#compilation-options)
|
||||||
8. [Examples - Example configurations](#examples)
|
8. [Examples - Example configurations](#examples)
|
||||||
9. [Development - Background on module development and reporting bugs](#development)
|
9. [Development - Background on module development and reporting bugs](#development)
|
||||||
10. [Authors - Authors and contact information](#authors)
|
10. [Authors - Authors and contact information](#authors)
|
||||||
@@ -420,6 +421,7 @@ If you feel that a well used option needs documenting here, please patch it!
|
|||||||
* [Meta parameters](#meta-parameters): List of available resource meta parameters.
|
* [Meta parameters](#meta-parameters): List of available resource meta parameters.
|
||||||
* [Graph definition file](#graph-definition-file): Main graph definition file.
|
* [Graph definition file](#graph-definition-file): Main graph definition file.
|
||||||
* [Command line](#command-line): Command line parameters.
|
* [Command line](#command-line): Command line parameters.
|
||||||
|
* [Compilation options](#compilation-options): Compilation options.
|
||||||
|
|
||||||
### Meta parameters
|
### Meta parameters
|
||||||
These meta parameters are special parameters (or properties) which can apply to
|
These meta parameters are special parameters (or properties) which can apply to
|
||||||
@@ -545,6 +547,18 @@ like to try. The canonical example is when running `mgmt` with `--remote` there
|
|||||||
might be a cached copy of the binary in the primary prefix, but in case there's
|
might be a cached copy of the binary in the primary prefix, but in case there's
|
||||||
no binary available continue working in a temporary directory to avoid failure.
|
no binary available continue working in a temporary directory to avoid failure.
|
||||||
|
|
||||||
|
### Compilation options
|
||||||
|
|
||||||
|
You can control some compilation variables by using environment variables.
|
||||||
|
|
||||||
|
#### Disable livirt support
|
||||||
|
|
||||||
|
If you wish to compile mgmt without libvirt, you can use the following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
GOTAGS=novirt make build
|
||||||
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
For example configurations, please consult the [examples/](https://github.com/purpleidea/mgmt/tree/master/examples) directory in the git
|
For example configurations, please consult the [examples/](https://github.com/purpleidea/mgmt/tree/master/examples) directory in the git
|
||||||
source repository. It is available from:
|
source repository. It is available from:
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// +build !novirt
|
||||||
|
|
||||||
package resources
|
package resources
|
||||||
|
|
||||||
|
|||||||
24
resources/virt_disabled.go
Normal file
24
resources/virt_disabled.go
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
// Mgmt
|
||||||
|
// Copyright (C) 2013-2016+ James Shubin and the project contributors
|
||||||
|
// Written by James Shubin <james@shubin.ca> and the project contributors
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
// +build novirt
|
||||||
|
|
||||||
|
package resources
|
||||||
|
|
||||||
|
// VirtRes represents the fields of the Virt resource. Since this file is
|
||||||
|
// only invoked with the tag "novirt", we do not need any fields here.
|
||||||
|
type VirtRes struct {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user