#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 include /usr/share/dpkg/pkg-info.mk export DEB_BUILD_MAINT_OPTIONS = hardening=+all %: dh $@ override_dh_auto_configure: find $(CURDIR) -name '*.xml' -exec chmod a-x {} \; find $(CURDIR) -name '*.html' -exec chmod a-x {} \; find $(CURDIR) -name '*.gyp' -exec chmod a-x {} \; find $(CURDIR) -name '*.md' -exec chmod a-x {} \; find $(CURDIR) -name '*.png' -exec chmod a-x {} \; find $(CURDIR) -name '*.jpg' -exec chmod a-x {} \; find $(CURDIR) -name '*.h' -exec chmod a-x {} \; chmod a-x examples/make-example-files.sh chmod a-x vagrant/scripts/setup-node.sh chmod a-x examples/make-example-files.sh chmod a-x vagrant/user.sh dh_auto_configure node-pre-gyp configure override_dh_auto_build: node-pre-gyp build find $(CURDIR)/build -name 'opencv.node' -exec chmod a-x {} \; override_dh_auto_clean: dh_auto_clean rm -rf node_modules rm -rf build override_dh_installexamples: dh_installexamples -Xtmp/ DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/-[^-]*$$//') GIT_URL = https://github.com/peterbraden/node-opencv.git get-orig-source: set -e; if echo $(DEB_VERSION) | grep -c "git"; \ then \ git_version=`echo $(DEB_VERSION) | sed -e 's/^.*git\([0-9]*\)*\.\(.*\)-.*$$/\2/g'`; \ else \ git_version=$(DEB_UPSTREAM_VERSION); \ fi; \ tmpdir=`mktemp -d -t`; \ cd $$tmpdir; \ echo "checkout upstream repository ..."; \ git clone $(GIT_URL); echo "getting specific upstream revision/tag: $$git_version"; \ cd `ls | head -n 1`; git checkout -b orig $$git_version; cd ..; \ tar --exclude=.git --exclude='*.exe' --exclude='*.jar' -czvf $(CURDIR)/$(DEB_SOURCE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz `ls | head -n 1`; \ cd $(CURDIR); \ rm -rf $$tmpdir