Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 414359 - net-analyzer/ssldump Prefix support
Summary: net-analyzer/ssldump Prefix support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: EBUILD, Inclusion, PATCH
Depends on: 414335
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2012-05-02 11:26 UTC by Benda Xu
Modified: 2013-01-23 09:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ssldump-tree.patch (ssldump.patch,2.17 KB, patch)
2012-05-04 08:44 UTC, Benda Xu
Details | Diff
ssldump.patch (ssldump.patch,1.44 KB, patch)
2012-06-07 00:57 UTC, Benda Xu
Details | Diff
ssldump-makefile-fix.patch (ssldump-0.9-makefile-fix.patch,625 bytes, patch)
2012-06-07 01:00 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2012-05-02 11:26:09 UTC
Please review the attached patch for Prefix support of ssldump.

Lines that spelling openssl and pcap explicitly are added, which looks not cool. I couldn't find a better way, though :(

Should I bump to 0.9-r2 when applying the patch?

Reproducible: Always
Comment 1 Fabian Groffen gentoo-dev 2012-05-03 17:09:15 UTC
Benda, you forgot the patch :/

This is the relevant difference:

@@ -37,7 +37,9 @@
        local myconf
        use ssl || myconf="--without-openssl"
 
-       econf ${myconf}
+       econf ${myconf} \
+               --with-pcap-inc="${EPREFIX}"/usr/include \
+               --with-pcap-lib="${EPREFIX}"/usr/$(get_libdir)
 }
 
 src_install() {
Comment 2 Benda Xu gentoo-dev 2012-05-04 08:44:56 UTC
Created attachment 310765 [details, diff]
ssldump-tree.patch

Here is the patch, which I forgot to attach.
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 14:13:33 UTC
Comment on attachment 310765 [details, diff]
ssldump-tree.patch

Review: needs EAPI bump to >=3
Comment 4 Benda Xu gentoo-dev 2012-06-07 00:57:52 UTC
Created attachment 314489 [details, diff]
ssldump.patch

use EAPI=4, thanks darkside.
Comment 5 Benda Xu gentoo-dev 2012-06-07 01:00:03 UTC
Created attachment 314491 [details, diff]
ssldump-makefile-fix.patch

Do not use ${ROOT} variable, which get overriden by portage ROOT envvar inside Makefile.
Comment 6 Benda Xu gentoo-dev 2012-06-07 01:02:25 UTC
@netmon, please review my patches. if there are no objections I will commit the changes in a week. Thanks.
Comment 7 Christoph Junghans (RETIRED) gentoo-dev 2012-10-18 10:11:31 UTC
I think this patch should be committed.
Comment 8 Sergey Popov gentoo-dev 2012-10-18 17:57:30 UTC
(In reply to comment #7)
> I think this patch should be committed.

It helps ssldump to build and install, but not to run :-(

prefix@phantom ~ $ which ssldump
/home/prefix/gentoo/usr/sbin/ssldump

prefix@phantom ~ $ ldd `which ssldump`
        linux-vdso.so.1 =>  (0x00007fffd35db000)
        libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007f17b1cb1000)
        libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007f17b1900000)
        libpcap.so.1 => not found
        libm.so.6 => /lib64/libm.so.6 (0x00007f17b167d000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f17b12ed000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f17b10e9000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f17b0ed3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f17b1f0e000)

Pcap is not found and libssl must be taken from prefix(as i see in ldd's output of other prefix-installed binaries)
Comment 9 Christoph Junghans (RETIRED) gentoo-dev 2012-10-18 20:25:08 UTC
(In reply to comment #8)
> Pcap is not found and libssl must be taken from prefix(as i see in ldd's
> output of other prefix-installed binaries)
Strange isn't libpcap pulled in?
Comment 10 Sergey Popov gentoo-dev 2012-10-19 08:30:27 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Pcap is not found and libssl must be taken from prefix(as i see in ldd's
> > output of other prefix-installed binaries)
> Strange isn't libpcap pulled in?

Yep, it's installed in prefix and not installed in root(so everything should be ok, but it is not):

prefix@phantom ~ $ equery f libpcap | head -4
/home/prefix/gentoo/usr
/home/prefix/gentoo/usr/bin
/home/prefix/gentoo/usr/bin/pcap-config
/home/prefix/gentoo/usr/include

prefix@phantom ~ $ ls /home/prefix/gentoo/usr/bin/pcap-config 
/home/prefix/gentoo/usr/bin/pcap-config

prefix@phantom ~ $ ls /usr/bin/pcap-config 
ls: cannot access /usr/bin/pcap-config: No such file or directory
Comment 11 Benda Xu gentoo-dev 2012-10-19 12:18:39 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > I think this patch should be committed.
> 
> It helps ssldump to build and install, but not to run :-(
> 
> prefix@phantom ~ $ which ssldump
> /home/prefix/gentoo/usr/sbin/ssldump
> 
> prefix@phantom ~ $ ldd `which ssldump`
>         linux-vdso.so.1 =>  (0x00007fffd35db000)
>         libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007f17b1cb1000)
>         libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
> (0x00007f17b1900000)
>         libpcap.so.1 => not found
>         libm.so.6 => /lib64/libm.so.6 (0x00007f17b167d000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007f17b12ed000)
>         libdl.so.2 => /lib64/libdl.so.2 (0x00007f17b10e9000)
>         libz.so.1 => /lib64/libz.so.1 (0x00007f17b0ed3000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007f17b1f0e000)
> 
> Pcap is not found and libssl must be taken from prefix(as i see in ldd's
> output of other prefix-installed binaries)

OOps, mine is different, on ~arm-linux

# ldd `which ssldump`
        libssl.so.1.0.0 => /gentoo/usr/lib/libssl.so.1.0.0 (0x40001000)
        libcrypto.so.1.0.0 => /gentoo/usr/lib/libcrypto.so.1.0.0 (0x4005c000)
        libpcap.so.1 => /gentoo/usr/lib/libpcap.so.1 (0x401be000)
        libm.so.6 => /lib/libm.so.6 (0x40200000)
        libc.so.6 => /lib/libc.so.6 (0x402a8000)
        libdl.so.2 => /lib/libdl.so.2 (0x403d9000)
        libz.so.1 => /gentoo/lib/libz.so.1 (0x403e5000)
        libgcc_s.so.1 => /gentoo/lib/libgcc_s.so.1 (0x40402000)
        /lib/ld-linux.so.3 (0x2a000000)
Comment 12 Sergey Popov gentoo-dev 2012-10-20 12:19:51 UTC
Meanwhile, ldd on tcpdump shows me:

prefix@phantom ~ $ ldd `which tcpdump`       
        linux-vdso.so.1 =>  (0x00007fffe61ff000)
        libcrypto.so.1.0.0 => /home/prefix/gentoo/usr/lib/libcrypto.so.1.0.0 (0x00007fcea1aa4000)
        libpcap.so.1 => /home/prefix/gentoo/usr/lib/libpcap.so.1 (0x00007fcea1866000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fcea14cf000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fcea12cb000)
        libz.so.1 => /home/prefix/gentoo/lib/libz.so.1 (0x00007fcea10b5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fcea1e79000)

So, it's not libpcap problem, it's ssldump one, IMO
Comment 13 Christoph Junghans (RETIRED) gentoo-dev 2013-01-17 22:43:21 UTC
(In reply to comment #12)
> Meanwhile, ldd on tcpdump shows me:
> 
> prefix@phantom ~ $ ldd `which tcpdump`       
>         linux-vdso.so.1 =>  (0x00007fffe61ff000)
>         libcrypto.so.1.0.0 => /home/prefix/gentoo/usr/lib/libcrypto.so.1.0.0
> (0x00007fcea1aa4000)
>         libpcap.so.1 => /home/prefix/gentoo/usr/lib/libpcap.so.1
> (0x00007fcea1866000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007fcea14cf000)
>         libdl.so.2 => /lib64/libdl.so.2 (0x00007fcea12cb000)
>         libz.so.1 => /home/prefix/gentoo/lib/libz.so.1 (0x00007fcea10b5000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007fcea1e79000)
> 
> So, it's not libpcap problem, it's ssldump one, IMO
Good, so maybe we can finally merge that patch.

@netmon: ping.
Comment 14 Sergey Popov gentoo-dev 2013-01-18 04:27:13 UTC
(In reply to comment #13)
> > So, it's not libpcap problem, it's ssldump one, IMO
> Good, so maybe we can finally merge that patch.
> 
> @netmon: ping.

I am sorry, but did you read previous discussion? My example shows that tcpdump link correctly on libpcap, but ssldump are NOT. I have just retried with clean amd64-linux prefix and i have got the same error. So, maybe we should refine this patch someway before the inclusion?
Comment 15 Christoph Junghans (RETIRED) gentoo-dev 2013-01-18 21:07:46 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > > So, it's not libpcap problem, it's ssldump one, IMO
> > Good, so maybe we can finally merge that patch.
> > 
> > @netmon: ping.
> 
> I am sorry, but did you read previous discussion? My example shows that
> tcpdump link correctly on libpcap, but ssldump are NOT. I have just retried
> with clean amd64-linux prefix and i have got the same error. So, maybe we
> should refine this patch someway before the inclusion?

(In reply to comment #14)
> (In reply to comment #13)
> > > So, it's not libpcap problem, it's ssldump one, IMO
> > Good, so maybe we can finally merge that patch.
> > 
> > @netmon: ping.
> 
> I am sorry, but did you read previous discussion? My example shows that
> tcpdump link correctly on libpcap, but ssldump are NOT. I have just retried
> with clean amd64-linux prefix and i have got the same error. So, maybe we
> should refine this patch someway before the inclusion?
Sorry, I confused tcpdump with ssldump.

I had a quick look at the build-system and ${EPREFIX}/usr/lib does not get added to the rpath. Adding -Wl,-rpath ${EPREFIX}/usr/$(get_libdir) to LDFLAGS solves the issue for me.

@grobian: what would be the appropriate way to fix the issue, so that is works of darwin as well?
Comment 16 Fabian Groffen gentoo-dev 2013-01-19 08:21:25 UTC
Is the package using libtool?  If so, libtool will handle the -rpath.  If not, you'll have to conditionalise it, because Darwin doesn't need (and grok) it.
Comment 17 Christoph Junghans (RETIRED) gentoo-dev 2013-01-21 21:04:12 UTC
(In reply to comment #16)
> Is the package using libtool?  If so, libtool will handle the -rpath.  If
> not, you'll have to conditionalise it, because Darwin doesn't need (and
> grok) it.
No libtool.

Index: ssldump-0.9-r1.ebuild
===================================================================
--- ssldump-0.9-r1.ebuild	(revision 61531)
+++ ssldump-0.9-r1.ebuild	(working copy)
@@ -34,10 +34,12 @@
 }
 
 src_configure() {
-	local myconf
+	local myconf xLDFLAGS
 	use ssl || myconf="--without-openssl"
+	[[ ${CHOST} == *-darwin* ]] || xLDFLAGS="-Wl,-rpath ${EPREFIX}/usr/$(get_libdir)"
 
-	econf ${myconf} \
+	LDFLAGS="${LDFLAGS} ${xLDFLAGS}" \
+		econf ${myconf} \
 		--with-pcap-inc="${EPREFIX}"/usr/include \
 		--with-pcap-lib="${EPREFIX}"/usr/$(get_libdir)
 }
Comment 18 Sergey Popov gentoo-dev 2013-01-22 04:09:23 UTC
(In reply to comment #17)
> Index: ssldump-0.9-r1.ebuild
> ===================================================================
> --- ssldump-0.9-r1.ebuild	(revision 61531)
> +++ ssldump-0.9-r1.ebuild	(working copy)
> @@ -34,10 +34,12 @@
>  }
>  
>  src_configure() {
> -	local myconf
> +	local myconf xLDFLAGS
>  	use ssl || myconf="--without-openssl"
> +	[[ ${CHOST} == *-darwin* ]] || xLDFLAGS="-Wl,-rpath
> ${EPREFIX}/usr/$(get_libdir)"
>  
> -	econf ${myconf} \
> +	LDFLAGS="${LDFLAGS} ${xLDFLAGS}" \
> +		econf ${myconf} \
>  		--with-pcap-inc="${EPREFIX}"/usr/include \
>  		--with-pcap-lib="${EPREFIX}"/usr/$(get_libdir)
>  }

Does append-ldflags from flag-o-matic not work in this case?
Comment 19 Christoph Junghans (RETIRED) gentoo-dev 2013-01-22 18:58:40 UTC
(In reply to comment #18)
> Does append-ldflags from flag-o-matic not work in this case?
It would, I guess it would look nicer ;-)
Comment 20 Christoph Junghans (RETIRED) gentoo-dev 2013-01-23 03:53:11 UTC
Actually heroxbd's makefile patch has exactly the same effect adding an rpath to ldflags. 

@pinkbyte: Did you test that patch on your configuration? (It is not included in the prefix overlay by default).
Comment 21 Sergey Popov gentoo-dev 2013-01-23 09:32:02 UTC
hm, this is strange, last time when i check this - it does not work in my configuration properly(comment #8). But now i have:

prefix@phantom ~ $ which ssldump
/home/prefix/gentoo/usr/sbin/ssldump

prefix@phantom ~ $ ldd `which ssldump`
        linux-vdso.so.1 =>  (0x00007fff0bdff000)
        libssl.so.1.0.0 => /home/prefix/gentoo/usr/lib/libssl.so.1.0.0 (0x00007f33afa9a000)
        libcrypto.so.1.0.0 => /home/prefix/gentoo/usr/lib/libcrypto.so.1.0.0 (0x00007f33af6c5000)
        libpcap.so.1 => /home/prefix/gentoo/usr/lib/libpcap.so.1 (0x00007f33af487000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f33af204000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f33aee75000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f33aec71000)
        libz.so.1 => /home/prefix/gentoo/lib/libz.so.1 (0x00007f33aea5b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f33afd04000)

So it seems that i do something wrong when i test this last time, sorry for that.

+  23 Jan 2013; Sergey Popov <pinkbyte@gentoo.org> +ssldump-0.9-r2.ebuild,
+  +files/ssldump-0.9-prefix-fix.patch:
+  Revision bump: EAPI 5, utilize autotools-utils eclass, add support for
+  installation in Prefix, wrt bug #414359, patch by Benda Xu