Add Netatalk
authorMaxime Hadjinlian <maxime.hadjinlian@gmail.com>
Thu, 26 Apr 2012 07:41:47 +0000 (09:41 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 30 Apr 2012 08:35:22 +0000 (10:35 +0200)
This patch add the Netatalk package to Buildroot.

[Peter: fix download URL, force c99 mode, tweak help text]
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/Config.in
package/netatalk/Config.in [new file with mode: 0644]
package/netatalk/S50netatalk [new file with mode: 0755]
package/netatalk/netatalk.mk [new file with mode: 0644]

index 2ea334a94e3192ec116724b3116248707157436c..ed66c0586ac36084ffb37e13859a9abdb78356f3 100644 (file)
@@ -494,6 +494,7 @@ source "package/netcat/Config.in"
 source "package/netkitbase/Config.in"
 source "package/netkittelnet/Config.in"
 endif
+source "package/netatalk/Config.in"
 source "package/netplug/Config.in"
 source "package/netsnmp/Config.in"
 source "package/netstat-nat/Config.in"
diff --git a/package/netatalk/Config.in b/package/netatalk/Config.in
new file mode 100644 (file)
index 0000000..26f14c3
--- /dev/null
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_NETATALK
+       bool "netatalk"
+       select BR2_PACKAGE_BERKELEYDB
+       select BR2_PACKAGE_OPENSSL
+       select BR2_PACKAGE_LIBGCRYPT
+       select BR2_PACKAGE_LIBGPG_ERROR
+       help
+         Netatalk can be used to turn a *NIX machine into an extremely
+         high-performance and reliable file server for Macintosh computers.
+
+         http://netatalk.sourceforge.net/
diff --git a/package/netatalk/S50netatalk b/package/netatalk/S50netatalk
new file mode 100755 (executable)
index 0000000..94bb161
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh 
+# 
+# Start netatalk daemon  (aftpd && cnid_metad)
+#
+
+AFPD_UAMLIST="-U uams_dhx2.so,uams_clrtxt.so"
+
+start() {
+    echo -n "Starting Netatalk services (this will take a while): "
+    echo "Starting afpd"
+    echo -n " afpd"
+    start-stop-daemon -S -q -p /var/run/afpd.pid --exec /usr/sbin/afpd -- $AFPD_UAMLIST -g nobody -c 50
+    echo -n " cnid_metad"
+    start-stop-daemon -S -q -p /var/run/cnid_metad.pid --exec /usr/sbin/cnid_metad -- -l log_note
+    echo "."
+}
+
+stop(){
+    echo -n "Stopping Netatalk Daemons:"
+    echo -n " afpd"
+    start-stop-daemon -K -q -p /var/run/afpd.pid
+    echo -n " cnid_metad"
+    start-stop-daemon -K -q -p /var/run/cnid_metad.pid
+}
+
+case "$1" in
+    start)
+        start
+    ;; 
+    stop)
+        stop
+    ;; 
+    restart)
+        start
+        stop
+    ;; 
+    *) 
+        echo $"Usage: $0 {start|stop|restart}"
+        exit 1
+esac
+
+exit $?
+
diff --git a/package/netatalk/netatalk.mk b/package/netatalk/netatalk.mk
new file mode 100644 (file)
index 0000000..8544026
--- /dev/null
@@ -0,0 +1,36 @@
+#############################################################
+#
+# netatalk
+#
+#############################################################
+NETATALK_VERSION = 2.2.2
+NETATALK_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/project/netatalk/netatalk/$(NETATALK_VERSION)/
+NETATALK_SOURCE = netatalk-$(NETATALK_VERSION).tar.bz2
+
+NETATALK_DEPENDENCIES = openssl berkeleydb libgcrypt libgpg-error
+NETATALK_CONF_ENV += CC="$(TARGET_CC) -std=gnu99"
+NETATALK_CONF_OPT += --with-cnid-cdb-backend \
+       --with-bdb=$(STAGING_DIR)/usr \
+       --disable-zeroconf \
+       --with-ssl-dir=$(STAGING_DIR)/usr \
+       --with-libgcrypt-dir=$(STAGING_DIR)/usr \
+       --with-shadow \
+       --disable-shell-check \
+       --without-pam
+
+ifeq ($(BR2_PACKAGE_CUPS),y)
+       NETATALK_DEPENDENCIES += cups
+       NETATALK_CONF_OPT += --enable-cups
+else
+       NETATALK_CONF_OPT += --disable-cups
+endif
+
+define NETATALK_INSTALL_EXTRA_FILES
+       [ -f $(TARGET_DIR)/etc/init.d/S50netatalk ] || \
+               $(INSTALL) -m 0755 -D package/netatalk/S50netatalk \
+                       $(TARGET_DIR)/etc/init.d/S50netatalk
+endef
+
+NETATALK_POST_INSTALL_TARGET_HOOKS += NETATALK_INSTALL_EXTRA_FILES
+
+$(eval $(call AUTOTARGETS))