3 NAME
:= $(shell awk
'$$1 == "Name:" { print $$2; }' META
)
4 VERSION
:= $(shell dpkg-parsechangelog \
5 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f1
)
6 REVISION
:= $(shell dpkg-parsechangelog \
7 | awk
'$$1 == "Version:" { print $$2; }' | cut
-d-
-f2-
)
10 DEB_HOST_ARCH
= $(shell dpkg-architecture
-qDEB_HOST_ARCH
)
14 KVERS
=$(shell uname
-r
)
17 non_epoch_version
=$(shell echo
$(KVERS
) | perl
-pe
's/^\d+://')
19 pmodules
= $(PACKAGE
)-modules-
$(non_epoch_version
)
22 dh
$@
--with dkms
,autoreconf
--parallel
24 override_dh_auto_configure
:
25 sed
"s/@LINUX_COMPAT@/linux-libc-dev \(< $(shell debian/get_next.sh)\)/" debian
/control.in
> debian
/control
27 @
# Embed the downstream version in the module.
29 -e
's/^Version:.*/Version: $(VERSION)/' \
30 -e
's/^Release:.*/Release: $(REVISION)/' \
33 @
# Build the userland, but don't build the kernel modules.
34 dh_auto_configure
-- --with-config
=user
--disable-debug-kmem
36 override_dh_auto_test
:
37 # scripts/check.sh tries insmod and rmmod, so it cannot
38 # run in an unprivileged build environment.
40 override_dh_auto_install
:
41 @
# Install the utilities.
42 $(MAKE
) install DESTDIR
='$(CURDIR)/debian/tmp'
44 @
# Get a bare copy of the source code.
45 @
# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
48 @
# This shunt allows DKMS to install the Module.symvers and spl_config.h
49 @
# files to the ${dkms_tree} area through the POST_INSTALL directive.
50 echo
'#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
51 echo
'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
52 chmod
755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
54 # Install the DKMS source.
55 mkdir
-p
'$(CURDIR)/debian/tmp/usr/src/'
56 mv
'$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
61 override_dh_auto_clean
:
63 @if
test -e META.orig
; then mv META.orig META
; fi
64 sed
"s/@LINUX_COMPAT@/linux-libc-dev \(< $(shell debian/get_next.sh)\)/" debian
/control.in
> debian
/control
68 override_dh_prep-deb-files
:
69 for templ in
$(wildcard $(CURDIR
)/debian
/*_KVERS_
*.in
); do \
70 sed
-e
's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g' \
71 < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g ; s/\.in$$//'` ; \
73 sed
-e
's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g' \
74 < debian
/control.modules.in
> debian
/control
76 override_dh_configure_modules
: override_dh_configure_modules_stamp
77 override_dh_configure_modules_stamp
:
78 .
/configure
--with-config
=kernel
--with-linux
=$(KSRC
) \
79 --with-linux-obj
=$(KOBJ
) \
81 touch override_dh_configure_modules_stamp
83 override_dh_binary-modules-udeb
: override_dh_prep-deb-files override_dh_configure_modules
88 $(MAKE
) -C
$(CURDIR
)/module modules
90 dh_installdirs
-p
${pmodules}-di
91 dh_install
-p
${pmodules}-di
92 dh_gencontrol
-p
${pmodules}-di
94 dh_builddeb
-p
${pmodules}-di
96 override_dh_binary-modules
: override_dh_prep-deb-files override_dh_configure_modules
101 $(MAKE
) -C
$(CURDIR
)/module modules
103 dh_installdocs
-p
${pmodules}
104 dh_install
-p
${pmodules}
105 dh_installchangelogs
-p
${pmodules}
106 dh_compress
-p
${pmodules}
107 dh_strip
-p
${pmodules}
108 dh_fixperms
-p
${pmodules}
109 dh_installdeb
-p
${pmodules}
110 dh_gencontrol
-p
${pmodules}
111 dh_md5sums
-p
${pmodules}
113 dh_builddeb
-p
${pmodules}