#!/bin/sh # # This is the make-kpkg hook file, which runs when make-kpkg is invoked # (from debian/rules) to create the flavour-independent kernel-headers # package. The major tasks it performs is removing unneeded # include/asm-* directories. # set -e # The scripts/ directory should be supplied for each flavour, since some # archs do some *very* strange things... rm -rf scripts # Let's add the flavours that are built for a given arch. # XXX: will probably need rethinking once the common headers are Arch: all. echo @flavours@ >flavours # XXX: once we're using a linux-headers-$(version)-$(debnum) that's Arch: all, # we'll want to drop this bit of code. The asm-* directories should remain. remove= cd include for i in asm-*; do case ${i#asm-} in generic | @headers_dirs@) ;; *) remove="$remove $i" ;; esac done ${remove:+rm -r $remove}