#!/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. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # necessary for dpatch .NOTPARALLEL: DEB_BUILD_DIR=$(CURDIR)/debian/cryptobox CB_PYDIR=$(DEB_BUILD_DIR)/usr/lib/python$(shell pyversions -vr)/site-packages/cryptobox build: build-stamp build-stamp: dh_testdir python setup.py build touch build-stamp clean: clean-patched unpatch clean-patched: dh_testdir dh_testroot python setup.py clean rm -f build-stamp rm -rf build find -type f -name '*.py[co]' | xargs rm -f rm -f MANIFEST dh_clean patch: patch-stamp patch-stamp: dpatch apply-all touch patch-stamp unpatch: dpatch deapply-all rm -rf patch-stamp debian/patched install: build dh_testdir dh_testroot dh_clean -k dh_installdirs python setup.py install --root=$(DEB_BUILD_DIR) # the cryptobox is a webserver - it should be installed in /usr/sbin mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxWebserver $(DEB_BUILD_DIR)/usr/sbin/ mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxRootActions $(DEB_BUILD_DIR)/usr/sbin/ # remove tests rm -r $(CB_PYDIR)/tests # remove duplicate documentation files rm -r $(CB_PYDIR)/doc # move shared files install -d -m 755 $(DEB_BUILD_DIR)/usr/share/cryptobox mv $(CB_PYDIR)/share/* $(DEB_BUILD_DIR)/usr/share/cryptobox/ rmdir $(CB_PYDIR)/share # create log directory install -d -m 755 $(DEB_BUILD_DIR)/var/log/cryptobox # create pid directory install -d -m 755 $(DEB_BUILD_DIR)/var/run/cryptobox # install lintian override file: for multiple dependency caused by {python:Depends} install -D -m 644 debian/cryptobox.lintian \ $(DEB_BUILD_DIR)/usr/share/lintian/overrides/cryptobox # Build architecture-independent files here. binary-indep: build install # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_installlogrotate dh_installman dh_install dh_pycentral @# pycentral must be called before installinit - otherwise the DEBHELPER part @# in the postinst script is filled in the wrong order dh_installinit dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install clean-patched patch patch-stamp unpatch