Merge ~sergiodj/ubuntu/+source/libpcap:bug1865501-pkg-config into ubuntu/+source/libpcap:ubuntu/bionic-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Christian Ehrhardt | ||||
Approved revision: | 3828dfedb504b17c1d3747004eeb031b08c4c927 | ||||
Merged at revision: | 3828dfedb504b17c1d3747004eeb031b08c4c927 | ||||
Proposed branch: | ~sergiodj/ubuntu/+source/libpcap:bug1865501-pkg-config | ||||
Merge into: | ubuntu/+source/libpcap:ubuntu/bionic-devel | ||||
Diff against target: |
388 lines (+345/-0) 6 files modified
debian/changelog (+17/-0) debian/libpcap0.8-dev.install (+1/-0) debian/patches/install-pkg-config-file.patch (+137/-0) debian/patches/series (+3/-0) debian/patches/set-package-name-with-ac-init.patch (+160/-0) debian/patches/use-m4-macro-to-get-version.patch (+27/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt (community) | Approve | ||
Canonical Server | Pending | ||
Review via email: mp+386535@code.launchpad.net |
Description of the change
Users of libpcap cannot make use of its pkg-config file in order to automate the building process of applications that use the library, because the file is not being installed on Ubuntu bionic.
To reproduce the problem, one can do:
$ lxc launch ubuntu-daily:bionic libpcap-bug1865501
$ lxc shell libpcap-bug1865501
# apt update
# apt install libpcap-dev pkg-config -y
# pkg-config libpcap --libs
You will see an error like this:
Package libpcap was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcap.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpcap' found
The fix for this problem seems simple at the beginning: just install the .pc file and be done with it. However, bionic's version of the package doesn't have the .pc file, so I needed to backport the upstream patch that created the file. Then, I noticed that some variables (like PACKAGE_NAME) were not being expanded in the libpcap.pc.in template, so I had to chase and backport the upstream patches that correctly set these variables in the configure.ac. All in all, I had to backport 3 relatively simple upstream patches.
Then, the actual fix came from the Debian package:
https:/
https:/
The first commit didn't need to be cherry-picked because it was already applied; only the second commit was necessary.
There is a PPA with the proposed fix here:
https:/
There are no dep8 tests. To test, I cloned and built the package mentioned by the reporter, which uses libpcap. You can do this inside the lxd container you set up above:
# git clone https:/
# cd dropwatch
# ./autogen.sh && ./configure && make
Thanks for identifying the configure/make changes needed to get this working Sergio.
The changelog looks well.
The build log has a few warnings, but not related to your change.
The PPA works as intended and shows no other impact.
I double checked the backported patches for potential side-effects but found none \o/.
Never the less the config changes make this way more noisy and intrusive than I'd have hoped :-/
In the review I learned that libpcap had another - non standard - way to provide this data already. pcap-config
=> /usr/bin/
This was retained going forward for compatibility:
Focal:
$ $ pcap-config --static --additional-libs --libs --cflags
-I/usr/include -lpcap
Bionic:
root@b:~# pcap-config --static --libs --cflags --additional-libs
-I/usr/include -lpcap
Bionic + PPA:
root@b:~# pcap-config --static --libs --cflags --additional-libs
-I/usr/include -lpcap
+1 for the review on this.
Let us see what the SRU Team thinks of "more intrusive than we hoped" + "there is a (non standard) alternative". Both arguments against the SRU, but no clear show stoppers.