diff --git a/Cargo.lock b/Cargo.lock index c595e0f..de10218 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1110,7 +1110,7 @@ dependencies = [ [[package]] name = "satty" -version = "0.3.1" +version = "0.4.0" dependencies = [ "anyhow", "clap", diff --git a/Makefile b/Makefile index 091cc71..d0deeae 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,16 @@ ifeq ($(PREFIX),) endif build: + cargo build + +build-release: cargo build --release + strip target/release/satty clean: cargo clean -install: build +install: build-release install -Dm755 target/release/satty -t ${PREFIX}/bin/ install -Dm644 satty.desktop ${PREFIX}/share/applications/satty.desktop install -Dm644 assets/satty.svg ${PREFIX}/share/icons/hicolor/scalable/apps/satty.svg @@ -27,3 +31,18 @@ uninstall: rm ${PREFIX}/share/licenses/satty/LICENSE rmdir -p ${PREFIX}/share/licenses/satty || true + + +package: clean build-release + $(eval TMP := $(shell mktemp -d)) + echo "Temporary folder ${TMP}" + + # install to tmp + PREFIX=${TMP} make install + + # create package + $(eval LATEST_TAG := $(shell git describe --tags --abbrev=0)) + tar -czvf satty-${LATEST_TAG}-x86_64.tar.gz -C ${TMP} . + + # clean up + rm -rf $(TMP)