# Avahi-Daemon



## wernerdev (Mar 30, 2011)

Hello,

I recently changed to FreeBSD, and wanted to install Avahi. But I noticed only the full Avahi package is available. Which installs Gnome and X server packages which clutter my server.

I only need the Avahi-Daemon which runs in the background.

Can someone create a package with only the Avahi-Daemon? It only requires "expat" and "libdaemon" according to the official website: http://avahi.org/wiki/DownloadAvahi#Requirements

If it's not that hard to do it myself, I want to give it a try with some clear instructions.

Thanks in advance!


----------



## wernerdev (Mar 30, 2011)

I put this in the wrong forum I see. Some moderator can put it in the right place (Porting New Software)?


----------



## DutchDaemon (Mar 30, 2011)

I moved it here, because it's not really about porting something that doesn't yet run on FreeBSD to run on FreeBSD. Which is what 'porting new software' is. You're looking for a modification of an existing port or package, it seems.


----------



## vermaden (Mar 30, 2011)

@wernerdev

Just go to the packages sie and download/install only the packages You need (like in Slackware):
http://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.2-release/


----------



## wernerdev (Mar 31, 2011)

vermaden said:
			
		

> @wernerdev
> 
> Just go to the packages sie and download/install only the packages You need (like in Slackware):
> http://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.2-release/



I tried that, but when download the Avahi-App package again a lot of unneeded files come with it. Like the browsing and connecting tools, some gnome files and so on.

This is the Debian package I used to use: http://packages.debian.org/stable/net/avahi-daemon. It only contains the Daemon and requires minimum other packages. Just like I need.

Really hope someone can create the same for FreeBSD.


----------



## wernerdev (Mar 31, 2011)

Or can I "configure and make" the port myself and only select the daemon then? Or is it just not made to compile the daemon only?


----------



## wernerdev (Apr 1, 2011)

Really hope someone can help me or point me in the right direction. My knowledge is too small to modify and compile it from source myself. I tried something yesterday, but again it downloaded all unneeded dependencies.

I hope someone wants to create a "Daemon only" package for me (and others).


----------



## SirDice (Apr 1, 2011)

wernerdev said:
			
		

> I hope someone wants to create a "Daemon only" package for me (and others).


Use net/avahi-app. Build it with WITHOUT_X11 if you need to.


----------



## wernerdev (Apr 1, 2011)

Not really working...

Normal build:

```
FreeDSB# make all-depends-list
/usr/ports/devel/libtool
/usr/ports/devel/gobject-introspection
/usr/ports/devel/gmake
/usr/ports/textproc/intltool
/usr/ports/devel/pkg-config
/usr/ports/textproc/expat2
/usr/ports/devel/libdaemon
/usr/ports/devel/dbus-glib
/usr/ports/databases/gdbm
/usr/ports/devel/gettext
/usr/ports/devel/glib20
/usr/ports/devel/gio-fam-backend
/usr/ports/sysutils/gnome_subr
/usr/ports/textproc/flex
/usr/ports/lang/python26
/usr/ports/devel/bison
/usr/ports/devel/libffi
/usr/ports/graphics/cairo
/usr/ports/lang/perl5.10
/usr/ports/textproc/p5-XML-Parser
/usr/ports/converters/libiconv
/usr/ports/devel/dbus
/usr/ports/devel/pcre
/usr/ports/devel/gamin
/usr/ports/misc/help2man
/usr/ports/devel/m4
/usr/ports/x11/xcb-util
/usr/ports/x11/libXrender
/usr/ports/print/freetype2
/usr/ports/graphics/png
/usr/ports/x11-fonts/fontconfig
/usr/ports/x11/pixman
/usr/ports/x11/libX11
/usr/ports/textproc/libxml2
/usr/ports/devel/p5-Locale-gettext
/usr/ports/devel/gperf
/usr/ports/x11/libXau
/usr/ports/x11/libXdmcp
/usr/ports/x11/libxcb
/usr/ports/x11/renderproto
/usr/ports/x11/xproto
/usr/ports/devel/xorg-macros
/usr/ports/x11/bigreqsproto
/usr/ports/x11/xcmiscproto
/usr/ports/x11/xextproto
/usr/ports/x11/xtrans
/usr/ports/x11/kbproto
/usr/ports/x11/inputproto
/usr/ports/x11-fonts/xf86bigfontproto
/usr/ports/devel/automake
/usr/ports/devel/autoconf
/usr/ports/devel/libcheck
/usr/ports/textproc/libxslt
/usr/ports/x11/xcb-proto
/usr/ports/devel/libpthread-stubs
/usr/ports/devel/automake-wrapper
/usr/ports/devel/autoconf-wrapper
/usr/ports/security/libgcrypt
/usr/ports/security/libgpg-error
```

Without X11 build:

```
FreeDSB# make -D WITHOUT_X11 all-depends-list
/usr/ports/devel/libtool
/usr/ports/devel/gobject-introspection
/usr/ports/devel/gmake
/usr/ports/textproc/intltool
/usr/ports/devel/pkg-config
/usr/ports/textproc/expat2
/usr/ports/devel/libdaemon
/usr/ports/devel/dbus-glib
/usr/ports/databases/gdbm
/usr/ports/devel/gettext
/usr/ports/devel/glib20
/usr/ports/devel/gio-fam-backend
/usr/ports/sysutils/gnome_subr
/usr/ports/textproc/flex
/usr/ports/lang/python26
/usr/ports/devel/bison
/usr/ports/devel/libffi
/usr/ports/graphics/cairo
/usr/ports/lang/perl5.10
/usr/ports/textproc/p5-XML-Parser
/usr/ports/converters/libiconv
/usr/ports/devel/dbus
/usr/ports/devel/pcre
/usr/ports/devel/gamin
/usr/ports/misc/help2man
/usr/ports/devel/m4
/usr/ports/x11/xcb-util
/usr/ports/print/freetype2
/usr/ports/graphics/png
/usr/ports/x11-fonts/fontconfig
/usr/ports/x11/pixman
/usr/ports/textproc/libxml2
/usr/ports/devel/p5-Locale-gettext
/usr/ports/devel/gperf
/usr/ports/x11/libXau
/usr/ports/x11/libXdmcp
/usr/ports/x11/libxcb
/usr/ports/x11/xproto
/usr/ports/devel/libcheck
/usr/ports/textproc/libxslt
/usr/ports/x11/xcb-proto
/usr/ports/devel/libpthread-stubs
/usr/ports/security/libgcrypt
/usr/ports/security/libgpg-error
```

Still a lot of X11 stuff. Including fonts I will never use. Also a lot of graphics stuff and something like sysutils/gnome_subr.

Unneeded, but it's still in the dependencies list. Guess it just wont compile when I hard-remove them somehow. That's why I need the help from a more experienced FreeBSD user.


----------



## SirDice (Apr 1, 2011)

Don't take a look with all-depends-list, I've seen it list dependencies that aren't really there.


```
root@build:/usr/ports/net/avahi-app#make -DWITHOUT_X11 run-depends-list
/usr/ports/databases/gdbm
/usr/ports/devel/dbus-glib
/usr/ports/devel/gettext
/usr/ports/devel/gio-fam-backend
/usr/ports/devel/glib20
/usr/ports/devel/gobject-introspection
/usr/ports/devel/libdaemon
/usr/ports/devel/pkg-config
/usr/ports/sysutils/gnome_subr
/usr/ports/textproc/expat2
root@build:/usr/ports/net/avahi-app#make -DWITHOUT_X11 build-depends-list
/usr/ports/databases/gdbm
/usr/ports/devel/dbus-glib
/usr/ports/devel/gettext
/usr/ports/devel/glib20
/usr/ports/devel/gmake
/usr/ports/devel/gobject-introspection
/usr/ports/devel/libdaemon
/usr/ports/devel/libtool
/usr/ports/devel/pkg-config
/usr/ports/textproc/expat2
/usr/ports/textproc/intltool
```


----------



## wernerdev (Apr 1, 2011)

Don't really trust the depends lists.

Both output the same...

```
FreeDSB# make -D WITHOUT_X11 run-depends-list
/usr/ports/databases/gdbm
/usr/ports/devel/dbus-glib
/usr/ports/devel/gettext
/usr/ports/devel/gio-fam-backend
/usr/ports/devel/glib20
/usr/ports/devel/gobject-introspection
/usr/ports/devel/libdaemon
/usr/ports/devel/pkg-config
/usr/ports/sysutils/gnome_subr
/usr/ports/textproc/expat2
FreeDSB# make run-depends-list
/usr/ports/databases/gdbm
/usr/ports/devel/dbus-glib
/usr/ports/devel/gettext
/usr/ports/devel/gio-fam-backend
/usr/ports/devel/glib20
/usr/ports/devel/gobject-introspection
/usr/ports/devel/libdaemon
/usr/ports/devel/pkg-config
/usr/ports/sysutils/gnome_subr
/usr/ports/textproc/expat2
```


----------



## SirDice (Apr 1, 2011)

Which basically answers your question, avahi-app has no X11 dependencies.


----------



## wernerdev (Apr 1, 2011)

Then why does it download them all when I install the port with [cmd=]pkg_add -r avahi-app[/cmd]? It then seems to download all the dependencies from the "all-depends-list".

And what does "all-depends-list" show? Can't find anything about those commands in the manual.


----------



## wernerdev (Apr 1, 2011)

Too bad I can't edit my posts, so sorry for two posts in a row.

I just started compiling using [cmd=]make -D WITHOUT_X11[/cmd]

But like I expected it started downloading and compiling all packages from the "all-depends-list". So that clearly does not work.
I canceled using CTRL+C and tried again using [cmd=]make -DWITHOUT_X11[/cmd] (maybe the space was the problem), but it just did it again and install all packages.


----------



## jb_fvwm2 (Apr 1, 2011)

Download the remote package from packages-8-stable, unextract it to /tmp and find the binary within it?


----------



## SirDice (Apr 1, 2011)

I've built avahi-app numerous times for my server (which has no X11 related ports installed) and I've never had any issues with it.

That said, it may need a few X11 libraries for the build dependencies. Because they are only needed to build the port you can safely remove them afterwards. I do all my building on a separate machine so I don't notice this. In any case, there are no X11 libraries or related ports needed to run avahi.


----------



## wernerdev (Apr 1, 2011)

You have some short instructions how you build it on a separate machine and then move/install it on the actual server?
Because I also have a FreeBSD build in a Virtual Machine on which I can build it.


----------



## wernerdev (Apr 3, 2011)

Can anyone help me in the right direction and post some instructions? Because recompiling using WITHOUT_X11 does not solve the problem. I don't want to install crap I don't use.


----------



## jb_fvwm2 (Apr 3, 2011)

Have you tried my suggestion above? 
	
	



```
cd /usr/ports/ftp/ncftp3/ && make install && rehash && ncftp ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/net
#net# get avahi-app...#...gz (or bz2 or something)
#net# bye
cp -iv avahi-app...gz /tmp
cd /tmp
mkdir extract-avahi
cd extract-avahi
gunzip...  (etc)
```
Some commands probably not exactly right, but you may get the idea...


----------



## wernerdev (Apr 4, 2011)

jb_fvwm2 said:
			
		

> Download the remote package from packages-8-stable, unextract it to /tmp and find the binary within it?


Doesn't that also going to require dependencies when installing? Or do you mean to manually place the binary inside FreeBSD?


----------



## jb_fvwm2 (Apr 4, 2011)

Manually place it in the path; run it and manually install just any port (library) it complains about. (Not very dissimilar to just building the sysutils/pp port, placing it in sysutils/pp without installing, because it conflicts unknowingly with a perl port.) ; then

```
#pp# . ./pp #
```
 with a command line of course.

I think it only needs expat2, gettext, libdaemon, and dbus... but could be mistaken. Not to mention libraries required by those ports...


----------



## SirDice (Apr 4, 2011)

wernerdev said:
			
		

> You have some short instructions how you build it on a separate machine and then move/install it on the actual server?


`# make package` or `# make package-recursive` or `# portmaster -g cat/port`
(If you have ports-mgmt/portmaster installed.

You'll find the built package(s) in /usr/ports/packages/ or, if the directory doesn't exist, in the port's directory.


----------



## wernerdev (Aug 28, 2011)

I'm back since I didn't get this solved 

Today I tried again and the same problem is still around.
I build the port and then ran "build package-recursive".

The resulted contents of my "packages/All" directory: http://pastebin.com/raw.php?i=i8q80K44
Thats all the crap which got build and which is also required when installing.

Can't this be solved? Can't I just install "avahi-daemon" which has only 2 or 3 dependencies?
According to http://avahi.org/wiki/DownloadAvahi#Requirements the daemon only requires expat and libdaemon.

Many linux distros have separate "avahi-daemon" packages. Or ways to only compile the daemon. Both options don't seem to be available on FreeBSD. Which is a shame because I love FreeBSD.

The best (and maybe only) solution is that the port maintainers create that separate "avahi-daemon" package for FreeBSD also. Just a clean command line daemon with only a few dependencies.


----------



## Anonymous (Aug 28, 2011)

wernerdev said:
			
		

> I'm back since I didn't get this solved ...



Perhaps it is time then, to take other possibilities into consideration. The avahi-daemon(8) is for service advertising (discovery), and since you want a minimaI installation, I guess you would control this via avahi-daemon.conf(5).

This functionality can be perfectly achieved with the port of Apple's /usr/ports/net/mDNSResponder. This port has only a minimal set of dependencies, and that is the reason why I chose this over avahi. If this comes into consideration, then please look here:

http://forums.freebsd.org/showthread.php?p=143941
http://forums.freebsd.org/showthread.php?p=143970
http://forums.freebsd.org/showthread.php?p=143998

Best regards

Rolf


----------



## wernerdev (Aug 28, 2011)

I remember I tried mDNSResponder before on Debian if I'm right. Don't know why I switched back to Avahi back then, but I'm sure I had my reasons.

I see you also had a huge list of dependencies being installed with Avahi. That's because there is only a full suite package. The "avahi-daemon" package is missing.
I already mailed the port maintainer asking for the daemon only package. Just hope they will create and release it.

In the meantime I will try mDNSResponder again. Thanks.


----------

