changeset 58:7b658cee53be

add install
author AnaTofuZ <anatofuz@gmail.com>
date Tue, 24 Nov 2020 12:06:21 +0900
parents 3d7eb973488b
children d6ef7ea91ff4
files Makefile
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Nov 24 12:00:25 2020 +0900
+++ b/Makefile	Tue Nov 24 12:06:21 2020 +0900
@@ -1,4 +1,6 @@
-.PHONY: build release fmt debug-chown
+.PHONY: build release fmt debug-chown install
+
+INSTALL_DIR = /usr/local/bin
 
 build:
 	cargo build
@@ -6,8 +8,6 @@
 release:
 	cargo build --release
 	strip ./target/release/ie-virsh
-	sudo chown root ./target/release/ie-virsh
-	sudo chmod 4711 ./target/release/ie-virsh
 
 fmt:
 	cargo fmt
@@ -17,3 +17,9 @@
 	sudo chown root ./target/debug/ie-virsh
 	sudo chmod 4711 ./target/debug/ie-virsh
 
+install:release
+	sudo install ./target/release/ie-virsh $(INSTALL_DIR)
+	sudo install template.xml /etc/libvirt/qemu
+	sudo chown root $(INSTALL_DIR)/ie-virsh
+	sudo chmod 4711 $(INSTALL_DIR)/ie-virsh
+	sudo chmod 644 /etc/libvirt/qemu/template.xml