Ticket #10245: netatalk-avahi.2.patch

File netatalk-avahi.2.patch, 7.4 KB (added by Faralla <faralla@…>, 5 years ago)

revised patch. No creates two packages with and without zeroconf support

  • net/netatalk/files/AppleVolumes.default

     
    1 - 
    2 /tmp Temp allow:root,nobody cnidscheme:dbd 
     1# Config file reference: http://netatalk.sourceforge.net/2.2/htmldocs/AppleVolumes.default.5.html 
     2 
     3:DEFAULT: options:upriv,usedots 
     4:DEFAULT_CNID_SCHEME: dbd 
     5 
     6# Regular AFP share 
     7#/mnt/fileserver/mp3 "mp3" 
     8 
     9# Time machine share 
     10# For best results, share an entire harddisk partition for time machine 
     11# You must never alter any files in the time machine share using any other access method than afp, or you will mess up the searchdb, which should be faster 
     12#/mnt/timemachine "TimeMachine" options:tm,searchdb 
     13 
     14# All users have access to their home directories. 
     15#~/ "Home Directory" 
     16 
     17# Demo share for root and guest user 
     18/tmp Temp allow:root,nobody 
     19 No newline at end of file 
  • net/netatalk/files/netatalk.init

     
     1#!/bin/sh /etc/rc.common 
     2 
     3START=70 
     4 
     5MAXCONS="7" 
     6CONFIGFILE="/etc/netatalk/afpd.conf" 
     7PIDFILE="/var/run/afpd.pid" 
     8 
     9start() 
     10{ 
     11        # create lock directory for cnid_metad 
     12        mkdir -p /var/spool/locks 
     13         
     14        /usr/sbin/cnid_metad 
     15        /usr/sbin/afpd -F ${CONFIGFILE} -P ${PIDFILE} -c ${MAXCONS} 
     16} 
     17 
     18stop() 
     19{ 
     20        kill `cat "${PIDFILE}"` 
     21        killall cnid_metad 
     22} 
     23 
     24reload() 
     25{ 
     26        kill -s HUP `cat "${PIDFILE}"` 
     27} 
  • net/netatalk/files/afpd.init

     
    1 #!/bin/sh /etc/rc.common 
    2  
    3 START=70 
    4  
    5 MAXCONS="7" 
    6 CONFIGFILE="/etc/netatalk/afpd.conf" 
    7 PIDFILE="/var/run/afpd.pid" 
    8  
    9 start() 
    10 { 
    11         /usr/sbin/cnid_metad 
    12         /usr/sbin/afpd -F ${CONFIGFILE} -P ${PIDFILE} -c ${MAXCONS} 
    13 } 
    14  
    15 stop() 
    16 { 
    17         kill `cat "${PIDFILE}"` 
    18         killall cnid_metad 
    19 } 
    20  
    21 reload() 
    22 { 
    23         kill -s HUP `cat "${PIDFILE}"` 
    24 } 
  • net/netatalk/files/afpd.conf

     
    1 - -noddp -uampath /usr/lib/uams -uamlist uams_guest.so,uams_passwd.so,uams_dhx_passwd.so,uams_randnum.so,uams_dhx2.so -passwdfile /etc/netatalk/afppasswd -savepassword -passwdminlen 0 -nosetpassword -defaultvol /etc/netatalk/AppleVolumes.default -systemvol /etc/netatalk/AppleVolumes.system -nouservol -guestname "nobody" -sleep 1 -icon 
     1- -noddp -uamlist uams_guest.so,uams_dhx.so,uams_dhx2.so -savepassword -nosetpassword -nouservol 
  • net/netatalk/Makefile

     
    1616PKG_MD5SUM:=4a371025daf96adb73fa491efdbfef28 
    1717 
    1818PKG_BUILD_PARALLEL:=1 
     19PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) 
    1920PKG_INSTALL:=1 
    2021PKG_FIXUP:=autoreconf 
    2122 
    2223include $(INCLUDE_DIR)/package.mk 
    2324 
    24 define Package/netatalk 
     25define Package/netatalk-base/Default 
    2526  SECTION:=net 
    2627  CATEGORY:=Network 
    2728  SUBMENU:=Filesystem 
     29  TITLE:=netatalk 
    2830  DEPENDS:=+libdb47 +libgcrypt +libopenssl $(LIBRPC_DEPENDS) 
    29   TITLE:=netatalk 
    3031  URL:=http://netatalk.sourceforge.net 
    31   MAINTAINER:=W. Michael Petullo <mike@flyn.org> 
    3232endef 
    3333 
    34 define Package/netatalk/decription 
     34define Package/netatalk-nozeroconf 
     35 $(call Package/netatalk-base/Default) 
     36 TITLE+= (without zeroconf support) 
     37 VARIANT:=nozeroconf 
     38endef 
     39 
     40define Package/netatalk 
     41 $(call Package/netatalk-base/Default) 
     42 TITLE+= (with zeroconf support) 
     43 VARIANT:=zeroconf 
     44 DEPENDS+= +libavahi-client +avahi-daemon-dbus 
     45endef 
     46    
     47define Package/netatalk-base/Default/description 
    3548  Netatalk is a freely-available Open Source AFP fileserver. 
    3649  It also provides a kernel level implementation of the AppleTalk 
    3750  Protocol Suite. 
     51   
     52  The Packages netatalk-zeroconf and netatalk-nozeroconf are mutually exclusive. Use either one or the other. 
    3853endef 
    3954 
    40 define Package/netatalk/conffiles 
     55define Package/netatalk-nozeroconf/description 
     56$(call Package/netatalk-base/Default/description) 
     57  
     58This Package provides no zeroconf support to advertising volumes automatically. This will save image space, while the advertisin functionality can still be enabled with a static config file for avahi-daemon. 
     59endef 
     60 
     61define Package/netatalk/description 
     62$(call Package/netatalk-base/Default/description) 
     63   
     64 This Package provides zeroconf support to advertise volumes automatically on the network. That is, there will be no need to create a static config file for avahi-daemon. 
     65endef 
     66 
     67define Package/netatalk-base/Default/conffiles 
    4168/etc/netatalk/afpd.conf 
     69/etc/netatalk/AppleVolumes.default 
     70/etc/netatalk/AppleVolumes.system 
    4271endef 
    4372 
     73define Package/netatalk-nozeroconf/conffiles 
     74$(call Package/netatalk-base/Default/conffiles) 
     75endef 
     76 
     77define Package/netatalk/conffiles 
     78$(call Package/netatalk-base/Default/conffiles) 
     79endef 
     80 
    4481TARGET_CFLAGS += -std=c99 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib 
    4582TARGET_LDFLAGS += $(LIBRPC) 
    4683 
    4784CONFIGURE_ARGS += \ 
    4885        --disable-afs \ 
    49         --enable-hfs \ 
    5086        --disable-debugging \ 
    5187        --disable-shell-check \ 
    5288        --disable-timelord \ 
     
    6096        --with-uams-path="/usr/lib/uams" \ 
    6197        --disable-admin-group \ 
    6298        --disable-srvloc \ 
    63         --disable-zeroconf \ 
     99        --enable-zeroconf="$(STAGING_DIR)/usr" \ 
    64100        --without-shadow \ 
    65101        --without-ldap 
    66102 
    67 define Package/netatalk/install 
     103ifeq ($(BUILD_VARIANT),zeroconf) 
     104CONFIGURE_ARGS += \ 
     105        --enable-zeroconf="$(STAGING_DIR)/usr" 
     106endif 
     107ifeq ($(BUILD_VARIANT),nozeroconf) 
     108CONFIGURE_ARGS += \ 
     109        --disable-zeroconf  
     110endif 
     111 
     112define Package/netatalk-nozeroconf/install 
    68113        $(INSTALL_DIR) $(1)/usr/bin 
    69114        $(INSTALL_DIR) $(1)/usr/sbin 
    70115        $(INSTALL_DIR) $(1)/usr/lib/uams 
     
    75120        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/ 
    76121        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/ 
    77122        $(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/ 
    78         $(CP) ./files/AppleVolumes.default $(1)/etc/netatalk/ 
    79         $(CP) $(PKG_INSTALL_DIR)/etc/netatalk/AppleVolumes.system $(1)/etc/netatalk/ 
     123        $(INSTALL_DATA) ./files/AppleVolumes.default $(1)/etc/netatalk/ 
     124        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/netatalk/AppleVolumes.system $(1)/etc/netatalk/ 
    80125        $(INSTALL_CONF) ./files/afpd.conf $(1)/etc/netatalk/ 
    81         $(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd 
     126        $(INSTALL_BIN) ./files/netatalk.init $(1)/etc/init.d/netatalk 
    82127endef 
    83128 
     129define Package/netatalk/install 
     130        $(INSTALL_DIR) $(1)/usr/bin  
     131        $(INSTALL_DIR) $(1)/usr/sbin 
     132        $(INSTALL_DIR) $(1)/usr/lib/uams 
     133        $(INSTALL_DIR) $(1)/etc/netatalk 
     134        $(INSTALL_DIR) $(1)/etc/init.d 
     135        $(CP) $(PKG_INSTALL_DIR)/usr/bin/afppasswd $(1)/usr/bin/ 
     136        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/afpd $(1)/usr/sbin/ 
     137        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/     
     138        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/     
     139        $(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/   
     140        $(INSTALL_DATA) ./files/AppleVolumes.default $(1)/etc/netatalk/ 
     141        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/netatalk/AppleVolumes.system $(1)/etc/netatalk/ 
     142        $(INSTALL_CONF) ./files/afpd.conf $(1)/etc/netatalk/ 
     143        $(INSTALL_BIN) ./files/netatalk.init $(1)/etc/init.d/netatalk 
     144endef 
     145 
    84146$(eval $(call BuildPackage,netatalk)) 
     147$(eval $(call BuildPackage,netatalk-nozeroconf))