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 <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2013-05-12 19:22:50 +02:00
parent 110922d392
commit d314594b60
6 changed files with 26 additions and 16 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Web Server on %h</name>
<name replace-wildcards="yes">%h</name>
<service>
<type>_http._tcp</type>
<port>80</port>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Samba Server on %h</name>
<name replace-wildcards="yes">%h</name>
<service>
<type>_smb._tcp</type>
<port>139</port>
<port>445</port>
</service>
</service-group>

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -0,0 +1,14 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=AppleTV1,1</txt-record>
</service>
</service-group>