Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58824 - dchub-0.5.2. Bad ebuild (dependencies and installation).
Summary: dchub-0.5.2. Bad ebuild (dependencies and installation).
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor
Assignee: Gentoo net-p2p team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-29 13:35 UTC by Peter Volkov (RETIRED)
Modified: 2005-07-21 05:39 UTC (History)
2 users (show)

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


Attachments
dchub-0.5.2.ebuild (dchub-0.5.2.ebuild,1.39 KB, text/plain)
2005-07-21 05:38 UTC, Marcin Kryczek (RETIRED)
Details
dchub-crypt.patch (dchub-crypt.patch,2.09 KB, patch)
2005-07-21 05:39 UTC, Marcin Kryczek (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Volkov (RETIRED) gentoo-dev 2004-07-29 13:35:39 UTC
Well. First of all lets look at ldd dchub:
        libperl.so.1 => /usr/lib/libperl.so.1 (0x40017000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x4011c000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x4016d000)
        libdl.so.2 => /lib/libdl.so.2 (0x40181000)
        libm.so.6 => /lib/libm.so.6 (0x40184000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x401a6000)
        libutil.so.1 => /lib/libutil.so.1 (0x401d3000)
        libc.so.6 => /lib/libc.so.6 (0x401d7000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x402e4000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x402e9000)
        libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0x40366000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x40396000)
        libz.so.1 => /lib/libz.so.1 (0x404b0000)
        libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0x404c2000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
And at ebuild dependecies:
RDEPEND="virtual/libc
        =dev-libs/glib-1*
        dev-lang/perl
        dev-db/edb"
Evident that something missed. So I would like to introduce a bit defferent dependancies:
RDEPEND="virtual/glibc
        sys-apps/sed
        virtual/gzip
        =dev-libs/glib-2*
        dev-lang/perl
        dev-db/edb
        dev-libs/openssl
        dev-libs/libxml2"
I'm not sure in edb. But dchub uses gilb2! and openssl!

Then. The confugure;make;make install of dchub are very bad as they have some path's that are relative to the root(/). So I've done some workarond (using sed I edited necessary Makefiles). Here is my ebuild. May be someone can do this better. All package resides inside /opt/dchub dirrectory:

# Copyright 1999-2004 Gentoo Foundation

IUSE=""

HOMEPAGE="http://ac2i.homelinux.com/dctc/#dchub"
DESCRIPTION="dchub (Direct Connect Hub), a linux hub for the p2p 'direct connect'"
SRC_URI="http://ac2i.homelinux.com/dctc/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ~ppc"

RDEPEND="virtual/glibc
	sys-apps/sed
	virtual/gzip
	=dev-libs/glib-2*
	dev-lang/perl
	dev-db/edb
	dev-libs/openssl
	dev-libs/libxml2"

src_unpack(){
	unpack ${A}	

	sed -e "s/DCHUB_DBDIR=\"\/var\/db\/dchub\"/DCHUB_DBDIR=\"\/opt\/dchub\/var\/dchub\"/" ${S}/configure > ${S}/conf.temp && mv ${S}/conf.temp ${S}/configure && chmod +x ${S}/configure
	sed -e "s/DCHUB_TEMPLATEDIR=\"\${datadir}\/dchub\"/DCHUB_TEMPLATEDIR=\"\/opt\/dchub\/share\/dchub\"/" ${S}/configure > ${S}/conf.temp && mv ${S}/conf.temp ${S}/configure && chmod +x ${S}/configure
}

src_compile(){
	./configure \
	--prefix=${D}/opt/dchub \
	--host=${CHOST} \
	${EXTRA_ECONF} || die "configure failed"
	make || die "compiling failed"
}


src_install() {

	sed -e "s/DCHUB_TEMPLATEDIR = \/opt\/dchub\/share\/dchub/DCHUB_TEMPLATEDIR = \${D}\/opt\/dchub\/share\/dchub/" ${S}/src/Makefile > ${S}/temp && mv ${S}/temp ${S}/src/Makefile


	make install	

	dodoc Documentation/*
	dodoc AUTHORS COPYING ChangeLog NEWS README TODO

	dodir /opt/dchub/var
	dodir /opt/dchub/var/dchub


}
pkg_postinst() {
	einfo "If you want to initialise configuration file run:"
	einfo "\`ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config\`"
}

pkg_config(){
	if [ -f /opt/dchub/var/dchub/conf.xml ]; then
		einfo "Configuration file /opt/dchub/var/dchub/conf.xml exists."
		einfo "Please remove the previous configuration and issue this command again."
	else
		/opt/dchub/bin/dchub -i
	fi
}

In any way. Ebuild actually in portage should be edited somehow.

Reproducible: Always
Steps to Reproduce:
Comment 1 Jon Hood (RETIRED) gentoo-dev 2004-08-02 11:34:57 UTC
Why /opt/dchub?
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2004-08-03 00:07:34 UTC
Actually there is no reason to be in /opt/dchub, but
the lack of good documentation on this programm makes me think, that it is good idea to put it there, so to see all relative files together. So just to simpify first startup and following support of dchub.

Of course, there is an easy sollution, that is with the dchub-0.4.5.ebuild. Just add /etc/init.d/dchub file, where you explain hub where you have your configuration files (for example /etc/dchub). But then we should explain all users to use this script and where to look for configuration files... I'm not sure this is the best sollution.
IMHO we need to allow users just, following documentation, run ./dchub -i &&  nano /path/to/config/congig.xml && ./dchub to fire their new dchub.
This is possible through durty hack I've done in my ebuild (using grep, sed...).

And yes. I know that I need to put /opt/dchub/var/dchub or whatever to CONFIG_PROTECT dirrectories.
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2004-12-16 11:33:11 UTC
Long time ago, I posted this bug. Now I returned to dchub again, and again the same error (I haven't posted error message that time):

checking whether build environment is sane... yes
checking for strerror in -lcposix... no
checking for gawk... gawk
checking for gcc... gcc
checking whether the C compiler (gcc -O2 -march=pentium3 -fomit-frame-pointer -mcpu=pentium3 -pipe ) works... yes
checking whether the C compiler (gcc -O2 -march=pentium3 -fomit-frame-pointer -mcpu=pentium3 -pipe ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for a BSD compatible install... /bin/install -c
checking whether ln -s works... yes
checking for gcc option to accept ANSI C... none needed
checking for msgfmt... yes
checking for sys_siglist declaration in signal.h or unistd.h... yes
checking for dlopen in -ldl... yes
checking for pkg-config... no
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.
*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.
configure: error: Library requirements (glib-2.0 gthread-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

So. It impossible just emerge dchub and have fun...
Comment 4 Jon Hood (RETIRED) gentoo-dev 2004-12-16 12:06:21 UTC
dependencies are fixed, so you shouldn't run into that configure error anymore (I hope)
Comment 5 Mark Lee 2005-04-23 13:53:37 UTC
It seems that the dependencies were not updated fully, in particular dchub now wants glib-2* instead of glib-1*.
Comment 6 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-12 05:11:10 UTC
ldd on my system shows:
<root@CogES>/usr/portage/net-p2p/dchub: ldd /usr/bin/dchub
        /etc/libcwait.so (0xb7f21000)
        linux-gate.so.1 =>  (0xffffe000)
        libperl.so.1 => /usr/lib/libperl.so.1 (0xb7dee000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7ddb000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb7dc3000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7dbf000)
        libm.so.6 => /lib/libm.so.6 (0xb7d99000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7d6c000)
        libutil.so.1 => /lib/libutil.so.1 (0xb7d68000)
        libc.so.6 => /lib/libc.so.6 (0xb7c35000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7c30000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7ba3000)
        libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0xb7b52000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb79f9000)
        libz.so.1 => /lib/libz.so.1 (0xb79e6000)
        /lib/ld-linux.so.2 (0xb7f24000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb79e2000)

note it's not linked with ssl. i suggest the following dependencies:
RDEPEND="virtual/libc
    =dev-libs/glib-2*
    sys-devel/libperl
    dev-libs/libxml2
    dev-libs/libgcrypt
    sys-libs/zlib"

i've added libcrypt and zlib and removed edb, which is not needed in my opinion.
i've also changed dev-lang/perl into sys-devel/libperl, which should be enought, 
but certainly need testing
Comment 7 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-12 05:17:05 UTC
note also that project homepage has moved and now it's available here: http://
ac2i.homelinux.com/dctc/#dchub
Comment 8 Karol Wojtaszek (RETIRED) gentoo-dev 2005-07-13 07:24:38 UTC
Fixed in portage, thanks for info and help.
Comment 9 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-21 05:38:47 UTC
Created attachment 63975 [details]
dchub-0.5.2.ebuild

i was wondering why dchub is linked against openssl in Peter's system and
against libgcrypt in my. it has a bit broken (according to gentoo policy)
configure script, which autodetects installed libraries and links to whatever
suitable it founds.
this is new eduild, which fixes this problem
Comment 10 Marcin Kryczek (RETIRED) gentoo-dev 2005-07-21 05:39:43 UTC
Created attachment 63976 [details, diff]
dchub-crypt.patch

patch needed by new ebuild (should go to ${FILESDIR})