if samba configure script finds installed systemd, it tries to link against it. With the ebuild that is in three right now, compilation fails: it uses sd_notify() from libsystemd.so. Reproducible: Always Steps to Reproduce: 1. emerge -1 systemd 2. emerge -1 =net-fs/samba-4.1.8
(wscript:191) > if conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H'): > conf.DEFINE('HAVE_SYSTEMD', '1') > conf.env['ENABLE_SYSTEMD'] = True There are --with{,out}-systemd flags; but, the above check ignores that.
waf script from git checks for missing library "https://git.samba.org/?p=samba.git;a=blob;f=wscript;h=cf4e93b1c07c5cf9474c5cbddefc43b9db517383;hb=HEAD#l201" (wscript: 207) > if (conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H') and > conf.CONFIG_SET('HAVE_LIBSYSTEMD_DAEMON')): > conf.DEFINE('HAVE_SYSTEMD', '1') > conf.env['ENABLE_SYSTEMD'] = True But another problem is (wscript: 205) > conf.CHECK_LIB('systemd-daemon', shlib=True) will not work with most recent gentoo's systemd-213 because there are no longer any 'libsystemd-daemon'. pkg-config files provided with systemd map 'libsystemd-daemon' to the new 'libsystemd', but wscript doesn't use library name discovered with it (check_cfg function) Still works for earlier versions though systemd-208 - library is still there systemd-212 - ebuild manually sets compatibility symlinks
Created attachment 379326 [details, diff] Patch against samba-4.1.8.ebuild to honor systemd use flag Shouldn't the ebuild also honor the systemd use flag? It doesn't fix the samba/waf/systemd-daemon issue, but builds cleanly. On systems using OpenRC, it seems like a reasonable option.
Reported upstream: https://bugzilla.samba.org/show_bug.cgi?id=10672 But we should probably apply the patch for users that have systemd installed, but are using OpenRC.
Created attachment 380842 [details, diff] Fix systemd vs systemd-daemon library check Adaptation of Tony Murray's patch for samba-4.1.9.
FYI, it shouldn't matter about the systemd use flag. If the systemd library is present, it will link against it. The library was designed to be init agnostic. The resulting build function on openrc or systemd init, but get extra fanciness on systemd.
(In reply to Tony Murray from comment #6) > FYI, it shouldn't matter about the systemd use flag. > If the systemd library is present, it will link against it. What if I build a binpkg and install it on a system without systemd? It either needs a hard-dep, or a use-conditional dep, and it must be disabled if the use flag is not enabled.
Also, you might want to point out that upstream systemd no longer installs libsystemd-daemon.pc; that's a Gentoo-specifc hack we created to prevent mass breakage. Only libsystemd.pc is installed by default. I tried adding a comment on the upstream bug, but I don't have an account and I haven't gotten my account creation email yet.
(In reply to Mike Gilbert from comment #7) > (In reply to Tony Murray from comment #6) > > FYI, it shouldn't matter about the systemd use flag. > > If the systemd library is present, it will link against it. > > What if I build a binpkg and install it on a system without systemd? > > It either needs a hard-dep, or a use-conditional dep, and it must be > disabled if the use flag is not enabled. ++ That is just Gentoo policy. Obviously getting there can take some work/time/etc, and lots of packages have these kinds of problems. It is still a valid bug when we discover them. Anything that gets linked is a dependency (ideally a slot operator dep). If the linkage can be made conditional (ie USE flag), then the dependency can be made conditional. I imagine we don't want a hard-dep on systemd for samba, so the USE flag is the way to go. By all means try to get upstream to go along.
+ 03 Jan 2015; Michał Górny <mgorny@gentoo.org> samba-4.1.14.ebuild: + Make systemd library support optional, bug #512510. I'll fix the systemd support itself in the next commit ;).