samba4: add missing avahi service definitions
authorAndy Walsh <andy.walsh44+github@gmail.com>
Sat, 4 Aug 2018 19:20:22 +0000 (21:20 +0200)
committerYousong Zhou <yszhou4tech@gmail.com>
Mon, 6 Aug 2018 01:50:54 +0000 (09:50 +0800)
Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
net/samba4/Makefile
net/samba4/files/samba.service [new file with mode: 0644]

index c140d7aa29f926ebddf5e86faacf92f4dc9630b5..c111d09865ba95a7ae0dd3c7dc2d61c981cac988 100644 (file)
@@ -368,6 +368,10 @@ ifeq ($(CONFIG_SAMBA4_SERVER_WINBIND),y)
 endif
 ifeq ($(CONFIG_SAMBA4_SERVER_ACL),y)
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sharesec $(1)/usr/bin/
+endif
+ifeq ($(CONFIG_SAMBA4_SERVER_AVAHI),y)
+       $(INSTALL_DIR) $(1)/etc/avahi/services
+       $(INSTALL_DATA) ./files/samba.service $(1)/etc/avahi/services/
 endif
        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/samba $(1)/etc/init.d
        $(INSTALL_DATA) ./files/samba.config $(1)/etc/config/samba4
@@ -385,6 +389,7 @@ define Package/samba4-server/conffiles
 /etc/samba/idmap.ldb
 /etc/samba/lmhosts
 /etc/nsswitch.conf
+/etc/avahi/services/samba.service
 endef
 
 $(eval $(call BuildPackage,samba4-libs))
diff --git a/net/samba4/files/samba.service b/net/samba4/files/samba.service
new file mode 100644 (file)
index 0000000..8191e52
--- /dev/null
@@ -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>_adisk._tcp</type>
+   <txt-record>sys=waMa=0,adVF=0x100</txt-record>
+   <txt-record>dk0=adVN=TimeMachine,adVF=0x82</txt-record>
+ </service>
+  <service>
+    <type>_smb._tcp</type>
+    <port>445</port>
+  </service>
+</service-group>