Import Debian changes 1.8.5-1
[hcoop/debian/openafs.git] / debian / openafs-modules-dkms.dkms
CommitLineData
b7cfede0
BK
1# DKMS configuration for the OpenAFS kernel module. -*- sh -*-
2
3# For i386 and amd64, extract the architecture from the kernel version string.
4# The version string will look like 3.2.0-4-686-pae or 3.2.0-4-amd64. This
5# allows building amd64 kernel modules on the i386 architecture. Further
6# cases like this can be added later if other architectures have similar
7# issues.
8ARCH=`echo "$kernelver" | cut -d- -f 3`
9case "$ARCH" in
10 amd64) AFS_SYSNAME="amd64_linuxXX" ;;
11 486 | 686) AFS_SYSNAME="i386_linuxXX" ;;
12 *) AFS_SYSNAME="UNKNOWN" ;;
13esac
14
15# The kernel version should be part of the SYSNAME. We really only support
16# 2.6 and later, but be complete.
17case "$kernelver" in
18 2.2.*) AFS_SYSKVERS=22 ;;
19 2.4.*) AFS_SYSKVERS=24 ;;
20 2.6.* | 3.*) AFS_SYSKVERS=26 ;;
21 *) AFS_SYSKVERS=26 ;;
22esac
23AFS_SYSNAME=`echo "$AFS_SYSNAME" | sed "s/XX\$/$AFS_SYSKVERS/"`
24
25# The version is replaced at build time by dh_dkms invoked in debian/rules.
26PACKAGE_NAME="openafs"
27PACKAGE_VERSION="#MODULE_VERSION#"
28
29# General DKMS settings.
30BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
31DEST_MODULE_LOCATION[0]="/updates/dkms/"
32AUTOINSTALL=yes
33
34# Tell configure the sysname if we were able to determine it.
35if [ "${AFS_SYSNAME}" = 'UNKNOWN' ] ; then
36 CONFIGURE_SYSNAME=
37else
38 CONFIGURE_SYSNAME="--with-afs-sysname=${AFS_SYSNAME}"
39fi
40
41# Set the build and clean rules.
42MAKE[0]="(./configure --disable-linux-syscall-probing ${CONFIGURE_SYSNAME} \
43 --with-linux-kernel-packaging \
44 --with-linux-kernel-headers=${kernel_source_dir} \
45 && make \
46 && mv src/libafs/MODLOAD-*/openafs.ko .)"
47CLEAN="rm -f openafs.ko && make clean"