diff --git a/flatpak/.gitignore b/flatpak/.gitignore index 0fbe396..6778578 100644 --- a/flatpak/.gitignore +++ b/flatpak/.gitignore @@ -1,4 +1,5 @@ -/RemoteTouchpad -/repo -/.flatpak-builder -/RemoteTouchpad-*.flatpak +Makefile +.flatpak-builder +repo +build +*.flatpak diff --git a/flatpak/Makefile b/flatpak/Makefile index 2f61890..160ccbc 100644 --- a/flatpak/Makefile +++ b/flatpak/Makefile @@ -1,26 +1,32 @@ ARCH = $(shell flatpak --default-arch) APP_ID = com.github.unrud.RemoteTouchpad -APP_NAME = RemoteTouchpad +APP_NAME = $(shell echo $(APP_ID) | rev | cut --delimiter=. --fields=1 | rev) +FORMAT = $(shell ls -1 $(APP_ID).json $(APP_ID).yaml 2>/dev/null | tail -n1 | rev | cut -d. -f1 | rev) +BRANCH = master .PHONY: all all: bundle .PHONY: build build: - flatpak-builder --arch=$(ARCH) --force-clean $(APP_NAME) $(APP_ID).json + mkdir -p build + flatpak-builder --arch=$(ARCH) --force-clean build/$(APP_NAME) $(APP_ID).$(FORMAT) .PHONY: repo repo: - flatpak-builder --arch=$(ARCH) --force-clean $(APP_NAME) $(APP_ID).json --repo=repo + mkdir -p build repo + flatpak-builder --arch=$(ARCH) --force-clean build/$(APP_NAME) $(APP_ID).$(FORMAT) --repo=repo/$(APP_NAME) .PHONY: bundle bundle: repo - flatpak build-bundle --arch=$(ARCH) repo $(APP_NAME)-$(ARCH).flatpak $(APP_ID) + flatpak build-bundle --arch=$(ARCH) repo/$(APP_NAME) $(APP_NAME)-$(ARCH).flatpak $(APP_ID) $(BRANCH) .PHONY: clean clean: - rm -rf $(APP_NAME) $(APP_NAME)-*.flatpak repo .flatpak-builder || true + rm -rf $(APP_NAME)-*.flatpak build/$(APP_NAME) repo/$(APP_NAME) .flatpak-builder || true + rmdir build || true + rmdir repo || true .PHONY: install install: @@ -28,4 +34,4 @@ install: .PHONY: uninstall uninstall: - flatpak uninstall --user $(APP_ID) + flatpak uninstall --user $(APP_ID)/$(ARCH)/$(BRANCH)