3 # Determine whether we're building with optimization. This doesn't really
4 # work at the moment due to upstream problems.
5 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
6 DEBIAN_OPT_FLAGS
= --disable-optimize
--disable-optimize-lwp
7 DEBIAN_KERN_FLAGS
= --disable-optimize-kernel
13 # Find kernel build information.
15 KSRC
:= /lib
/modules
/$(shell uname
-r
)/build
20 KVERS
:= $(shell perl debian
/kernel-version
$(KSRC
))
25 SYS_NAME
:= $(shell KSRC
="$(KSRC)" KVERS
="$(KVERS)" ARCH
="$(ARCH)" \
29 modulepkg
:= openafs-modules-
$(KVERS
)${INT_SUBARCH}
30 moduledir
:= debian
/$(modulepkg
)/lib
/modules
/$(KVERS
)/fs
32 # After building the package, m-a calls debian/rules with the target
33 # echo-debfile. Without this dummy rule, this would trigger the setup
34 # target (by way of the wildcard rule for dh), which re-creates the setup
35 # flag file that we removed during make clean.
37 # Then, if module-assistant unpacks a new version of the source, the setup
38 # file already exists so the setup rule isn't run again. But the
39 # debian/control file is the template from the new source, which doesn't
40 # contain any buildable packages.
42 # Add a dummy target for echo-debfile to ensure that setup isn't run again
43 # after clean. If there are further changes to module-assistant, causing it
44 # to run other targets after clean, more similar dummy rules may need to be
49 # make-kpkg tries to rebuild debian/rules first, so add a dummy target to
50 # avoid our dh wildcard rule and a fatal error.
51 debian
/rules .
/debian
/rules
:
54 # This setup must be done before running any other target if it hasn't
57 @if
test x
"$(SYS_NAME)" = x
"UNKNOWN" ; then exit
1 ; fi
58 @if
test x
"$(KVERS)" = x
; then \
59 echo
'No version in $(KSRC)/include/linux/version.h' >&2 ; \
62 sh debian
/prep-modules
$(KSRC
)
68 override_dh_auto_configure
:
69 sh configure
--prefix=$(CURDIR
)/debian
/tmp \
70 --with-afs-sysname
=$(SYS_NAME
) \
71 --disable-linux-syscall-probing \
72 --with-linux-kernel-headers
=$(KSRC
) \
73 --with-linux-kernel-packaging \
74 --enable-debug
--enable-debug-lwp
--enable-debug-kernel \
75 $(DEBIAN_OPT_FLAGS
) $(DEBIAN_KERN_FLAGS
)
77 override_dh_auto_install
:
78 cd src
/libafs
&& make
install DESTDIR
=$(CURDIR
)/debian
/tmp
79 install -d
-g root
-o root
-m
755 $(moduledir
)
80 install -g root
-o root
-m
644 \
81 debian
/tmp
/lib
/modules
/*/extra
/openafs
/*o
$(moduledir
)/
84 rm -rf src
/libafs
/MODLOAD-
* *-stamp
85 dh_clean Makefile config.log config.status setup src
/libafs
/Makefile \
86 src
/libafs
/Makefile.common src
/libafs
/asm src
/libafs
/asm-generic \
87 src
/libafs
/h src
/libafs
/linux src
/libafs
/net src
/libafs
/netinet \
88 src
/libafs
/rpc src
/libafs
/sys
90 override_dh_gencontrol
:
91 dh_gencontrol
-- -v
`cat debian/VERSION`
94 dh_builddeb
--destdir
="$(KPKG_DEST_DIR)"
96 kdist_configure
: override_dh_auto_configure
99 $(ROOT_CMD
) $(MAKE
) $(MFLAGS
) -f debian
/rules binary-arch
100 $(ROOT_CMD
) $(MAKE
) $(MFLAGS
) -f debian
/rules
clean
103 $(ROOT_CMD
) $(MAKE
) $(MFLAGS
) -f debian
/rules binary-arch
104 KSRC
="$(KSRC)" KMAINT
="$(KMAINT)" KEMAIL
="$(KEMAIL)" \
105 sh
-v debian
/genchanges
106 $(ROOT_CMD
) $(MAKE
) $(MFLAGS
) -f debian
/rules
clean
109 $(ROOT_CMD
) $(MAKE
) $(MFLAGS
) -f debian
/rules
clean
111 .PHONY
: kdist kdist_clean kdist_configure kdist_image