diff --git a/Makefile b/Makefile index 2832a11..444adc3 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,13 @@ deb-build: deb-clean deb-make deb-contents: docker run --privileged --interactive --tty --rm -v $(shell pwd)/package/debian:/app debmake /app/contents.sh +deb-env-make: + docker run --privileged --interactive --tty --rm -v $(shell pwd)/package/debian:/app debmake /app/debmake.sh virtualenv + +deb-env-build: deb-clean deb-env-make + package/debian/copy_debian.sh virtualenv + docker run --privileged --interactive --tty --rm -v $(shell pwd)/package/debian:/app debmake /app/debuild.sh virtualenv + deb-clean: rm -rf package/debian/build diff --git a/package/debian/Dockerfile b/package/debian/Dockerfile index ea2043f..6d1e111 100644 --- a/package/debian/Dockerfile +++ b/package/debian/Dockerfile @@ -11,7 +11,13 @@ RUN apt-get update && \ ln /usr/bin/python3 /usr/bin/python && \ ln /usr/bin/pip3 /usr/bin/pip && \ rm -rf /var/cache/apt/archives/*.deb && \ + pip install virtualenv && \ pip install --upgrade pip setuptools && \ useradd -c Builder -m -U builder USER builder + +# Get Miniconda and make it the main Python interpreter +RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ + bash ~/miniconda.sh -b -p ~/miniconda && \ + rm ~/miniconda.sh diff --git a/package/debian/Makefile.virtualenv b/package/debian/Makefile.virtualenv new file mode 100644 index 0000000..3029ace --- /dev/null +++ b/package/debian/Makefile.virtualenv @@ -0,0 +1,40 @@ +prefix = /usr + +all: + : # do nothing + +SHELL = /bin/bash +install: + # Create virtualenv + install -d $(DESTDIR)$(prefix)/share/virtscreen + virtualenv $(DESTDIR)$(prefix)/share/virtscreen/env --always-copy + source $(HOME)/miniconda/bin/activate && \ + conda create -y --copy --prefix $(DESTDIR)$(prefix)/share/virtscreen/env python=3.6 + source $(HOME)/miniconda/bin/activate && \ + source activate $(DESTDIR)$(prefix)/share/virtscreen/env && \ + pip install . + # Fix hashbang and move executable + sed -i "1s:.*:#!$(prefix)/share/virtscreen/env/bin/python3:" \ + $(DESTDIR)$(prefix)/share/virtscreen/env/bin/virtscreen + install -D $(DESTDIR)$(prefix)/share/virtscreen/env/bin/virtscreen \ + $(DESTDIR)$(prefix)/bin/virtscreen + # Delete unnecessary installed files done by setup.py + rm -rf $(DESTDIR)$(prefix)/share/virtscreen/env/lib/python3.6/site-packages/usr + # Copy desktop entry and icon + install -m 644 -D data/virtscreen.desktop \ + $(DESTDIR)$(prefix)/share/applications/virtscreen.desktop + install -m 644 -D data/virtscreen.png \ + $(DESTDIR)$(prefix)/share/pixmaps/virtscreen.png + +clean: + : # do nothing + +distclean: clean + +uninstall: + : # do nothing + +# override_dh_usrlocal: +# : # do nothing + +.PHONY: all install clean distclean uninstall diff --git a/package/debian/control.virtualenv b/package/debian/control.virtualenv new file mode 100644 index 0000000..50e0dbb --- /dev/null +++ b/package/debian/control.virtualenv @@ -0,0 +1,16 @@ +Source: virtscreen +Section: utils +Priority: optional +Maintainer: Bumsik Kim +Build-Depends: debhelper (>=9), python3-all +Standards-Version: 3.9.8 +Homepage: https://github.com/kbumsik/VirtScreen +X-Python3-Version: >= 3.5 + +Package: virtscreen +Architecture: all +Multi-Arch: foreign +Depends: ${misc:Depends}, x11vnc, qtbase5-dev +Description: Make your iPad/tablet/computer as a secondary monitor on Linux + VirtScreen is an easy-to-use Linux GUI app that creates a virtual + secondary screen and shares it through VNC. diff --git a/package/debian/copy_debian.sh b/package/debian/copy_debian.sh index 1c96b6e..6adc95b 100755 --- a/package/debian/copy_debian.sh +++ b/package/debian/copy_debian.sh @@ -3,5 +3,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $DIR/_common.sh -echo $DIR/{control,rules,README.Debian} $DIR/build/virtscreen-$PKGVER/debian -cp $DIR/{control,rules,README.Debian} $DIR/build/virtscreen-$PKGVER/debian +if [ $1 = "virtualenv" ]; then + cp $DIR/control.virtualenv $DIR/build/virtscreen-$PKGVER/debian/control + cp $DIR/README.Debian $DIR/build/virtscreen-$PKGVER/debian/ +else + cp $DIR/{control,rules,README.Debian} $DIR/build/virtscreen-$PKGVER/debian +fi diff --git a/package/debian/debmake.sh b/package/debian/debmake.sh index 163b2d5..0b262d0 100755 --- a/package/debian/debmake.sh +++ b/package/debian/debmake.sh @@ -12,4 +12,9 @@ mv VirtScreen-$PKGVER virtscreen-$PKGVER mv $PKGVER.tar.gz virtscreen-$PKGVER.tar.gz cd virtscreen-$PKGVER -debmake -b':py3' +if [ $1 = "virtualenv" ]; then + cp ../../Makefile.virtualenv Makefile + debmake -b':sh' +else + debmake -b':py3' +fi diff --git a/package/debian/debuild.sh b/package/debian/debuild.sh index e517143..27e359e 100755 --- a/package/debian/debuild.sh +++ b/package/debian/debuild.sh @@ -4,4 +4,8 @@ source _common.sh cd build cd virtscreen-$PKGVER -debuild +if [ $1 = "virtualenv" ]; then + dpkg-buildpackage -b +else + debuild +fi