1
0
Fork 0
mirror of https://github.com/kbumsik/VirtScreen.git synced 2025-02-12 19:31:50 +00:00
VirtScreen/Makefile

83 lines
2.2 KiB
Makefile
Raw Normal View History

# See https://packaging.python.org/tutorials/distributing-packages/#packaging-your-project
# for python packaging reference.
2018-06-18 00:14:40 +00:00
DOCKER_NAME=kbumsik/virtscreen
DOCKER_RUN=docker run --interactive --tty -v $(shell pwd):/app $(DOCKER_NAME)
DOCKER_RUN_TTY=docker run --interactive --tty -v $(shell pwd):/app $(DOCKER_NAME)
DOCKER_RUN_DEB=docker run -v $(shell pwd)/package/debian:/app $(DOCKER_NAME)
2018-06-18 00:14:40 +00:00
.ONESHELL:
2018-06-26 07:33:46 +00:00
# Docker tools
.PHONY: docker docker-build
2018-05-23 01:26:17 +00:00
2018-06-18 00:14:40 +00:00
docker:
2018-06-18 07:11:21 +00:00
$(DOCKER_RUN_TTY) /bin/bash
2018-06-26 07:33:46 +00:00
docker-build:
docker build -f Dockerfile -t $(DOCKER_NAME) .
2018-06-18 00:14:40 +00:00
2018-06-26 07:33:46 +00:00
# Python wheel package for PyPI
.PHONY: wheel-clean
package/pypi/%.whl:
python3 setup.py bdist_wheel --universal
cp dist/* package/pypi
-rm -rf build dist *.egg-info
2018-05-23 01:26:17 +00:00
2018-06-26 07:33:46 +00:00
wheel-clean:
-rm package/pypi/virtscreen*.whl
2018-06-18 00:14:40 +00:00
# For AppImage packaging, https://github.com/AppImage/AppImageKit/wiki/Creating-AppImages
2018-06-26 07:33:46 +00:00
.PHONY: appimage-clean
package/appimage/%.AppImage:
$(DOCKER_RUN) package/appimage/build.sh
$(DOCKER_RUN) chown -R $(shell id -u):$(shell id -u) package/appimage
appimage-clean:
2018-06-26 07:33:46 +00:00
-rm -rf package/appimage/virtscreen.AppDir package/appimage/VirtScreen-x86_64.AppImage
2018-06-18 00:14:40 +00:00
# For Debian packaging, https://www.debian.org/doc/manuals/debmake-doc/ch08.en.html#setup-py
2018-06-26 07:33:46 +00:00
.PHONY: deb-contents deb-clean
2018-05-23 01:26:17 +00:00
2018-06-26 07:33:46 +00:00
package/debian/%.deb:
$(DOCKER_RUN_DEB) /app/debmake.sh virtualenv
$(DOCKER_RUN_DEB) /app/copy_debian.sh virtualenv
$(DOCKER_RUN_DEB) /app/debuild.sh virtualenv
$(DOCKER_RUN_DEB) chown -R $(shell id -u):$(shell id -u) /app/build
2018-06-26 07:33:46 +00:00
cp package/debian/build/virtscreen*.deb package/debian
deb-contents:
$(DOCKER_RUN_DEB) /app/contents.sh
2018-06-03 15:55:15 +00:00
2018-05-23 01:26:17 +00:00
deb-clean:
2018-06-26 07:33:46 +00:00
rm -rf package/debian/build package/debian/*.deb
2018-05-21 19:09:42 +00:00
# For AUR: https://wiki.archlinux.org/index.php/Python_package_guidelines
# and: https://wiki.archlinux.org/index.php/Creating_packages
2018-06-26 07:33:46 +00:00
.PHONY: arch-upload arch-clean
2018-06-26 07:33:46 +00:00
arch-upload: package/archlinux/.SRCINFO
2018-05-21 19:09:42 +00:00
cd package/archlinux
git clone ssh://aur@aur.archlinux.org/virtscreen.git
cp PKGBUILD virtscreen
cp .SRCINFO virtscreen
cd virtscreen
git add --all
git commit
git push
cd ..
rm -rf virtscreen
2018-06-26 07:33:46 +00:00
package/archlinux/.SRCINFO:
cd package/archlinux
makepkg --printsrcinfo > .SRCINFO
arch-clean:
cd package/archlinux
2018-06-26 07:33:46 +00:00
-rm -rf pkg src *.tar* .SRCINFO
2018-06-26 07:33:46 +00:00
# Clean packages
clean: appimage-clean arch-clean deb-clean wheel-clean