#!/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 b=$(CURDIR)/debian ## kernel package specific stuff # Name of the source package psource:=ngcp-mediaproxy-ng-kernel-source # Name of the dkms package pdkms:=ngcp-mediaproxy-ng-kernel-dkms # short upstream name, used for module source directory sname:=ngcp-mediaproxy-ng # Source version sversion:=$(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2) PACKAGE=ngcp-mediaproxy-ng-kernel MA_DIR ?= /usr/share/modass -include $(MA_DIR)/include/generic.make -include $(MA_DIR)/include/common-rules.make kdist_configure: prep-deb-files kdist_clean: clean $(MAKE) $(MFLAGS) -f debian/rules clean ## end of kernel package specific stuff build: build-stamp build-stamp: dh_testdir make -C iptables-extension make -C daemon touch $@ clean: dh_testdir dh_testroot cd daemon && $(MAKE) clean && cd .. rm -f build-stamp rm -f iptables-extension/libxt_MEDIAPROXY.so rm -f daemon/mediaproxy-ng daemon/build_time.h daemon/.depend kernel-module/.xt_MEDIAPROXY.o.d rm -rf kernel-module/.tmp_versions dh_clean -rm -rf debian/build install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Create the directories to install the source into dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion) # Copy only the driver source to the proper locations cd kernel-module && cp Makefile *.c *.h ../debian/$(psource)/usr/src/modules/$(sname) cd kernel-module && cp Makefile *.c *.h ../debian/$(pdkms)/usr/src/$(sname)-$(sversion) # Copy the needed debian/ pieces to the proper location cp debian/*.modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian cp debian/control debian/changelog debian/copyright debian/README.Debian \ debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/ install -m 0755 debian/rules.modules debian/$(psource)/usr/src/modules/$(sname)/debian/rules cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules # Prepare dkms.conf from the dkms.conf.in template sed "s/__VERSION__/$(sversion)/g" debian/dkms.conf.in > debian/$(pdkms)/usr/src/$(sname)-$(sversion)/dkms.conf dh_install %: @echo "--- Building: $@" dh_installdirs -p$@ -P$(b)/$@ dh_link -p$@ -P$(b)/$@ dh_installdocs -p$@ -P$(b)/$@ dh_installchangelogs -p$@ -P$(b)/$@ dh_installinit -p$@ -P$(b)/$@ dh_install -p$@ -P$(b)/$@ dh_strip --dbg-package=ngcp-mediaproxy-ng-dbg dh_compress -p$@ -P$(b)/$@ dh_fixperms -p$@ -P$(b)/$@ dh_makeshlibs -p$@ -P$(b)/$@ -V dh_installdeb -p$@ -P$(b)/$@ dh_shlibdeps -p$@ -P$(b)/$@ dh_installdebconf -p$@ -P$(b)/$@ dh_gencontrol -p$@ -P$(b)/$@ dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ # Build architecture dependant packages binary-arch: install \ ngcp-mediaproxy-ng-daemon \ ngcp-mediaproxy-ng-dbg \ ngcp-mediaproxy-ng-iptables # Build architecture independant packages binary-indep: build install \ ngcp-mediaproxy-ng \ ngcp-mediaproxy-ng-dev \ ngcp-mediaproxy-ng-kernel-dkms \ ngcp-mediaproxy-ng-kernel-source binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install kdist kdist_configure kdist_image kdist_clean