Merge ~sergiodj/ubuntu/+source/libpcap:bug1865501-pkg-config into ubuntu/+source/libpcap:ubuntu/bionic-devel

Proposed by Sergio Durigan Junior
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)
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://salsa.debian.org/rfrancoise/libpcap/-/commit/580102f990009a7cb74cf94a5538b41c90ee0f3e
https://salsa.debian.org/rfrancoise/libpcap/-/commit/a0f1ea6e96c692ce69fab0fb2ee3a1fcbab3d258

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://launchpad.net/~sergiodj/+archive/ubuntu/libpcap-bug1865501

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://github.com/nhorman/dropwatch
# cd dropwatch
# ./autogen.sh && ./configure && make

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

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.
=> /usr/bin/pcap-config
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.

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Tuesday, June 30 2020, Christian Ehrhardt  wrote:

> 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 :-/

Thanks for the review, Christian!

Indeed, I was also negatively surprised when I noticed that I'd need to
backport more than the trivial libpcap.pc.in change in order to make
this work.

> In the review I learned that libpcap had another - non standard - way to provide this data already.
> => /usr/bin/pcap-config
> 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

Ah, that's correct, thanks for pointing it out! As you can see, part of
the changes I backported even patched the pcap-config script.

> +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.

Yep, fingers crossed.

As you said, pcap-config is non-standard, and, as far I have seen, not
really well documented, which explains why this bug was filed. Let's
hope the SRU team considers this justification sufficient :-).

Thanks again!

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Yeah so it is a valid change but maybe a bit too much for SRU - let's see what the SRU Team thinks.
Sponsored

To ssh://git.launchpad.net/ubuntu/+source/libpcap
 * [new tag] upload/1.8.1-6ubuntu1.18.04.2 -> upload/1.8.1-6ubuntu1.18.04.2

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2.dsc: done.
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2.debian.tar.xz: done.
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2_source.buildinfo: done.
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

@Sergio - Do you know what happened here?

It is not in Bionic unapproved
https://launchpad.net/ubuntu/bionic/+queue?queue_state=1&queue_text=

Nor is it in proposed/released:
 libpcap | 1.8.1-6ubuntu1 | bionic | source
 libpcap | 1.8.1-6ubuntu1.18.04.1 | bionic-security | source
 libpcap | 1.8.1-6ubuntu1.18.04.1 | bionic-updates | source

Nor is there a denial by the SRU team on the bug.

I have copied my uploads log here which looked good 25 days ago - I'm puzzled.

Re-trying:
 ! [rejected] upload/1.8.1-6ubuntu1.18.04.2 -> upload/1.8.1-6ubuntu1.18.04.2 (already exists)
(as expected)

Again uploaded:
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2.dsc: done.
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2.debian.tar.xz: done.
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2_source.buildinfo: done.
  Uploading libpcap_1.8.1-6ubuntu1.18.04.2_source.changes: done.
Successfully uploaded packages.

Need to check the feedback mail to that upload later ...

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I see it in bionic-unapproved now, if you happen to know what this was please enlight me ...

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Tuesday, July 28 2020, Christian Ehrhardt  wrote:

> I see it in bionic-unapproved now, if you happen to know what this was please enlight me ...

Thanks for looking into this, Christian. I have no idea what happened;
I assumed the upload was waiting to be reviewed by the SRU team (it was
one of the uploads I mentioned yesterday during the call). I apologize
for not checking bionic-unapproved; I guess I didn't know about it.

Anyway, thanks for making sure this is in the right state to be reviewed
by the SRU team.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 6d2d86d..87bdeac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
1libpcap (1.8.1-6ubuntu1.18.04.2) bionic; urgency=medium
2
3 * Install pkg-config file for libpcap (LP: #1865501).
4 - d/p/set-package-name-with-ac-init.patch: Set the PACKAGE_NAME
5 variable using autoconf's AC_INIT macro, so that we can use it
6 in the libpcap.pc.in file.
7 - d/p/use-m4-macro-to-get-version.patch: Use an M4 macro to
8 execute a "cat" command and obtain the version from the VERSION
9 file.
10 - d/p/install-pkg-config-file.patch: New patch from upstream,
11 which creates a libpcap.pc.in file and adjusts the Makefile to
12 install it.
13 - d/libpcap0.8-dev.install: Install libpcap.pc pkg-config file.
14 Thanks to Luca Boccassi for the Debian patch (Closes #922219).
15
16 -- Sergio Durigan Junior <sergio.durigan@canonical.com> Mon, 29 Jun 2020 17:49:04 -0400
17
1libpcap (1.8.1-6ubuntu1.18.04.1) bionic-security; urgency=medium18libpcap (1.8.1-6ubuntu1.18.04.1) bionic-security; urgency=medium
219
3 * SECURITY UPDATE: pcapng reading buffer over-read.20 * SECURITY UPDATE: pcapng reading buffer over-read.
diff --git a/debian/libpcap0.8-dev.install b/debian/libpcap0.8-dev.install
index 09f7c61..d4bd144 100644
--- a/debian/libpcap0.8-dev.install
+++ b/debian/libpcap0.8-dev.install
@@ -2,4 +2,5 @@ usr/bin
2usr/include/pcap*2usr/include/pcap*
3usr/lib/*/libpcap.a3usr/lib/*/libpcap.a
4usr/lib/*/libpcap.so4usr/lib/*/libpcap.so
5usr/lib/*/pkgconfig/libpcap.pc
5usr/share/man6usr/share/man
diff --git a/debian/patches/install-pkg-config-file.patch b/debian/patches/install-pkg-config-file.patch
6new file mode 1006447new file mode 100644
index 0000000..b774ba6
--- /dev/null
+++ b/debian/patches/install-pkg-config-file.patch
@@ -0,0 +1,137 @@
1From: Guy Harris <guy@alum.mit.edu>
2Date: Wed, 25 Apr 2018 17:22:45 -0700
3Subject: Add a pkg-config .pc file for libpcap.
4
5Addresses GitHub issue #374.
6
7Author: Guy Harris <guy@alum.mit.edu>
8Origin: backport, https://github.com/the-tcpdump-group/libpcap/commit/a7deb6a241f8c71ca261adc45ac07c8427074792
9Bug: https://github.com/the-tcpdump-group/libpcap/issues/374
10Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libpcap/+bug/1865501
11Reviewed-By: Sergio Durigan Junior <sergio.durigan@canonical.com>
12Last-Update: 2020-06-29
13---
14 Makefile.in | 28 +++++++++++++++++++++-------
15 libpcap.pc.in | 18 ++++++++++++++++++
16 2 files changed, 39 insertions(+), 7 deletions(-)
17 create mode 100644 libpcap.pc.in
18
19diff --git a/Makefile.in b/Makefile.in
20index d8562f1..44b9274 100644
21--- a/Makefile.in
22+++ b/Makefile.in
23@@ -171,7 +171,7 @@ TAGFILES = \
24
25 CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
26 $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
27- lex.yy.c pcap-config $(OBJ_PIC)
28+ lex.yy.c pcap-config libpcap.pc $(OBJ_PIC)
29
30 MAN1 = pcap-config.1
31
32@@ -300,6 +300,7 @@ EXTRA_DIST = \
33 lbl/os-solaris2.h \
34 lbl/os-sunos4.h \
35 lbl/os-ultrix4.h \
36+ libpcap.pc.in \
37 missing/getopt.c \
38 missing/getopt.h \
39 missing/snprintf.c \
40@@ -372,7 +373,7 @@ EXTRA_DIST = \
41 Win32/Prj/wpcap.vcxproj \
42 Win32/Prj/wpcap.vcxproj.filters
43
44-all: libpcap.a shared pcap-config
45+all: libpcap.a shared libpcap.pc pcap-config
46
47 libpcap.a: $(OBJ)
48 @rm -f $@
49@@ -536,7 +537,7 @@ bpf_filter_pic.o: bpf_filter.c
50 $(CC) -fPIC $(FULL_CFLAGS) -c bpf_filter.c -o $@
51
52 #
53-# Generate the pcap-config script.
54+# Generate the libpcap.pc file.
55 #
56 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
57 # for example, the Solaris 9 make man page says
58@@ -547,7 +548,16 @@ bpf_filter_pic.o: bpf_filter.c
59 #
60 # and this is an explicit target entry.
61 #
62-# Therefore, instead of using $<, we explicitly put in $(srcdir)/pcap-config.in.
63+# Therefore, instead of using $<, we explicitly put in $(srcdir)/libpcap.pc.in.
64+#
65+libpcap.pc: $(srcdir)/libpcap.pc.in ./config.status
66+ @rm -f $@ $@.tmp
67+ ./config.status --file=$@.tmp:$(srcdir)/libpcap.pc.in
68+ mv $@.tmp $@
69+ chmod a+x $@
70+
71+#
72+# Generate the pcap-config script. See above.
73 #
74 pcap-config: $(srcdir)/pcap-config.in ./config.status
75 @rm -f $@ $@.tmp
76@@ -584,7 +594,7 @@ selpolltest: tests/selpolltest.c libpcap.a
77 valgrindtest: tests/valgrindtest.c libpcap.a
78 $(CC) $(FULL_CFLAGS) -I. -L. -o valgrindtest $(srcdir)/tests/valgrindtest.c libpcap.a $(LIBS)
79
80-install: install-shared install-archive pcap-config
81+install: install-shared install-archive libpcap.pc pcap-config
82 [ -d $(DESTDIR)$(libdir) ] || \
83 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
84 [ -d $(DESTDIR)$(includedir) ] || \
85@@ -605,6 +615,9 @@ install: install-shared install-archive pcap-config
86 [ -d $(DESTDIR)$(bindir) ] || \
87 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
88 $(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
89+ [ -d $(DESTDIR)$(libdir)/pkgconfig ] || \
90+ (mkdir -p $(DESTDIR)$(libdir)/pkgconfig; chmod 755 $(DESTDIR)$(libdir)/pkgconfig)
91+ $(INSTALL_DATA) libpcap.pc $(DESTDIR)$(libdir)/pkgconfig/libpcap.pc
92 for i in $(MAN1); do \
93 $(INSTALL_DATA) $(srcdir)/$$i \
94 $(DESTDIR)$(mandir)/man1/$$i; done
95@@ -708,6 +721,7 @@ uninstall: uninstall-shared
96 for i in $(PUBHDR); do \
97 rm -f $(DESTDIR)$(includedir)/$$i; done
98 -rmdir $(DESTDIR)$(includedir)/pcap
99+ rm -f $(DESTDIR)/$(libdir)/pkgconfig/libpcap.pc
100 rm -f $(DESTDIR)/$(bindir)/pcap-config
101 for i in $(MAN1); do \
102 rm -f $(DESTDIR)$(mandir)/man1/$$i; done
103@@ -760,8 +774,8 @@ clean:
104
105 distclean: clean
106 rm -f Makefile config.cache config.log config.status \
107- config.h gnuc.h net os-proto.h bpf_filter.c pcap-config \
108- stamp-h stamp-h.in
109+ config.h gnuc.h net os-proto.h bpf_filter.c libpcap.pc \
110+ pcap-config stamp-h stamp-h.in
111 rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=)
112 rm -rf autom4te.cache
113
114diff --git a/libpcap.pc.in b/libpcap.pc.in
115new file mode 100644
116index 0000000..d74cbc5
117--- /dev/null
118+++ b/libpcap.pc.in
119@@ -0,0 +1,18 @@
120+#
121+# pkg-config file for libpcap.
122+#
123+# These variables come from the configure script, so includedir and
124+# libdir may be defined in terms of prefix and exec_prefix, so the
125+# latter must be defined as well.
126+#
127+prefix="@prefix@"
128+exec_prefix="@exec_prefix@"
129+includedir="@includedir@"
130+libdir="@libdir@"
131+
132+Name: libpcap
133+Description: Platform-independent network traffic capture library
134+Version: @PACKAGE_VERSION@
135+Libs: -L${libdir} -l@PACKAGE_NAME@
136+Libs.private: @LIBS@
137+Cflags: -I${includedir}
diff --git a/debian/patches/series b/debian/patches/series
index 6f38ebf..c09da53 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,6 @@ pcap-config.diff
110001-Revert-Add-file-capture-length-sanity-check-for-pcap.patch110001-Revert-Add-file-capture-length-sanity-check-for-pcap.patch
12CVE-2019-15165-1.patch12CVE-2019-15165-1.patch
13CVE-2019-15165-2.patch13CVE-2019-15165-2.patch
14set-package-name-with-ac-init.patch
15use-m4-macro-to-get-version.patch
16install-pkg-config-file.patch
diff --git a/debian/patches/set-package-name-with-ac-init.patch b/debian/patches/set-package-name-with-ac-init.patch
14new file mode 10064417new file mode 100644
index 0000000..f1578fc
--- /dev/null
+++ b/debian/patches/set-package-name-with-ac-init.patch
@@ -0,0 +1,160 @@
1From: Sergio Durigan Junior <sergio.durigan@canonical.com>
2Date: Mon, 29 Jun 2020 17:39:01 -0400
3Subject: Don't wire the library name into pcap-config.
4
5With autotools, set the package name with AC_INIT(), which now takes the
6package name and version as arguments, rather than the name of a file in
7the source directory. That sets PACKAGE_NAME.
8
9With CMake, set PACKAGE_NAME to ${LIBRARY_NAME}.
10
11In pcap-config.in, use "-l@PACKAGE_NAME@", rather than -lpcap, as the
12library name.
13
14That means that pcap-config will use -lwpcap, rather than -lpcap, on
15Windows, where the library's name is wpcap rather than just pcap.
16
17Author: Guy Harris <guy@alum.mit.edu>
18Origin: backport, https://github.com/the-tcpdump-group/libpcap/commit/c2e151358d7bc7c77dddb4ca00770034872cd081
19Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libpcap/+bug/1865501
20Reviewed-By: Sergio Durigan Junior <sergio.durigan@canonical.com>
21Last-Update: 2020-06-29
22---
23 configure | 31 ++++++++++++++++---------------
24 configure.ac | 3 ++-
25 pcap-config.in | 5 +++--
26 3 files changed, 21 insertions(+), 18 deletions(-)
27
28diff --git a/configure b/configure
29index 4c64875..fd14f5f 100755
30--- a/configure
31+++ b/configure
32@@ -1,6 +1,6 @@
33 #! /bin/sh
34 # Guess values for system-dependent variables and create Makefiles.
35-# Generated by GNU Autoconf 2.69.
36+# Generated by GNU Autoconf 2.69 for pcap 1.8.1.
37 #
38 #
39 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
40@@ -575,14 +575,13 @@ MFLAGS=
41 MAKEFLAGS=
42
43 # Identity of this package.
44-PACKAGE_NAME=
45-PACKAGE_TARNAME=
46-PACKAGE_VERSION=
47-PACKAGE_STRING=
48-PACKAGE_BUGREPORT=
49-PACKAGE_URL=
50-
51-ac_unique_file="pcap.c"
52+PACKAGE_NAME='pcap'
53+PACKAGE_TARNAME='pcap'
54+PACKAGE_VERSION='1.8.1'
55+PACKAGE_STRING='pcap 1.8.1'
56+PACKAGE_BUGREPORT=''
57+PACKAGE_URL=''
58+
59 # Factoring default headers for most tests.
60 ac_includes_default="\
61 #include <stdio.h>
62@@ -803,7 +802,7 @@ sharedstatedir='${prefix}/com'
63 localstatedir='${prefix}/var'
64 includedir='${prefix}/include'
65 oldincludedir='/usr/include'
66-docdir='${datarootdir}/doc/${PACKAGE}'
67+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
68 infodir='${datarootdir}/info'
69 htmldir='${docdir}'
70 dvidir='${docdir}'
71@@ -1303,7 +1302,7 @@ if test "$ac_init_help" = "long"; then
72 # Omit some internal or obsolete options to make the list less imposing.
73 # This message is too long to be a string in the A/UX 3.1 sh.
74 cat <<_ACEOF
75-\`configure' configures this package to adapt to many kinds of systems.
76+\`configure' configures pcap 1.8.1 to adapt to many kinds of systems.
77
78 Usage: $0 [OPTION]... [VAR=VALUE]...
79
80@@ -1351,7 +1350,7 @@ Fine tuning of the installation directories:
81 --infodir=DIR info documentation [DATAROOTDIR/info]
82 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
83 --mandir=DIR man documentation [DATAROOTDIR/man]
84- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
85+ --docdir=DIR documentation root [DATAROOTDIR/doc/pcap]
86 --htmldir=DIR html documentation [DOCDIR]
87 --dvidir=DIR dvi documentation [DOCDIR]
88 --pdfdir=DIR pdf documentation [DOCDIR]
89@@ -1368,7 +1367,9 @@ _ACEOF
90 fi
91
92 if test -n "$ac_init_help"; then
93-
94+ case $ac_init_help in
95+ short | recursive ) echo "Configuration of pcap 1.8.1:";;
96+ esac
97 cat <<\_ACEOF
98
99 Optional Features:
100@@ -1500,7 +1501,7 @@ fi
101 test -n "$ac_init_help" && exit $ac_status
102 if $ac_init_version; then
103 cat <<\_ACEOF
104-configure
105+pcap configure 1.8.1
106 generated by GNU Autoconf 2.69
107
108 Copyright (C) 2012 Free Software Foundation, Inc.
109@@ -1965,7 +1966,7 @@ cat >config.log <<_ACEOF
110 This file contains any messages produced by compilers while
111 running configure, to aid debugging if configure makes a mistake.
112
113-It was created by $as_me, which was
114+It was created by pcap $as_me 1.8.1, which was
115 generated by GNU Autoconf 2.69. Invocation command line was
116
117 $ $0 $@
118diff --git a/configure.ac b/configure.ac
119index 46bbd67..9952e04 100644
120--- a/configure.ac
121+++ b/configure.ac
122@@ -15,7 +15,8 @@ dnl
123 #
124
125 AC_PREREQ(2.61)
126-AC_INIT(pcap.c)
127+AC_INIT(pcap, 1.8.1)
128+AC_SUBST(PACKAGE_NAME)
129
130 AC_CANONICAL_SYSTEM
131
132diff --git a/pcap-config.in b/pcap-config.in
133index 16522dd..945c52d 100644
134--- a/pcap-config.in
135+++ b/pcap-config.in
136@@ -8,6 +8,7 @@ prefix="@prefix@"
137 exec_prefix="@exec_prefix@"
138 includedir="@includedir@"
139 LIBS="@LIBS@"
140+PACKAGE_NAME="@PACKAGE_NAME@"
141
142 static=0
143 show_cflags=0
144@@ -63,7 +64,7 @@ else
145 #
146 if [ "$show_cflags" = 1 -a "$show_libs" = 1 ]
147 then
148- echo "-I$includedir -lpcap"
149+ echo "-I$includedir -l$PACKAGE_NAME"
150 elif [ "$show_cflags" = 1 -a "$show_additional_libs" = 1 ]
151 then
152 echo "-I$includedir"
153@@ -72,6 +73,6 @@ else
154 echo "-I$includedir"
155 elif [ "$show_libs" = 1 ]
156 then
157- echo "-lpcap"
158+ echo "-l$PACKAGE_NAME"
159 fi
160 fi
diff --git a/debian/patches/use-m4-macro-to-get-version.patch b/debian/patches/use-m4-macro-to-get-version.patch
0new file mode 100644161new file mode 100644
index 0000000..8bb9b46
--- /dev/null
+++ b/debian/patches/use-m4-macro-to-get-version.patch
@@ -0,0 +1,27 @@
1From: Ali Abdulkadir <autostart.ini@gmail.com>
2Date: Wed, 4 Oct 2017 04:08:18 +0300
3Subject: Use a m4 macro to get version string from file
4
5Author: Ali Abdulkadir <autostart.ini@gmail.com>
6Origin: backport, https://github.com/the-tcpdump-group/libpcap/commit/263e6ca61e072cd8abe82b58e6b3f6539c2cdaaa
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libpcap/+bug/1865501
8Reviewed-By: Sergio Durigan Junior <sergio.durigan@canonical.com>
9Last-Update: 2020-06-29
10---
11 configure.ac | 3 ++-
12 1 file changed, 2 insertions(+), 1 deletion(-)
13
14diff --git a/configure.ac b/configure.ac
15index 9952e04..febdb69 100644
16--- a/configure.ac
17+++ b/configure.ac
18@@ -15,7 +15,8 @@ dnl
19 #
20
21 AC_PREREQ(2.61)
22-AC_INIT(pcap, 1.8.1)
23+
24+AC_INIT(pcap, m4_esyscmd_s([cat VERSION]))
25 AC_SUBST(PACKAGE_NAME)
26
27 AC_CANONICAL_SYSTEM

Subscribers

People subscribed via source and target branches