Generate libdpdk-dev dependencies and dpdk recommends 04/7104/1
authorLuca Boccassi <luca.boccassi@gmail.com>
Mon, 12 Jun 2017 12:57:06 +0000 (13:57 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 12 Jun 2017 13:42:57 +0000 (14:42 +0100)
There are many, many binary packages in DPDK, and they constantly
change.
To avoid having to manually maintain the list of dependencies of
libdpdk-dev and recommends of dpdk, generate them at build time
depending on what is actually built for each architecture.

Change-Id: I19f5f037c41dc4b1d61fb5b2c00e0f005431d8f0
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
debian/control
debian/rules

index db3c12e..57f41d7 100644 (file)
@@ -35,26 +35,7 @@ Depends: hwdata,
          ${misc:Depends},
          ${python:Depends},
          ${shlibs:Depends}
-Recommends: librte-pmd-af-packet1 (= ${binary:Version}),
-            librte-pmd-bnxt1 (= ${binary:Version}),
-            librte-pmd-bond1 (= ${binary:Version}),
-            librte-pmd-cxgbe1 (= ${binary:Version}),
-            librte-pmd-e1000-1 (= ${binary:Version}),
-            librte-pmd-ena1 (= ${binary:Version}),
-            librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386],
-            librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386],
-            librte-pmd-i40e1 (= ${binary:Version}),
-            librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386],
-            librte-pmd-null-crypto1 (= ${binary:Version}),
-            librte-pmd-null1 (= ${binary:Version}),
-            librte-pmd-pcap1 (= ${binary:Version}),
-            librte-pmd-qede1 (= ${binary:Version}),
-            librte-pmd-ring2 (= ${binary:Version}),
-            librte-pmd-thunderx-nicvf1 (= ${binary:Version}),
-            librte-pmd-vhost1 (= ${binary:Version}),
-            librte-pmd-virtio1 (= ${binary:Version}),
-            librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386],
-            librte-pmd-xenvirt1 (= ${binary:Version}) [amd64 arm64 i386]
+Recommends: ${librte:Recommends},
 Suggests: dpdk-doc,
           dpdk-igb-uio-dkms (= ${binary:Version}),
           dpdk-rte-kni-dkms (= ${binary:Version}),
@@ -124,53 +105,7 @@ Architecture: amd64 arm64 i386 ppc64el
 Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
 Depends: libpcap-dev,
-         librte-acl2 (= ${binary:Version}),
-         librte-cfgfile2 (= ${binary:Version}),
-         librte-cmdline2 (= ${binary:Version}),
-         librte-cryptodev2 (= ${binary:Version}),
-         librte-distributor1 (= ${binary:Version}),
-         librte-eal3 (= ${binary:Version}),
-         librte-ethdev5 (= ${binary:Version}),
-         librte-hash2 (= ${binary:Version}),
-         librte-ip-frag1 (= ${binary:Version}),
-         librte-jobstats1 (= ${binary:Version}),
-         librte-kni2 (= ${binary:Version}) [amd64 arm64 ppc64el],
-         librte-kvargs1 (= ${binary:Version}),
-         librte-lpm2 (= ${binary:Version}),
-         librte-mbuf2 (= ${binary:Version}),
-         librte-mempool2 (= ${binary:Version}),
-         librte-meter1 (= ${binary:Version}),
-         librte-net1 (= ${binary:Version}),
-         librte-pdump1 (= ${binary:Version}),
-         librte-pipeline3 (= ${binary:Version}),
-         librte-pmd-af-packet1 (= ${binary:Version}),
-         librte-pmd-bnxt1 (= ${binary:Version}),
-         librte-pmd-bond1 (= ${binary:Version}),
-         librte-pmd-cxgbe1 (= ${binary:Version}),
-         librte-pmd-e1000-1 (= ${binary:Version}),
-         librte-pmd-ena1 (= ${binary:Version}),
-         librte-pmd-enic1 (= ${binary:Version}) [amd64 arm64 i386],
-         librte-pmd-fm10k1 (= ${binary:Version}) [amd64 i386],
-         librte-pmd-i40e1 (= ${binary:Version}),
-         librte-pmd-ixgbe1 (= ${binary:Version}) [amd64 arm64 i386],
-         librte-pmd-null-crypto1 (= ${binary:Version}),
-         librte-pmd-null1 (= ${binary:Version}),
-         librte-pmd-pcap1 (= ${binary:Version}),
-         librte-pmd-qede1 (= ${binary:Version}),
-         librte-pmd-ring2 (= ${binary:Version}),
-         librte-pmd-thunderx-nicvf1 (= ${binary:Version}),
-         librte-pmd-vhost1 (= ${binary:Version}),
-         librte-pmd-virtio1 (= ${binary:Version}),
-         librte-pmd-vmxnet3-uio1 (= ${binary:Version}) [amd64 arm64 i386],
-         librte-pmd-xenvirt1 (= ${binary:Version}) [amd64 arm64 i386],
-         librte-port3 (= ${binary:Version}),
-         librte-power1 (= ${binary:Version}),
-         librte-reorder1 (= ${binary:Version}),
-         librte-ring1 (= ${binary:Version}),
-         librte-sched1 (= ${binary:Version}),
-         librte-table2 (= ${binary:Version}),
-         librte-timer1 (= ${binary:Version}),
-         librte-vhost3 (= ${binary:Version}),
+         ${librte:Depends},
          ${misc:Depends}
 Description: Data Plane Development Kit (basic development files)
  DPDK is a set of libraries for fast packet processing. Applications run
index 33b98b5..82eb417 100755 (executable)
@@ -128,6 +128,13 @@ 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.
+       # 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'`"
 ifneq (,$(findstring kernel_modules,$(DEB_BUILD_OPTIONS)))
        dh_gencontrol -p dpdk-modules-$(KVERS) -- \
                -v`cat debian/VERSION` \