Files
CampOrganizer2/Makefile
T
2026-10-15 13:03:17 +02:00

38 lines
1.0 KiB
Makefile

# Variablen
JAR_SOURCE=build/libs/CampOrganizer2.jar
DEPLOY_DIR=debian-deploy
PACKAGE_NAME=camporganizer.deb
.PHONY: all deb clean
all: deb
deb:
@echo "get version..."
$(eval VERSION := $(shell ./gradlew properties -q | grep '^version:' | awk '{print $$2}'))
@echo "found version ${VERSION}"
@echo "Starting Gradle-Build..."
./gradlew clean bootJar
@echo "prepare package structure..."
mkdir -p $(DEPLOY_DIR)/opt/camporganizer
cp $(JAR_SOURCE) $(DEPLOY_DIR)/opt/camporganizer/CampOrganizer2.jar
chmod 755 $(DEPLOY_DIR)/DEBIAN/postinst
chmod 755 $(DEPLOY_DIR)/DEBIAN/postrm
@echo "Generiere finale DEBIAN/control Datei mit Version $(VERSION)..."
sed "s/__VERSION__/$(VERSION)/g" $(DEPLOY_DIR)/DEBIAN/control.template > $(DEPLOY_DIR)/DEBIAN/control
@echo "Building Debian package..."
dpkg-deb --root-owner-group --build $(DEPLOY_DIR) $(PACKAGE_NAME)
@echo "Done! Package created: $(PACKAGE_NAME)"
clean:
@echo "Cleaning up..."
rm -rf $(DEPLOY_DIR)/opt/
rm -f $(DEPLOY_DIR)/DEBIAN/control
rm -f $(PACKAGE_NAME)
./gradlew clean