Homepage: https://www.unipi.technology/
Vcs-Git: https://git.unipi.technology/UniPi/unipi-kernel.git
-Package: unipi-kernel-modules-dkms
-Architecture: all
-Pre-Depends: raspberrypi-kernel-headers | axon-kernel-headers | linux-headers(>=4.0), unipi-common
-Depends: ${misc:Depends}, dkms, unipi-firmware (>=5.50)
-Replaces: neuron-kernel, unipi-kernel-modules
-Conflicts: neuron-kernel, unipi-kernel-modules
-Description: UniPi Neuron/Axon kernel modules - DKMS source
- This package contains source code of kernel module for spi protocol
- used by internal boards in the UniPi Neuron/Axon controllers.
- Can be used with DKMS so that local kernel images are automatically
- built and installed every time relevant kernel packages are upgraded.
--- /dev/null
+Package: unipi-kernel-modules
+Architecture: arm64 armhf
+Pre-Depends: unipi-common
+Depends: ${misc:Depends}, axon-kernel-image(=${PKG-KERNEL-VER}) | raspberrypi-kernel(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
+Replaces: neuron-kernel
+Breaks: neuron-kernel
+Description: UniPi Neuron/Axon kernel modules
+ Binary kernel modules for UniPi Neuron/Axon controller. Compiled for axon-kernel-image
+ version.
+
--- /dev/null
+Package: unipi-kernel-modules-dkms
+Architecture: all
+Pre-Depends: raspberrypi-kernel-headers | axon-kernel-headers | linux-headers(>=4.0), unipi-common
+Depends: ${misc:Depends}, dkms, unipi-firmware (>=5.50)
+Replaces: neuron-kernel, unipi-kernel-modules
+Conflicts: neuron-kernel, unipi-kernel-modules
+Description: UniPi Neuron/Axon kernel modules - DKMS source
+ This package contains source code of kernel module for spi protocol
+ used by internal boards in the UniPi Neuron/Axon controllers.
+ Can be used with DKMS so that local kernel images are automatically
+ built and installed every time relevant kernel packages are upgraded.
+
--- /dev/null
+Package: g1-unipi-kernel-modules
+Architecture: arm64
+Pre-Depends: unipi-common
+Depends: ${misc:Depends}, g1-kernel-image(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
+Provides: unipi-kernel-modules
+Replaces: unipi-kernel-modules
+Breaks: unipi-kernel-modules
+Description: UniPi G1 kernel modules
+ Binary kernel modules for UniPi G1 gateway. Compiled for g1-kernel-image
+ version.
+
Homepage: https://www.unipi.technology/
Vcs-Git: https://git.unipi.technology/UniPi/unipi-kernel.git
-Package: unipi-kernel-modules-dkms
-Architecture: all
-Pre-Depends: raspberrypi-kernel-headers | axon-kernel-headers | linux-headers(>=4.0), unipi-common
-Depends: ${misc:Depends}, dkms, unipi-firmware (>=5.50)
-Replaces: neuron-kernel, unipi-kernel-modules
-Conflicts: neuron-kernel, unipi-kernel-modules
-Description: UniPi Neuron/Axon kernel modules - DKMS source
- This package contains source code of kernel module for spi protocol
- used by internal boards in the UniPi Neuron/Axon controllers.
- Can be used with DKMS so that local kernel images are automatically
- built and installed every time relevant kernel packages are upgraded.
-
+++ /dev/null
-
-Package: unipi-kernel-modules
-Architecture: arm64 armhf
-Pre-Depends: unipi-common
-Depends: ${misc:Depends}, axon-kernel-image(=${PKG-KERNEL-VER}) | raspberrypi-kernel(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
-Replaces: neuron-kernel
-Breaks: neuron-kernel
-Description: UniPi Neuron/Axon kernel modules
- Binary kernel modules for UniPi Neuron/Axon controller. Compiled for axon-kernel-image
- version.
-
+++ /dev/null
-
-Package: g1-unipi-kernel-modules
-Architecture: arm64 armhf
-Pre-Depends: unipi-common
-Depends: ${misc:Depends}, g1-kernel-image(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
-Provides: unipi-kernel-modules
-Replaces: unipi-kernel-modules
-Breaks: unipi-kernel-modules
-Description: UniPi G1 kernel modules
- Binary kernel modules for UniPi G1 gateway. Compiled for g1-kernel-image
- version.
-
+++ /dev/null
-Package: neuron-kernel
-Architecture: armhf
-Pre-Depends: unipi-common
-Depends: ${misc:Depends}, raspberrypi-kernel(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
-Description: UniPi Neuron kernel modules
- Binary kernel modules for UniPi Neuron controller. Compiled with
- raspberrypi-kernel from Raspbian distribution.
-
-Package: unipi-kernel-modules
-Architecture: arm64
-Pre-Depends: unipi-common
-Depends: ${misc:Depends}, axon-kernel-image(=${PKG-KERNEL-VER}) | raspberrypi-kernel(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
-Description: UniPi Neuron/Axon kernel modules
- Binary kernel modules for UniPi Neuron/Axon controller. Compiled for axon-kernel-image
- version.
-
--- /dev/null
+Package: neuron-kernel
+Architecture: armhf
+Pre-Depends: unipi-common
+Depends: ${misc:Depends}, raspberrypi-kernel(=${PKG-KERNEL-VER}), unipi-firmware (>=5.50)
+Description: UniPi Neuron kernel modules
+ Binary kernel modules for UniPi Neuron controller. Compiled with
+ raspberrypi-kernel from Raspbian distribution.
+
+++ /dev/null
-#!/usr/bin/make -f
-# See debhelper(7) (uncomment to enable)
-# output every command that modifies files on the build system.
-#export DH_VERBOSE = 1
-
-
-# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
-# see ENVIRONMENT in dpkg-buildflags(1)
-# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
-# package maintainers to append LDFLAGS
-#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
-export DEB_LDFLAGS_SET = -zrelro
-
-MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
-
-DEBIAN_VERSION=$(shell . /ci-scripts/include.sh ; echo $${DEBIAN_VERSION})
-
-PLATFORM=$(shell echo $${PLATFORM:-axon})
-
-ifeq ($(DEBIAN_VERSION),stretch)
- BINARY_PKG_NAME=neuron-kernel
- CONTROL_INC=stretch
-else
- BINARY_PKG_NAME=unipi-kernel-modules
- CONTROL_INC=buster
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),arm64)
-ifneq ($(PLATFORM),axon)
- CONTROL_INC=$(PLATFORM)
- BINARY_PKG_NAME=$(PLATFORM)-unipi-kernel-modules
-endif
-endif
-endif
-
-
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),armhf)
-ifeq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
-RPI_FIRMWARE_VER = $(shell dpkg-query -f='$${Version}' -W raspberrypi-kernel-headers)
-LINUX_DIR_PATH = $(shell dpkg -L raspberrypi-kernel-headers | sed -n '/^\/lib\/modules\/.*-v7.*\/build$$/p')
-KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
-else
-.raspbian-versions:
- misc/check-raspbian
-
-include ./.raspbian-versions
-LINUX_DIR_PATH = ${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-endif
-endif
-
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),arm64)
-PKG_KERNEL_VER = $(shell dpkg-query -f='$${Version}' -W $(PLATFORM)-kernel-headers)
-#PKG_KERNEL_VER = 4.14.111
-LINUX_DIR_PATH = $(shell dpkg -L $(PLATFORM)-kernel-headers | sed -n '/^\/lib\/modules\/.*\/build$$/p')
-#LINUX_DIR_PATH = '/lib/modules/4.14.111/build'
-KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
-endif
-
-clean:
- cat debian/control.in debian/control.in$(CONTROL_INC) >debian/control
- dh clean --with dkms
-
-%:
- dh $@ --with dkms
-
-
-override_dh_installmodules:
- DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
-
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),armhf)
-override_dh_prep:
- @dh_prep --exclude=$(BINARY_PKG_NAME).substvars
- @echo PKG-KERNEL-VER=${RPI_FIRMWARE_VER} >> debian/$(BINARY_PKG_NAME).substvars
- ( sed 's/)/.${RPI_FIRMWARE_VER})/;q' debian/changelog; \
- printf "\n * Compiled for raspberrypi-kernel\n";\
- printf "\n -- auto-generator <info@unipi.technology> %s\n\n" "`date -R`"; \
- cat debian/changelog;\
- ) >debian/$(BINARY_PKG_NAME).changelog
-endif
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),arm64)
-override_dh_prep:
- @dh_prep --exclude=unipi-kernel-modules.substvars
- @echo PKG-KERNEL-VER=${PKG_KERNEL_VER} > debian/unipi-kernel-modules.substvars
- @echo PKG-KERNEL-VER=${PKG_KERNEL_VER} > debian/$(PLATFORM)-unipi-kernel-modules.substvars
- ( sed 's/)/.${PKG_KERNEL_VER})/;q' debian/changelog; \
- printf "\n * Compiled for $(PLATFORM)-kernel-image\n";\
- printf "\n -- auto-generator <info@unipi.technology> %s\n\n" "`date -R`"; \
- cat debian/changelog;\
- ) >debian/unipi-kernel-modules.changelog
- @cat debian/unipi-kernel-modules.changelog > debian/$(PLATFORM)-unipi-kernel-modules.changelog
-endif
-
-override_dh_dkms:
- dh_dkms -V $(MOD_VERSION)
- make dkms DESTDIR=$(PWD)/debian/unipi-kernel-modules-dkms/usr/src/unipi-$(MOD_VERSION)
-
-#override_dh_build:
-
-ifneq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),armhf)
-override_dh_auto_configure:
- misc/check-raspbian
- misc/current
-endif
-endif
-
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),amd64)
-override_dh_auto_build:
- @echo "skip build"
-else
-override_dh_auto_build:
- for LDP in $(LINUX_DIR_PATH); do \
- make clean || exit 1;\
- dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- dh_auto_install --destdir=debian/tempdest -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- done
-endif
-
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),arm64)
-override_dh_auto_install:
- dh_auto_install --destdir=debian/$(BINARY_PKG_NAME) -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=$(LINUX_DIR_PATH) ARCH=${DEB_TARGET_ARCH_CPU}
-endif
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),armhf)
-override_dh_auto_install:
- mkdir -p debian/$(BINARY_PKG_NAME)
- mv debian/tempdest/* debian/$(BINARY_PKG_NAME) || exit 1;
- #for LDP in $(LINUX_DIR_PATH); do \
- # dh_auto_install --destdir=debian/$(BINARY_PKG_NAME) -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- # LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- #done
-endif
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),amd64)
-override_dh_auto_install:
- @echo skip install
-endif
-
-
-#override_dh_gencontrol:
-# dh_gencontrol
+++ /dev/null
-#!/usr/bin/make -f
-# See debhelper(7) (uncomment to enable)
-# output every command that modifies files on the build system.
-#export DH_VERBOSE = 1
-
-
-# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
-# see ENVIRONMENT in dpkg-buildflags(1)
-# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
-# package maintainers to append LDFLAGS
-#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
-export DEB_LDFLAGS_SET = -zrelro
-
-MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
-
-DEBIAN_VERSION=$(shell . /ci-scripts/include.sh ; echo $${DEBIAN_VERSION})
-
-ifeq ($(DEBIAN_VERSION),stretch)
- BINARY_PKG_NAME=neuron-kernel
- CONTROL_INC=stretch
-else
- BINARY_PKG_NAME=unipi-kernel-modules
- CONTROL_INC=buster
-endif
-
-
-PKG_KERNEL_VER = $(shell dpkg-query -f='$${Version}' -W axon-kernel-headers)
-#PKG_KERNEL_VER = 4.14.111
-LINUX_DIR_PATH = $(shell dpkg -L axon-kernel-headers | sed -n '/^\/lib\/modules\/.*\/build$$/p')
-#LINUX_DIR_PATH = '/lib/modules/4.14.111/build'
-KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
-
-clean:
- cat debian/control.in debian/control.in$(CONTROL_INC) >debian/control
- dh clean --with dkms
-
-%:
- dh $@ --with dkms
-
-
-override_dh_installmodules:
- DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
-
-override_dh_prep:
- @dh_prep --exclude=unipi-kernel-modules.substvars
- @echo PKG-KERNEL-VER=${PKG_KERNEL_VER} > debian/unipi-kernel-modules.substvars
- ( sed 's/)/.${PKG_KERNEL_VER})/;q' debian/changelog; \
- printf "\n * Compiled for axon-kernel-image\n";\
- printf "\n -- auto-generator <info@unipi.technology> %s\n\n" "`date -R`"; \
- cat debian/changelog;\
- ) >debian/unipi-kernel-modules.changelog
-
-
-override_dh_auto_build:
- for LDP in $(LINUX_DIR_PATH); do \
- make clean || exit 1;\
- dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- dh_auto_install --destdir=debian/tempdest -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- done
-
-override_dh_auto_install:
- dh_auto_install --destdir=debian/unipi-kernel-modules -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=$(LINUX_DIR_PATH) ARCH=${DEB_TARGET_ARCH_CPU}
-
--- /dev/null
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
+
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export DEB_LDFLAGS_SET = -zrelro
+
+MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
+
+clean:
+ cat debian/control.in debian/control.dkms >debian/control
+ dh clean --with dkms
+
+%:
+ dh $@ --with dkms
+
+
+override_dh_installmodules:
+ DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
+
+override_dh_dkms:
+ dh_dkms -V $(MOD_VERSION)
+ make dkms DESTDIR=$(PWD)/debian/unipi-kernel-modules-dkms/usr/src/unipi-$(MOD_VERSION)
+
+override_dh_auto_build:
+ @echo "skip build"
+
+override_dh_auto_install:
+ @echo skip install
+
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_LDFLAGS_SET = -zrelro
-MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
-
DEBIAN_VERSION=$(shell . /ci-scripts/include.sh ; echo $${DEBIAN_VERSION})
-
PLATFORM=$(shell echo $${PLATFORM:-axon})
-ifeq ($(DEBIAN_VERSION),stretch)
- BINARY_PKG_NAME=neuron-kernel
- CONTROL_INC=stretch
-else
- BINARY_PKG_NAME=unipi-kernel-modules
- CONTROL_INC=buster
-ifeq ($(shell dpkg-architecture -q DEB_HOST_ARCH),arm64)
+CONTROL_INC=$(PLATFORM)
+
ifneq ($(PLATFORM),axon)
- CONTROL_INC=$(PLATFORM)
+ BINARY_PKG_NAME=unipi-kernel-modules
+else
BINARY_PKG_NAME=$(PLATFORM)-unipi-kernel-modules
-endif
-endif
endif
KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
clean:
- cat debian/control.in debian/control.in$(CONTROL_INC) >debian/control
+ cat debian/control.in debian/control.$(CONTROL_INC) >debian/control
dh clean
%:
override_dh_auto_build:
- dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- LINUX_DIR_PATH=$(LINUX_DIR_PATH) ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
+ dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- LINUX_DIR_PATH=$(LINUX_DIR_PATH) ARCH=${DEB_TARGET_ARCH_CPU}
override_dh_auto_install:
dh_auto_install --destdir=debian/$(BINARY_PKG_NAME) -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
--- /dev/null
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
+
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+export DEB_LDFLAGS_SET = -zrelro
+
+DEBIAN_VERSION=$(shell . /ci-scripts/include.sh ; echo $${DEBIAN_VERSION})
+PLATFORM=$(shell echo $${PLATFORM:-neuron})
+
+ifeq ($(DEBIAN_VERSION),stretch)
+ BINARY_PKG_NAME=neuron-kernel
+ CONTROL_INC=neuron
+else
+ BINARY_PKG_NAME=unipi-kernel-modules
+ CONTROL_INC=axon
+endif
+
+## Check possible cross compile
+## LINUX_DIR_PATH can contain more directories !!
+ifeq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
+RPI_FIRMWARE_VER = $(shell dpkg-query -f='$${Version}' -W raspberrypi-kernel-headers)
+LINUX_DIR_PATH = $(shell dpkg -L raspberrypi-kernel-headers | sed -n '/^\/lib\/modules\/.*-v7.*\/build$$/p')
+KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
+else
+.raspbian-versions:
+ misc/check-raspbian
+include ./.raspbian-versions
+LINUX_DIR_PATH = ${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
+
+ifneq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
+override_dh_auto_configure:
+ misc/check-raspbian
+ misc/current
+endif
+
+endif
+
+clean:
+ cat debian/control.in debian/control.in$(CONTROL_INC) >debian/control
+ dh clean --with dkms
+
+%:
+ dh $@
+
+override_dh_installmodules:
+ DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
+
+override_dh_prep:
+ @dh_prep --exclude=$(BINARY_PKG_NAME).substvars
+ @echo PKG-KERNEL-VER=${RPI_FIRMWARE_VER} >> debian/$(BINARY_PKG_NAME).substvars
+ ( sed 's/)/.${RPI_FIRMWARE_VER})/;q' debian/changelog; \
+ printf "\n * Compiled for raspberrypi-kernel\n";\
+ printf "\n -- auto-generator <info@unipi.technology> %s\n\n" "`date -R`"; \
+ cat debian/changelog;\
+ ) >debian/$(BINARY_PKG_NAME).changelog
+
+
+## LINUX_DIR_PATH can contain more directories !!
+override_dh_auto_build:
+ for LDP in $(LINUX_DIR_PATH); do \
+ make clean || exit 1;\
+ dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
+ dh_auto_install --destdir=debian/tempdest -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
+ LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
+ done
+
+override_dh_auto_install:
+ mkdir -p debian/$(BINARY_PKG_NAME)
+ mv debian/tempdest/* debian/$(BINARY_PKG_NAME) || exit 1;
+++ /dev/null
-#!/usr/bin/make -f
-# See debhelper(7) (uncomment to enable)
-# output every command that modifies files on the build system.
-#export DH_VERBOSE = 1
-
-
-# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
-# see ENVIRONMENT in dpkg-buildflags(1)
-# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
-# package maintainers to append LDFLAGS
-#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
-export DEB_LDFLAGS_SET = -zrelro
-
-MOD_VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
-
-DEBIAN_VERSION=$(shell . /ci-scripts/include.sh ; echo $${DEBIAN_VERSION})
-
-ifeq ($(DEBIAN_VERSION),stretch)
- BINARY_PKG_NAME=neuron-kernel
- CONTROL_INC=stretch
-else
- BINARY_PKG_NAME=unipi-kernel-modules
- CONTROL_INC=buster
-endif
-
-ifeq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
-RPI_FIRMWARE_VER = $(shell dpkg-query -f='$${Version}' -W raspberrypi-kernel-headers)
-LINUX_DIR_PATH = $(shell dpkg -L raspberrypi-kernel-headers | sed -n '/^\/lib\/modules\/.*-v7.*\/build$$/p')
-KERNEL_VERSION = $(subst /lib/modules/,,$(subst /build,,$(LINUX_DIR_PATH)))
-else
-.raspbian-versions:
- misc/check-raspbian
-
-include ./.raspbian-versions
-LINUX_DIR_PATH = ${PWD}/tmp/linux-raspberrypi-kernel_${RPI_FIRMWARE_VER}
-endif
-
-
-clean:
- cat debian/control.in debian/control.in$(CONTROL_INC) >debian/control
- dh clean --with dkms
-
-%:
- dh $@
-
-
-override_dh_installmodules:
- DH_AUTOSCRIPTDIR=debian/autoscripts dh_installmodules
-
-override_dh_prep:
- @dh_prep --exclude=$(BINARY_PKG_NAME).substvars
- @echo PKG-KERNEL-VER=${RPI_FIRMWARE_VER} >> debian/$(BINARY_PKG_NAME).substvars
- ( sed 's/)/.${RPI_FIRMWARE_VER})/;q' debian/changelog; \
- printf "\n * Compiled for raspberrypi-kernel\n";\
- printf "\n -- auto-generator <info@unipi.technology> %s\n\n" "`date -R`"; \
- cat debian/changelog;\
- ) >debian/$(BINARY_PKG_NAME).changelog
-
-ifneq ($(shell dpkg-architecture -q DEB_BUILD_ARCH),armhf)
-override_dh_auto_configure:
- misc/check-raspbian
- misc/current
-endif
-
-override_dh_auto_build:
- for LDP in $(LINUX_DIR_PATH); do \
- make clean || exit 1;\
- dh_auto_build -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- dh_auto_install --destdir=debian/tempdest -- CCPREFIX=${DEB_TARGET_GNU_TYPE}- \
- LINUX_DIR_PATH=$${LDP} ARCH=${DEB_TARGET_ARCH_CPU} || exit 1;\
- done
-
-override_dh_auto_install:
- mkdir -p debian/$(BINARY_PKG_NAME)
- mv debian/tempdest/* debian/$(BINARY_PKG_NAME) || exit 1;