#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # # Modified to make a template file for a multi-binary package with separated # build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Prevent setuptools/distribute from accessing the internet. export http_proxy = http://127.0.9.1:9 include /usr/share/dpkg/pkg-info.mk export BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d @"$(SOURCE_DATE_EPOCH)") # This has to be exported to make some magic below work. export DH_OPTIONS export PYBUILD_DISABLE_python3.3=test export PYBUILD_DISABLE_python3.5=test export PYBUILD_DISABLE_python3.6=test PYTHONDIR=/usr/lib/python3/dist-packages/ PYTHON:=$(shell py3versions -r) install_dir=$(call py_libdir, $(PYTHON)) %: dh $@ --with sphinxdoc,systemd,python3 override_dh_python3: ./share/requires.py --distribution debian --suite $(DEB_DISTRIBUTION) --package lava-dispatcher > dispatcher-requirements.txt ./share/requires.py --distribution debian --suite $(DEB_DISTRIBUTION) --package lava-server > server-requirements.txt ./share/requires.py --distribution debian --suite $(DEB_DISTRIBUTION) --package lava-common > common-requirements.txt dh_python3 -p lava-dispatcher --shebang=/usr/bin/python3 --requires=dispatcher-requirements.txt dh_python3 -p lava-server --shebang=/usr/bin/python3 --requires=server-requirements.txt dh_python3 -p lava-common --shebang=/usr/bin/python3 --requires=common-requirements.txt override_dh_auto_build: python3 setup.py build make -C man/ man SPHINXBUILD="/usr/share/sphinx/scripts/python3/sphinx-build" SPHINXOPTS="-D today=\"$(BUILD_DATE)\"" make -C doc/v2/ html SPHINXBUILD="/usr/share/sphinx/scripts/python3/sphinx-build" SPHINXOPTS="-j 4 -D today=\"$(BUILD_DATE)\"" $(RM) doc/v2/_build/html/objects.inv make -C man/ man SPHINXBUILD="/usr/share/sphinx/scripts/python3/sphinx-build" SPHINXOPTS="-j 4 -D today=\"$(BUILD_DATE)\"" override_dh_auto_install: find . -path '*/__pycache__/*' -delete find . -type d -name '__pycache__' -empty -delete dh_installman -plava-dispatcher man/_build/man/lava-run.1 dh_installman -plava-dispatcher man/_build/man/lava-slave.8 dh_installman -plava-lxc-mocker man/_build/man/lava-lxc-mocker.7 dh_installman -plava-lxc-mocker man/_build/man/lxc-attach.1 dh_installman -plava-lxc-mocker man/_build/man/lxc-create.1 dh_installman -plava-lxc-mocker man/_build/man/lxc-destroy.1 dh_installman -plava-lxc-mocker man/_build/man/lxc-device.1 dh_installman -plava-lxc-mocker man/_build/man/lxc-info.1 dh_installman -plava-lxc-mocker man/_build/man/lxc-start.1 dh_installman -plava-lxc-mocker man/_build/man/lxc-stop.1 python3 setup.py install --root=$(CURDIR)/debian/lava/ --install-layout=deb cp ./etc/lava-slave.service debian/ dh_systemd_enable -p lava-dispatcher --name lava-slave dh_systemd_start -p lava-dispatcher --name lava-slave [ -f debian/lava-server/usr/bin/lava-server ] || mkdir -p debian/lava-server/usr/bin/; cp ./debian/lava/$(PYTHONDIR)/lava_server/manage.py debian/lava-server/usr/bin/lava-server; chmod a+x debian/lava-server/usr/bin/lava-server dh_installman -plava-server man/_build/man/lava-server.1 # handle embedded JS python3 ./share/javascript.py -f ./share/javascript.yaml --remove # handle systemd services cp ./etc/lava-server-gunicorn.service debian/lava-server.lava-server-gunicorn.service cp ./etc/lava-logs.service debian/lava-server.lava-logs.service cp ./etc/lava-master.service debian/lava-server.lava-master.service cp ./etc/lava-publisher.service debian/lava-server.lava-publisher.service dh_systemd_enable -p lava-server --name lava-server-gunicorn dh_systemd_enable -p lava-server --name lava-logs dh_systemd_enable -p lava-server --name lava-publisher dh_systemd_enable -p lava-server --name lava-master dh_systemd_start -p lava-server --name lava-server-gunicorn dh_systemd_start -p lava-server --name lava-logs dh_systemd_start -p lava-server --name lava-publisher dh_systemd_start -p lava-server --name lava-master override_dh_fixperms-arch: dh_fixperms -X debian/lava-dispatcher/usr/lib/python3/dist-packages/lava_dispatcher/dynamic_vm_keys/lava # ssh connections use a shared private key - use the same location for debian & ubuntu chmod 0600 debian/lava-dispatcher/usr/lib/python3/dist-packages/lava_dispatcher/dynamic_vm_keys/lava chmod 0644 debian/lava-dispatcher/usr/lib/python3/dist-packages/lava_dispatcher/dynamic_vm_keys/lava.pub override_dh_installinit: dh_installinit -Nlava-server override_dh_compress: dh_compress -X.yaml $(RM) -r debian/lava/usr/lib $(RM) -r debian/lava/usr/bin override_dh_auto_clean: python3 setup.py clean -a find . -path '*/__pycache__/*' -delete $(RM) -r lava.egg-info setup.cfg .idea/ build/ $(RM) -r .eggs/ versiontools-*.egg/ doc/build/ doc/html/ $(RM) debian/lava-slave.service find . -type d -name '__pycache__' -empty -delete $(RM) -r dist/ jquery.cookie.js $(RM) debian/*.service $(RM) common-requirements.txt dispatcher-requirements.txt server-requirements.txt [ ! -f doc/Makefile ] || make -C doc/ clean [ ! -f doc/v1/Makefile ] || make -C doc/v1/ clean [ ! -f doc/v2/Makefile ] || make -C doc/v2/ clean [ ! -f man/Makefile ] || make -C man/ clean