I briefly had sys-cluster/ceph-0.94.3 installed and it seems like the samba build system picked up on it and linked to it. I noticed when I went to "emerge -cav ceph" that it showed it could safely unmerge (no reverse deps) but then preserve-libs kicked in. # emerge -cav ceph Calculating dependencies... done! >>> Calculating removal order... >>> These are the packages that would be unmerged: sys-cluster/ceph selected: 0.94.3 protected: none omitted: none All selected packages: =sys-cluster/ceph-0.94.3 >>> 'Selected' packages are slated for removal. >>> 'Protected' and 'omitted' packages will not be removed. Would you like to unmerge these packages? [Yes/No] y >>> Unmerging (1 of 1) sys-cluster/ceph-0.94.3... Packages installed: 1084 Packages in world: 184 Packages in system: 44 Required packages: 1084 Number removed: 1 * GNU info directory index is up-to-date. !!! existing preserved libs: >>> package: sys-cluster/ceph-0.94.3 * - /usr/lib64/libcephfs.so.1 * - /usr/lib64/libcephfs.so.1.0.0 * used by /usr/lib64/samba/vfs/ceph.so (net-fs/samba-4.2.4-r1) Use emerge @preserved-rebuild to rebuild packages using these libraries # objdump -p /usr/lib64/samba/vfs/ceph.so | grep NEED NEEDED libpthread.so.0 NEEDED libsamba-util.so.0 NEEDED libsmbd-base-samba4.so NEEDED libsamba-debug-samba4.so NEEDED libsmbconf.so.0 NEEDED libtalloc.so.2 NEEDED libcephfs.so.1 NEEDED libc.so.6 VERNEED 0x0000000000001038 VERNEEDNUM 0x0000000000000007 #
In addition to this: # libgfapi.so.0, 2 sys-cluster/glusterfs:0 # libcephfs.so.1, 2 sys-cluster/ceph:0 It also links with libgfapi.so.0 if sys-cluster/glusterfs is installed in the system.
Forgot to mention that I tested this with net-fs/samba-4.2.12 on an amd64 chroot.
I had a quick look at the samba 4.2.12 source tarball and did: ./configure --help | grep cluster --with-cluster-support Build with cluster-support support (default=auto) In the ebuild we see this: $(use_with cluster cluster-support) I think it should be: $(use_with cluster with-cluster-support)
My bad. It does seem to be right in the ebuild. Guess the flaw is somewhere in the buildsystem.
Created attachment 460576 [details, diff] Ebuild with added USE=ceph. samba-4.2.14-cephfs-switch.patch is https://git.samba.org/?p=samba.git;a=commit;h=38bb993657f8eb6c49899de0d741ed5186ca5022 (not attached) samba-4.2.14-cephfs-switch-fix.patch is based on https://git.samba.org/?p=samba.git;a=commit;h=14f29c4f560f1b3942245a6fa43924a8ce45d99d
Created attachment 460578 [details, diff] Patch to make the option --with/without-cephfs take effect.
Attached patches. Only USE=-ceph tested. USE=-ceph leads to /usr/lib64/samba/vfs/ceph.so not being installed. /usr/share/man/man8/vfs_ceph.8.bz2 is still installed but it's upstream build system's thing (I think).
Looks like 4.5.10 finally has the change in the build system and only ebuild needs to be changed. I'll update the patch after testing.
Created attachment 474394 [details, diff] example patch that adds IUSE+=ceph to 4.5.10 The only change is added support to enabling/disabling ceph support. 4.5.10 was the first version in Gentoo (or at least the first one with the stable keyword) which doesn't need a patch to the build system.
I have tested this against 4.7.0-r1. Works mostly as expected (tested with USE={,-}ceph, with and without ceph installed. One minor caveat-- if you enable USE=ceph but ceph is still missing (due to --nodeps) or is otherwise broken/unusable, the samba build will succeed with ceph.so not built/installed. Oh also the vfs_ceph.8 man page is still installed either way. But even so, this would be a big improvement over the current situation.
Created attachment 499940 [details, diff] ebuild patch For good measure, here is the ebuild patch I tested with. Same functionality as the previously attached one, but alpha-sorted & applies cleanly to 4.7.0-r1. This change will need a local USE desc in metadata.xml as well.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3863cb68ebf5709d2549ee278180c615f2288bc9 commit 3863cb68ebf5709d2549ee278180c615f2288bc9 Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2017-10-26 07:52:57 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2017-10-26 07:52:57 +0000 net-fs/samba: Fixed automagic linking against sys-cluster/ceph Closes: https://bugs.gentoo.org/563146 Package-Manager: Portage-2.3.12, Repoman-2.3.4 net-fs/samba/metadata.xml | 1 + net-fs/samba/samba-4.6.9.ebuild | 5 ++++- net-fs/samba/samba-4.7.0-r1.ebuild | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-)