openafs (1.3.87-1) unstable; urgency=low
* New upstream version.
+ * Diagnose unsupported architectures earlier and with a clearer error.
+ * Suppress error messages from a missing kernel version header since
+ they occur normally when doing the regular package build and are just
+ confusing. Instead, print an error in kern-sysname and abort if the
+ kernel version could not be determined.
--
#!/bin/sh
+
+if [ x"$KVERS" = x ] ; then
+ echo "ERROR: no kernel version" >&2
+ echo " ($KSRC/include/linux/version.h not found?)" >&2
+ echo UNKNOWN
+ exit 1
+fi
+
case `arch` in
i[3456]86)
- case $KVERS in
- 2.2*)
- echo i386_linux22
- ;;
- 2.4*)
- echo i386_linux24
- ;;
- 2.6*)
- echo i386_linux26
- ;;
- esac
-;;
+ case $KVERS in
+ 2.2*)
+ echo i386_linux22
+ ;;
+ 2.4*)
+ echo i386_linux24
+ ;;
+ 2.6*)
+ echo i386_linux26
+ ;;
+ esac
+ ;;
x86_64)
- case $KVERS in
- 2.4*)
- echo amd64_linux24
- ;;
- 2.6*)
- echo amd64_linux26
- ;;
- esac
-;;
- ia64)
+ case $KVERS in
+ 2.4*)
+ echo amd64_linux24
+ ;;
+ 2.6*)
+ echo amd64_linux26
+ ;;
+ esac
+ ;;
+ia64)
echo ia64_linux24
-;;
- alpha)
- case $KVERS in
- 2.2*)
- echo alpha_linux_22
- ;;
- 2.4*)
- echo alpha_linux_24
- ;;
- esac
-;;
- sparc)
- case $KVERS in
- 2.2*)
- echo sparc_linux22
- ;;
- 2.4*)
- echo sparc_linux24
- ;;
- esac
- ;;
- sparc64)
- case $KVERS in
- 2.2*)
- echo sparc64_linux22
- ;;
- 2.4*)
- echo sparc64_linux24
- ;;
- esac
- ;;
-
- ppc)
- case $KVERS in
- 2.2*)
- echo ppc_linux22
- ;;
- 2.4*)
- echo ppc_linux24
- ;;
- 2.6)
- echo ppc_linux26
- ;;
- esac
- ;;
- s390)
- echo s390_linux24
- ;;
- *)
- echo ERROr: sysname not yet known
- exit 1
-
+ ;;
+alpha)
+ case $KVERS in
+ 2.2*)
+ echo alpha_linux_22
+ ;;
+ 2.4*)
+ echo alpha_linux_24
+ ;;
+ esac
+ ;;
+sparc)
+ case $KVERS in
+ 2.2*)
+ echo sparc_linux22
+ ;;
+ 2.4*)
+ echo sparc_linux24
+ ;;
+ esac
+ ;;
+sparc64)
+ case $KVERS in
+ 2.2*)
+ echo sparc64_linux22
+ ;;
+ 2.4*)
+ echo sparc64_linux24
+ ;;
+ esac
+ ;;
+ppc)
+ case $KVERS in
+ 2.2*)
+ echo ppc_linux22
+ ;;
+ 2.4*)
+ echo ppc_linux24
+ ;;
+ 2.6)
+ echo ppc_linux26
+ ;;
+ esac
+ ;;
+s390)
+ echo s390_linux24
+ ;;
+*)
+ echo "ERROR: unsupported architecture" >&2
+ echo UNKNOWN
+ exit 1
esac
endif
# The AFS sysname is determined by a script
-KVERS=`perl -e '$$_ = <>; $$_ =~ m/"(.+)"/; print "$$1\n";' < $(KSRC)/include/linux/version.h`
-SYS_NAME=$(shell KVERS=$(KVERS) sh debian/sysname)
+SYS_NAME := $(shell KVERS=$(KVERS) sh debian/sysname)
ifndef KSRC
KSRC = /usr/src/linux
endif
ifndef KPKG_DEST_DIR
KPKG_DEST_DIR = ..
endif
+KVERS := `perl -e '$$_ = <>; $$_ =~ m/"(.+)"/; print "$$1\n";' $(KSRC)/include/linux/version.h 2> /dev/null`
export KSRC
export KVERS
export KPKG_DEST_DIR
package = openafs
srcpkg = openafs-modules-source
-modulepkg = $(shell echo openafs-modules-$(KVERS)${INT_SUBARCH})
-moduledir = debian/$(modulepkg)/lib/modules/$(KVERS)/fs
+modulepkg := $(shell echo openafs-modules-$(KVERS)${INT_SUBARCH})
+moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs
LINTIAN_PACKAGES = openafs-dbserver openafs-client openafs-fileserver
configure: configure-stamp
configure-stamp:
+ @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
dh_testdir
-ln -s @sys/dest dest
-ln -s $(SYS_NAME) @sys
configure-modules: configure-modules-stamp
configure-modules-stamp:
+ @if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
ifeq ($(KERNEL_DEPENDS),y)
sh debian/prep-modules $(KSRC) debian/control.module > debian/control
else