Skip to content

Commit

Permalink
Makefile: Added tar.gz archive
Browse files Browse the repository at this point in the history
  • Loading branch information
kbumsik committed Nov 7, 2018
1 parent 4a2e7d0 commit 88079ad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# files & folders for development use
debug

# Archive file
*.tar.gz

################################################################################
# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ DOCKER_RUN_TTY=docker run --interactive --tty -v $(shell pwd):/app $(DOCKER_NAME

PKG_APPIMAGE=package/appimage/VirtScreen.AppImage
PKG_DEBIAN=package/debian/virtscreen.deb
ARCHIVE=virtscreen-$(VERSION).tar.gz

.ONESHELL:

.PHONY: run debug run-appimage debug-appimage

all: package/pypi/*.whl $(PKG_APPIMAGE) $(PKG_DEBIAN)
all: package/pypi/*.whl $(ARCHIVE) $(PKG_APPIMAGE) $(PKG_DEBIAN)

# Run script
run:
Expand All @@ -28,6 +29,12 @@ run-appimage: $(PKG_APPIMAGE)
debug-appimage: $(PKG_APPIMAGE)
QT_DEBUG_PLUGINS=1 QML_IMPORT_TRACE=1 $< --log=DEBUG

# tar.gz
.PHONY: archive

archive $(ARCHIVE):
git archive --format=tar.gz --prefix=virtscreen-$(VERSION)/ -o $@ HEAD

# Docker tools
.PHONY: docker docker-build

Expand Down Expand Up @@ -64,7 +71,7 @@ appimage-clean:
# https://www.debian.org/doc/manuals/debmake-doc/ch08.en.html#setup-py
.PHONY: deb-contents deb-clean

$(PKG_DEBIAN): $(PKG_APPIMAGE)
$(PKG_DEBIAN): $(PKG_APPIMAGE) $(ARCHIVE)
$(DOCKER_RUN) package/debian/build.sh
$(DOCKER_RUN) mv package/debian/*.deb $@
$(DOCKER_RUN) chown -R $(shell id -u):$(shell id -u) package/debian
Expand Down Expand Up @@ -121,3 +128,4 @@ override-version:

# Clean packages
clean: appimage-clean arch-clean deb-clean wheel-clean
-rm -f $(ARCHIVE)
6 changes: 2 additions & 4 deletions package/debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ ROOT=$SCRIPT_DIR/../..

# Generate necessary files for package building (generated by debmake)
cd $ROOT/package/debian
wget -q https://github.com/kbumsik/VirtScreen/archive/$PKGVER.tar.gz
tar -xzmf $PKGVER.tar.gz
mv VirtScreen-$PKGVER virtscreen-$PKGVER
mv $PKGVER.tar.gz virtscreen-$PKGVER.tar.gz
cp $ROOT/virtscreen-$PKGVER.tar.gz .
tar -xzmf virtscreen-$PKGVER.tar.gz
cp $ROOT/package/debian/Makefile \
$ROOT/package/debian/virtscreen-$PKGVER/Makefile
cd $ROOT/package/debian/virtscreen-$PKGVER
Expand Down

0 comments on commit 88079ad

Please sign in to comment.