3 include /usr
/share
/dpkg
/pkg-info.mk
6 VERSION
:= $(DEB_VERSION_UPSTREAM
)
7 REVISION
:= $(shell echo
$(DEB_VERSION
) | cut
-d-
-f2
)
8 LINUX_NEXT
:= $(shell awk
-F.
'{print $$1 "." $$2+1}' debian
/linux_compat
)
10 export DEB_BUILD_MAINT_OPTIONS
= hardening
=+all
13 DEB_HOST_ARCH
= $(shell dpkg-architecture
-qDEB_HOST_ARCH
)
17 KVERS
=$(shell uname
-r
)
20 non_epoch_version
=$(shell echo
$(KVERS
) | perl
-pe
's/^\d+://')
21 pmodules
= $(NAME
)-modules-
$(non_epoch_version
)
24 dh
$@
--with dkms
,autoreconf
--parallel
26 override_dh_auto_configure
:
27 sed
"s/@LINUX_COMPAT@/linux-libc-dev \(<< $(LINUX_NEXT)~\)/" debian
/control.in
> debian
/control
29 @
# Embed the downstream version in the module.
31 -e
's/^Version:.*/Version: $(VERSION)/' \
32 -e
's/^Release:.*/Release: $(REVISION)/' \
35 @
# Build the userland, but don't build the kernel modules.
36 dh_auto_configure
-- --with-config
=user
--disable-debug-kmem
38 override_dh_auto_test
:
39 # scripts/check.sh tries insmod and rmmod, so it cannot
40 # run in an unprivileged build environment.
42 override_dh_auto_install
:
43 @
# Install the utilities.
44 $(MAKE
) install DESTDIR
='$(CURDIR)/debian/tmp'
46 @
# Get a bare copy of the source code.
47 @
# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
50 @
# This shunt allows DKMS to install the Module.symvers and spl_config.h
51 @
# files to the ${dkms_tree} area through the POST_INSTALL directive.
52 echo
'#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
53 echo
'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
54 chmod
755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
56 # Install the DKMS source.
57 mkdir
-p
'$(CURDIR)/debian/tmp/usr/src/'
58 mv
'$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
63 override_dh_auto_clean
:
65 @if
test -e META.orig
; then mv META.orig META
; fi
66 sed
"s/@LINUX_COMPAT@/linux-libc-dev \(<< $(LINUX_NEXT)~\)/" debian
/control.in
> debian
/control
70 override_dh_prep-deb-files
:
71 for templ in
$(wildcard $(CURDIR
)/debian
/*_KVERS_
*.in
); do \
72 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' \
73 < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g ; s/\.in$$//'` ; \
75 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' \
76 < debian
/control.modules.in
> debian
/control
78 override_dh_configure_modules
: override_dh_configure_modules_stamp
79 override_dh_configure_modules_stamp
:
80 .
/configure
--with-config
=kernel
--with-linux
=$(KSRC
) \
81 --with-linux-obj
=$(KOBJ
) \
83 touch override_dh_configure_modules_stamp
85 override_dh_binary-modules-udeb
: override_dh_prep-deb-files override_dh_configure_modules
90 $(MAKE
) -C
$(CURDIR
)/module modules
92 dh_installdirs
-p
${pmodules}-di
93 dh_install
-p
${pmodules}-di
94 dh_gencontrol
-p
${pmodules}-di
96 dh_builddeb
-p
${pmodules}-di
98 override_dh_binary-modules
: override_dh_prep-deb-files override_dh_configure_modules
103 $(MAKE
) -C
$(CURDIR
)/module modules
105 dh_installdocs
-p
${pmodules}
106 dh_install
-p
${pmodules}
107 dh_installchangelogs
-p
${pmodules}
108 dh_compress
-p
${pmodules}
109 dh_strip
-p
${pmodules}
110 dh_fixperms
-p
${pmodules}
111 dh_installdeb
-p
${pmodules}
112 dh_gencontrol
-p
${pmodules}
113 dh_md5sums
-p
${pmodules}
115 dh_builddeb
-p
${pmodules}