From d314594b60f131b15cb811d04ee5772d6465dba8 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 12 May 2013 19:22:50 +0200 Subject: [PATCH] avahi/samba: When samba is built with avahi support the server name is advertised in UPPERCASE as samba forces this when setting-up avahi via dbus. If we disable avahi support in samba and include a samba.service file with avahi the hostname is correctly advertised as the user entered it; e.g. OpenELEC not OPENELEC ..we can also use a tweaked samba.service so Mac users with an AppleTV see the AppleTV icon in Finder.app instead of a generic server icon. this fixes #2282 Signed-off-by: Stephan Raue --- packages/network/avahi/config/http.service | 2 +- packages/network/avahi/config/samba.service | 4 ++-- packages/network/avahi/install | 9 ++++++++- packages/network/samba/build | 8 +------- packages/network/samba/meta | 5 ----- projects/ATV/avahi/samba.service | 14 ++++++++++++++ 6 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 projects/ATV/avahi/samba.service diff --git a/packages/network/avahi/config/http.service b/packages/network/avahi/config/http.service index 8e0d3a5136..6763a05cf8 100644 --- a/packages/network/avahi/config/http.service +++ b/packages/network/avahi/config/http.service @@ -1,7 +1,7 @@ - Web Server on %h + %h _http._tcp 80 diff --git a/packages/network/avahi/config/samba.service b/packages/network/avahi/config/samba.service index 0ec34cb3dc..5b44889bc6 100644 --- a/packages/network/avahi/config/samba.service +++ b/packages/network/avahi/config/samba.service @@ -1,9 +1,9 @@ - Samba Server on %h + %h _smb._tcp - 139 + 445 diff --git a/packages/network/avahi/install b/packages/network/avahi/install index 19b38473eb..3d03ee189d 100755 --- a/packages/network/avahi/install +++ b/packages/network/avahi/install @@ -39,7 +39,14 @@ mkdir -p $INSTALL/etc/avahi mkdir -p $INSTALL/etc/avahi/services cp $PKG_BUILD/avahi-daemon/ssh.service $INSTALL/etc/avahi/services cp $PKG_DIR/config/http.service $INSTALL/etc/avahi/services -# cp $PKG_DIR/config/samba.service $INSTALL/etc/avahi/services + + if [ $SAMBA_SERVER = "yes" ]; then + if [ -f $PROJECT_DIR/$PROJECT/avahi/samba.service ]; then + cp $PROJECT_DIR/$PROJECT/avahi/samba.service $INSTALL/etc/avahi/services + else + cp $PKG_DIR/config/samba.service $INSTALL/etc/avahi/services + fi + fi if [ $SFTP_SERVER = "yes" ]; then cp $PKG_BUILD/avahi-daemon/sftp-ssh.service $INSTALL/etc/avahi/services diff --git a/packages/network/samba/build b/packages/network/samba/build index b9a89077ec..c909fb180b 100755 --- a/packages/network/samba/build +++ b/packages/network/samba/build @@ -22,12 +22,6 @@ . config/options $1 -if [ "$AVAHI_DAEMON" = yes ]; then - SMB_AVAHI="--enable-avahi" -else - SMB_AVAHI="--disable-avahi" -fi - CFLAGS="$CFLAGS -fPIC -DPIC" cd $PKG_BUILD/source3 @@ -79,7 +73,7 @@ samba_cv_have_setresuid=yes \ --disable-relro \ --disable-fam \ --disable-dnssd \ - $SMB_AVAHI \ + --disable-avahi \ --disable-pthreadpool \ --enable-gnutls \ --disable-netapi \ diff --git a/packages/network/samba/meta b/packages/network/samba/meta index 808988535a..f6c02cba1e 100644 --- a/packages/network/samba/meta +++ b/packages/network/samba/meta @@ -34,8 +34,3 @@ PKG_LONGDESC="Samba is a SMB server that runs on Unix and other operating system PKG_IS_ADDON="no" PKG_AUTORECONF="no" - -if [ "$AVAHI_DAEMON" = yes ]; then - PKG_DEPENDS="$PKG_DEPENDS avahi" - PKG_BUILD_DEPENDS="$PKG_BUILD_DEPENDS avahi" -fi diff --git a/projects/ATV/avahi/samba.service b/projects/ATV/avahi/samba.service new file mode 100644 index 0000000000..0cccf71f1c --- /dev/null +++ b/projects/ATV/avahi/samba.service @@ -0,0 +1,14 @@ + + + + %h + + _smb._tcp + 445 + + + _device-info._tcp + 0 + model=AppleTV1,1 + +