Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 366361 - Installing net-dns/bind on g/fbsd
Summary: Installing net-dns/bind on g/fbsd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: Normal normal (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords: KEYWORDREQ
Depends on: 377725
Blocks:
  Show dependency tree
 
Reported: 2011-05-07 17:34 UTC by Dmitri Bogomolov
Modified: 2011-12-06 12:53 UTC (History)
2 users (show)

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


Attachments
bind-9.8.0.ebuild (bind-9.8.0.ebuild,12.19 KB, text/plain)
2011-05-07 17:36 UTC, Dmitri Bogomolov
Details
difference from bind-9.8.0.ebuild in tree (bind-9.8.0.ebuild.diff,1.36 KB, patch)
2011-05-07 17:40 UTC, Dmitri Bogomolov
Details | Diff
diff for bind-9.8.0_p4 (bind-9.8.0_p4.ebuild.diff,1.37 KB, patch)
2011-08-01 09:12 UTC, Dmitri Bogomolov
Details | Diff
diff for bind-9.8.0_p4 (bind-9.8.0_p4.ebuild.diff,1.31 KB, patch)
2011-08-01 10:30 UTC, Dmitri Bogomolov
Details | Diff
build.log for USE="dlz berkdb" (build.log,545.24 KB, text/plain)
2011-08-01 20:11 UTC, Dmitri Bogomolov
Details
bind-9.8.1_p1.ebuild.patch (bind-9.8.1_p1.ebuild.patch,1.30 KB, text/plain)
2011-11-30 13:39 UTC, Naohiro Aota
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitri Bogomolov 2011-05-07 17:34:06 UTC
=net-dns/bind-9.4.3_p5 was last bind ebuild I installed on g/fbsd with ACCEPT_KEYWORDS="x86". Ebuilds for newer bind doesn't install because of DEPEND's on sys-libs/libcap and sys-process/psmisc.

Reproducible: Always
Comment 1 Dmitri Bogomolov 2011-05-07 17:36:59 UTC
Created attachment 272411 [details]
bind-9.8.0.ebuild

With this ebuild I installed =net-dns/bind-9.8.0 on g/fbsd-8.0 with USE="berkdb ipv6 ldap postgres resolvconf ssl threads urandom -dlz -doc -geoip% -gssapi% -idn -mysql -odbc -sdb-ldap% (-selinux) -xml%"
Comment 2 Dmitri Bogomolov 2011-05-07 17:40:30 UTC
Created attachment 272413 [details, diff]
difference from bind-9.8.0.ebuild in tree
Comment 3 Naohiro Aota gentoo-dev 2011-07-25 11:36:23 UTC
Could you find why the package need sys-process/psmisc? Maybe killall or something are used? If so we can change the dependency like ||( sys-process/psmisc sys-freebsd/freebsd-ubin ) and it's much better to use userland_BSD.
Comment 4 Dmitri Bogomolov 2011-07-25 18:13:33 UTC
(In reply to comment #3)
> Could you find why the package need sys-process/psmisc? Maybe killall or
> something are used? If so we can change the dependency like ||(
> sys-process/psmisc sys-freebsd/freebsd-ubin ) 

I think because of procfs usage on Linux and so no dependency needed.

> and it's much better to use userland_BSD.

Now I think better to use kernel_Linux, because procfs is Linux feature, not GNU userland.
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2011-07-26 21:35:56 UTC
psmisc is because of fuser when using chroot.
Comment 6 Dmitri Bogomolov 2011-07-27 06:46:52 UTC
(In reply to comment #5)
> psmisc is because of fuser when using chroot.

equery belongs /sbin/fuser
 * Searching for /sbin/fuser ... 
sys-process/fuser-bsd-1142334561 (/sbin/fuser)

But i can't understand is procfs really needed for that.
With CHROOT="/jail/dns" in /etc/conf.d/named `emerge --configure net-dns/bind` made an fstab record:

none    /jail/dns/proc    proc    defaults    0 0

which I commented out. `/etc/init.d/named restart` works on the second try, maybe because of this?
Comment 7 Naohiro Aota gentoo-dev 2011-07-27 11:39:14 UTC
> psmisc is because of fuser when using chroot.

Thanks. Then psmisc can be replaced with fuser-bsd. Still some patch
to init script are requireed, but it works with USE=-threads. I'll
check USE=threads case.

> But i can't understand is procfs really needed for that.
> With CHROOT="/jail/dns" in /etc/conf.d/named `emerge --configure net-dns/bind`
> made an fstab record:

Sorry, but I don't get what you wrote ... :S I think psmisc is nothing
to do with procfs.  I've check the code and cannot find a code to add
such entry. Even I tryed "emerge --configure bind", but I didn't get
such fstab entry.
Comment 8 Dmitri Bogomolov 2011-07-27 12:36:52 UTC
(In reply to comment #7)

> 
> Sorry, but I don't get what you wrote ... :S I think psmisc is nothing
> to do with procfs. 

# eix -c psmisc
[N] sys-process/psmisc (--): A set of tools that use the proc filesystem

or, maybe this ebuild has wrong DESCRIPTION?

> I've check the code and cannot find a code to add
> such entry. Even I tryed "emerge --configure bind", but I didn't get
> such fstab entry.

My bad, I did `emerge --config bind` and this fstab record appeared with older bind ebuilds:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.6.0_p1.ebuild?hideattic=0&view=markup (line 282)
Comment 9 Dmitri Bogomolov 2011-08-01 09:12:10 UTC
Created attachment 281707 [details, diff]
diff for bind-9.8.0_p4

I added sys-process/fuser-bsd to RDEPEND, and kernel_Linux for caps (don't know way better).
Comment 10 Naohiro Aota gentoo-dev 2011-08-01 09:32:15 UTC
Thank you for your patch. Both USE=threads and USE=-threads working with this patch? ... and you can use $(use_enable kernel_linux linux-caps) to replace if use kernel_linux ... fi statements.

Also it was my typo to use "kernel_Linux", actually it should be "kernel_linux" (it's confusing! we use "kernel_FreeBSD" and "kernel_Darwin" :S)
Comment 11 Dmitri Bogomolov 2011-08-01 10:30:14 UTC
Created attachment 281715 [details, diff]
diff for bind-9.8.0_p4

Changed USE="kernel_linux" and if use -> $(use_enable. It works on g/fbsd(-7.2) with USE="threads": named started and works. Now I started to emerge on linux.
Comment 12 Dmitri Bogomolov 2011-08-01 12:40:17 UTC
(In reply to comment #10)
> Thank you for your patch. Both USE=threads and USE=-threads working with this
> patch? 

Just tested on linux.
Comment 13 Dmitri Bogomolov 2011-08-01 20:01:12 UTC
(In reply to comment #10)
> Thank you for your patch. Both USE=threads and USE=-threads working with this
> patch?

Yes. Just tested on g/fbsd-8.2.
Comment 14 Dmitri Bogomolov 2011-08-01 20:11:56 UTC
Created attachment 281767 [details]
build.log for USE="dlz berkdb"

=net-dns/bind-9.8.0_p4 also fails to build with USE="dlz berkdb" :( as usual there is a problem with berkdb ).
Comment 15 Naohiro Aota gentoo-dev 2011-11-30 13:39:16 UTC
Created attachment 294303 [details]
bind-9.8.1_p1.ebuild.patch

Ebuild patch to include db.h from proper path and to add optional
dependency. Build and test passed both on Linux and FreeBSD
(USE="berkdb dlz ipv6 ssl (-caps) (-gssapi)")
 
bind team, 

Please take a look at the patch. I'd like to apply the patch if you
don't see problems.

Thanks,
Comment 16 Christian Ruppert (idl0r) gentoo-dev 2011-11-30 16:57:15 UTC
(In reply to comment #15)
> Created attachment 294303 [details]
> bind-9.8.1_p1.ebuild.patch
> 
> Ebuild patch to include db.h from proper path and to add optional
> dependency. Build and test passed both on Linux and FreeBSD
> (USE="berkdb dlz ipv6 ssl (-caps) (-gssapi)")
> 
> bind team, 
> 
> Please take a look at the patch. I'd like to apply the patch if you
> don't see problems.
> 
> Thanks,

The psmisc thingy is fine to me but for DB I'd like to see a patch for bind itself (which we also send to upstream then).
Comment 17 Naohiro Aota gentoo-dev 2011-12-01 03:53:50 UTC
(In reply to comment #16)
> The psmisc thingy is fine to me but for DB I'd like to see a patch for bind
> itself (which we also send to upstream then).

Writing a patch for bind-9.8.1-P1/contrib/dlz/config.dlz.in seems
a bit difficult for me. The directory detection working as
follow:

1. Check if --with-dlz-bdb[=PATH] is passed or not
2. bdbdirs set to PATH or default "/usr/local /usr/pkg /usr"
3. For each $bdbdirs, try to find if one of these exist
  - $dir/include/db.h
  - $dir/include/db42/db.h
  - $dir/include/db41/db.h
  - $dir/include/db/db.h
4. If it found db.h, the directory is set to be included

Ports/Pkgsrc usually install database/db into /usr/local or
/usr/pkg, so it detect database/db's db.h (not FreeBSD's own
db.h)

However, on Gentoo, we install sys-libs/db into /usr, so that the
above code detect /usr/include/db.h which is FreeBSD's own db.h
and doesn't have DB_ENV definition.

I have no idea how can I rewrite this code to work on
Gentoo/FreeBSD without big logic change. Adding --with-bdb-incdir
option would be a possible solution, if we accept big change...
Comment 18 Christian Ruppert (idl0r) gentoo-dev 2011-12-01 16:48:29 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > The psmisc thingy is fine to me but for DB I'd like to see a patch for bind
> > itself (which we also send to upstream then).
> 
> Writing a patch for bind-9.8.1-P1/contrib/dlz/config.dlz.in seems
> a bit difficult for me. The directory detection working as
> follow:
> 
> 1. Check if --with-dlz-bdb[=PATH] is passed or not
> 2. bdbdirs set to PATH or default "/usr/local /usr/pkg /usr"
> 3. For each $bdbdirs, try to find if one of these exist
>   - $dir/include/db.h
>   - $dir/include/db42/db.h
>   - $dir/include/db41/db.h
>   - $dir/include/db/db.h
> 4. If it found db.h, the directory is set to be included
> 
> Ports/Pkgsrc usually install database/db into /usr/local or
> /usr/pkg, so it detect database/db's db.h (not FreeBSD's own
> db.h)
> 
> However, on Gentoo, we install sys-libs/db into /usr, so that the
> above code detect /usr/include/db.h which is FreeBSD's own db.h
> and doesn't have DB_ENV definition.
> 
> I have no idea how can I rewrite this code to work on
> Gentoo/FreeBSD without big logic change. Adding --with-bdb-incdir
> option would be a possible solution, if we accept big change...

Is Gentoo/FreeBSD different than FreeBSD or *BSD?
So the BSD guys may have a patch already in their ports.
Comment 19 Naohiro Aota gentoo-dev 2011-12-04 13:03:07 UTC
(In reply to comment #18)
> Is Gentoo/FreeBSD different than FreeBSD or *BSD?
> So the BSD guys may have a patch already in their ports.

Yes, there's a different Gentoo/FreeBSD and FreeBSD. FreeBSD install additional packages into /usr/local and Gentoo/FreeBSD install the things into /usr. 

There's no patch in ports/pkgsrc, because bind code works well on them without any changes. The code detect /usr/local/include/db.h or /usr/pkg/include/db.h (berkdb package's file) before /usr/include/db.h (BSD base system's file)
Only Gentoo/FreeBSD has this problem.
Comment 20 Christian Ruppert (idl0r) gentoo-dev 2011-12-04 13:39:33 UTC
Hm, ok.. Feel free to apply your patch but please also add a reference to this bug.

It sounds to me like our fbsd needs some fixes, I wonder if more packages are affected by this bug.
Comment 21 Naohiro Aota gentoo-dev 2011-12-06 12:53:42 UTC
Applied. Thanks.

Yes..but as long as FreeBSD db.h stay on /usr/include/db.h, it would be difficult to solve..