#!/usr/bin/make -f export DH_VERBOSE=1 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) ifndef DESTDIR DESTDIR=$(CURDIR)/debian/tmp/ endif DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[\[:digit:]]*://' -e 's/[-].*//') MAJOR := $(shell echo '$(VERSION)' | awk -F . {'print $$1'}) MINOR := $(shell echo '$(VERSION)' | awk -F . {'print $$2'}) REV := $(shell echo '$(VERSION)' | awk -F . {'print $$3'}) DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LIBDIR := /usr/lib/$(DEB_HOST_MULTIARCH)/ %: dh $@ override_dh_auto_build: CPPFLAGS=$(CPPFLAGS) VERSION_MAJ=$(MAJOR) VERSION_MIN=$(MINOR) VERSION_REV=$(REV) PREFIX=/usr SYSCONFDIR=/etc/openzwave instlibdir=$(LIBDIR) make override_dh_auto_install: VERSION_MAJ=$(MAJOR) VERSION_MIN=$(MINOR) VERSION_REV=$(REV) DESTDIR=$(DESTDIR) PREFIX=/usr SYSCONFDIR=/etc/openzwave instlibdir=$(LIBDIR) make install # install docs in /usr/share/doc/openzwave/, not openzwave-VERSION install -d debian/libopenzwave-doc/usr/share/doc mv debian/tmp/usr/share/doc/openzwave-1* debian/libopenzwave-doc/usr/share/doc/openzwave # install config files in /etc/ install -d debian/libopenzwave1.3/etc mv debian/tmp/usr/etc/openzwave debian/libopenzwave1.3/etc/ update_debian_version: sed -i '1 s/(.*)/($(shell git describe --long --tags --dirty | sed s/-/./g | sed s/^v// ))/' debian/changelog