X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=debian%2Frules;h=3d2be928fc98859479cedde9c9b7d5d52b9a85da;hb=refs%2Fchanges%2F74%2F15974%2F1;hp=90b7db6a81f4c246bb22a1dff1e8a7c9e46f9a47;hpb=418fa12aa9b143ee6519c43c3c1262c697e3a015;p=deb_dpdk.git diff --git a/debian/rules b/debian/rules index 90b7db6a..3d2be928 100755 --- a/debian/rules +++ b/debian/rules @@ -2,7 +2,7 @@ # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* DPKG_EXPORT_BUILDFLAGS = 1 -export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie +export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/default.mk DPDK_ABI := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d '-' -f1 | cut -d '.' -f1-2 | cut -d '~' -f1) @@ -12,6 +12,15 @@ ifeq (,$(findstring terse,$(DEB_BUILD_OPTIONS))) export DH_OPTIONS=-v endif +# People rebuilding this package can overwrite RTE_MACHINE +# via DEB_BUILD_OPTIONS if they like +ifneq (,$(filter rte_machine=%,$(DEB_BUILD_OPTIONS))) + RTE_MACHINE ?= $(patsubst rte_machine=%,%,$(filter rte_machine=%,$(DEB_BUILD_OPTIONS))) +endif +# default to minimal base, without setting this it would build +# -march=native which is a non portable invariant +RTE_MACHINE ?= "default" + # now stable with parallel comilation, so support -j ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) PAR := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) @@ -72,39 +81,23 @@ endif override_dh_gencontrol: dh_gencontrol # debian/files will not exist until dh_gencontrol has ran at least once, - # so we need to run gencontrol for libdpdk-dev and libdpdk-dbgsym after. + # so we need to run gencontrol for libdpdk-dev after. # The list of libraries and PMDs is everchanging, so generate the dependency # list for libdpdk-dev to avoid having to maintain it manually. # Same for the recommends list for dpdk, were we want the PMDs and the mempools. dh_gencontrol -p libdpdk-dev -- -V"librte:Depends=`grep -E 'librte-*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`" - dh_gencontrol -p dpdk -- -V"librte:Recommends=`grep -E 'librte-(pmd|mempool).*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`" + dh_gencontrol -p dpdk -- -V"librte:Suggests=`grep -E 'librte-(pmd|mempool).*' ./debian/files | grep -v dbgsym | tr '_' ' ' | awk '{ print $$1,"(=",$$2 ")" }' | paste -sd ',' - | sed -e 's/,/, /g'`" ifneq (,$(findstring kernel_modules,$(DEB_BUILD_OPTIONS))) dh_gencontrol -p dpdk-modules-$(KVERS) -- \ -v`cat debian/VERSION` \ -V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))' endif -ifneq (,$(findstring dbgsym_meta,$(DEB_BUILD_OPTIONS))) - ./debian/dh-dbgsym-metapkg libdpdk$(DPDK_ABI)-dbgsym -endif - -# dbgsym_meta can be passed via DEB_BUILD_OPTIONS to enable building the -# optional dbgsym meta package libdpdk-dbgsym. -# This is not built by default as it would go in main but depend on -# packages in the debian-debug archive. -# Debian Developers and FTP masters strongly discourage this. -# We provide this optional flag as a convenience for rebuilders. -ifneq (,$(findstring dbgsym_meta,$(DEB_BUILD_OPTIONS))) -override_dh_builddeb: - dh_builddeb - dh_builddeb -plibdpdk$(DPDK_ABI)-dbgsym -endif override_dh_auto_clean: rm -rf debian/build debian/tmp debian/dpdk-modules-* \ debian/control.modules debian/VERSION sed -i '/Package: dpdk-modules-/,/`tail -n1 debian/control.modules.in`/d' debian/control rm -f debian/dpdk-igb-uio-dkms.dkms debian/dpdk-rte-kni-dkms.dkms - rm -f debian/dpdk-dev.preinst dh_auto_clean override_dh_auto_configure: @@ -112,7 +105,7 @@ override_dh_auto_configure: --includedir=include/dpdk \ -Dper_library_versions=false \ -Dinclude_subdir_arch=../$(DEB_HOST_MULTIARCH)/dpdk \ - -Dmachine=corei7 \ + -Dmachine=$(RTE_MACHINE) \ -Dkernel_dir=$(KSRC) \ -Denable_kmods=$(DPDK_CONFIG_BUILD_KMOD) @@ -129,8 +122,6 @@ override_dh_auto_install-indep: override_dh_auto_install-arch: dh_auto_install - # generate the preinst to deal with the symlink -> directory transition smoothly - sed "s/@@RTE_TARGET@@/$(RTE_TARGET)/g" debian/dpdk-dev.preinst.in > debian/dpdk-dev.preinst # have the DKMS build include the correct per-arch directory sed "s/@@DEB_HOST_MULTIARCH@@/$(DEB_HOST_MULTIARCH)/g" debian/dpdk-igb-uio-dkms.dkms.in > debian/dpdk-igb-uio-dkms.dkms sed "s/@@DEB_HOST_MULTIARCH@@/$(DEB_HOST_MULTIARCH)/g" debian/dpdk-rte-kni-dkms.dkms.in > debian/dpdk-rte-kni-dkms.dkms @@ -175,3 +166,5 @@ override_dh_python3: # /usr/share/dpdk, so pass /usr to catch all dh_python3 --shebang=/usr/bin/python3 /usr +override_dh_missing: + dh_missing --fail-missing