summaryrefslogtreecommitdiff
path: root/recipes/netatalk
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/netatalk')
-rw-r--r--recipes/netatalk/files/init103
-rw-r--r--recipes/netatalk/files/netatalk.conf44
-rw-r--r--recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-db43.patch32
-rw-r--r--recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-newerdb.patch28
-rw-r--r--recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-setXid.patch14
-rw-r--r--recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-xfs.patch22
-rw-r--r--recipes/netatalk/netatalk_2.0.3.bb46
7 files changed, 289 insertions, 0 deletions
diff --git a/recipes/netatalk/files/init b/recipes/netatalk/files/init
new file mode 100644
index 0000000000..380cc49e16
--- /dev/null
+++ b/recipes/netatalk/files/init
@@ -0,0 +1,103 @@
+#!/bin/sh
+
+atalk_startup () {
+ if [ "${ATALKD_RUN}" != "no" ]; then
+ echo "Starting atalkd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/atalkd
+
+ for reg in \
+ "${ATALK_NAME}:Workstation${ATALK_ZONE}" \
+ "${ATALK_NAME}:netatalk${ATALK_ZONE}"
+ do
+ echo " Registering $reg"
+ /usr/bin/nbprgstr "$reg"
+ done
+
+ if [ "${PAPD_RUN}" = "yes" ]; then
+ echo " Starting papd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/papd
+ fi
+
+ fi
+
+ if [ "${CNID_METAD_RUN}" = "yes" ] ; then
+ echo "Starting cnid_metad"
+ start-stop-daemon --start --quiet --exec /usr/sbin/cnid_metad
+ fi
+
+
+ if [ "${AFPD_RUN}" = "yes" ]; then
+ echo "Starting afpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/afpd -- \
+ ${AFPD_UAMLIST} -g ${AFPD_GUEST} -c ${AFPD_MAX_CLIENTS} \
+ -n "${ATALK_NAME}${ATALK_ZONE}"
+ fi
+
+ if [ "${TIMELORD_RUN}" = "yes" ]; then
+ echo "Starting timelord"
+ start-stop-daemon --start --quiet --exec /usr/sbin/timelord
+ fi
+}
+
+start_netatalk () {
+ . /etc/netatalk/netatalk.conf
+
+ if [ x"${ATALK_BGROUND}" = x"yes" ]; then
+ echo "Starting netatalk in the background ... "
+ atalk_startup >& /dev/null &
+ else
+ atalk_startup
+ fi
+}
+
+stop_netatalk () {
+ . /etc/netatalk/netatalk.conf
+
+ if [ "${AFPD_RUN}" = "yes" ]; then
+ echo "Stopping afpd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/afpd
+ fi
+
+ if [ "${TIMELORD_RUN}" = "yes" ]; then
+ echo "Stopping timelord"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/timelord
+ fi
+
+ if [ "${ATALKD_RUN}" != "no" ]; then
+ if [ "${PAPD_RUN}" = "yes" ]; then
+ echo "Stopping papd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/papd
+ fi
+
+ for reg in \
+ "${ATALK_NAME}:Workstation${ATALK_ZONE}" \
+ "${ATALK_NAME}:netatalk${ATALK_ZONE}"
+ do
+ echo "Unregistering $reg"
+ /usr/bin/nbpunrgstr "$reg"
+ done
+
+ echo "Stopping atalkd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/atalkd
+ fi
+
+ if [ "${CNID_METAD_RUN}" = "yes" ] ; then
+ echo "Stopping cnid_metad"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/cnid_metad
+ fi
+}
+
+case "$1" in
+ start)
+ start_netatalk
+ ;;
+ stop)
+ stop_netatalk
+ ;;
+ *)
+ echo "Usage: {start|stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/netatalk/files/netatalk.conf b/recipes/netatalk/files/netatalk.conf
new file mode 100644
index 0000000000..dc0efbc249
--- /dev/null
+++ b/recipes/netatalk/files/netatalk.conf
@@ -0,0 +1,44 @@
+# Appletalk configuration
+# Change this to increase the maximum number of clients that can connect:
+AFPD_MAX_CLIENTS=50
+
+# Change this to set the machine's atalk name and zone, the latter containing
+# the '@' sign as first character -- compare with nbp_name(3) if in doubt
+#
+# NOTE: If Netatalk should register AppleTalk services in the standard zone
+# then you need not to specify a zone name here.
+#
+# If your zone has spaces in it, you're better off specifying
+# it in afpd.conf if you realize that your distribution doesn't
+# handle spaces correctly in the startup script. Remember to use
+# quotes here if the zone name contains spaces.
+#
+#ATALK_ZONE="@some zone"
+ATALK_NAME=`echo ${HOSTNAME}|cut -d. -f1`
+
+# specify the Mac and unix charsets to be used
+ATALK_MAC_CHARSET='MAC_ROMAN'
+ATALK_UNIX_CHARSET='LOCALE'
+
+# specify this if you don't want guest, clrtxt, and dhx
+# available options: uams_guest.so, uams_clrtxt.so, uams_dhx.so,
+# uams_randnum.so
+#AFPD_UAMLIST="-U uams_clrtxt.so,uams_dhx.so"
+
+# Change this to set the id of the guest user
+AFPD_GUEST=nobody
+
+# Set which daemons to run (papd is dependent upon atalkd):
+ATALKD_RUN=no
+PAPD_RUN=yes
+CNID_METAD_RUN=yes
+AFPD_RUN=yes
+TIMELORD_RUN=no
+A2BOOT_RUN=no
+
+# Control whether the daemons are started in the background
+ATALK_BGROUND=no
+
+# export the charsets, read form ENV by apps
+export ATALK_MAC_CHARSET
+export ATALK_UNIX_CHARSET
diff --git a/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-db43.patch b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-db43.patch
new file mode 100644
index 0000000000..93d3e4b9ea
--- /dev/null
+++ b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-db43.patch
@@ -0,0 +1,32 @@
+Index: netatalk-2.0.3/bin/cnid/cnid_index.c
+===================================================================
+--- netatalk-2.0.3.orig/bin/cnid/cnid_index.c
++++ netatalk-2.0.3/bin/cnid/cnid_index.c
+@@ -274,7 +274,11 @@ static int dbif_count(const int dbi, u_i
+ DB_BTREE_STAT *sp;
+ DB *db = db_table[dbi].db;
+
++#if DB_VERSION_MAJOR > 4 || ( DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3 )
++ ret = db->stat(db, db_txn, &sp, 0);
++#else
+ ret = db->stat(db, &sp, 0);
++#endif
+
+ if (ret) {
+ LOG(log_error, logtype_cnid, "error getting stat infotmation on database: %s", db_strerror(errno));
+Index: netatalk-2.0.3/etc/cnid_dbd/dbif.c
+===================================================================
+--- netatalk-2.0.3.orig/etc/cnid_dbd/dbif.c
++++ netatalk-2.0.3/etc/cnid_dbd/dbif.c
+@@ -514,7 +514,11 @@ int dbif_count(const int dbi, u_int32_t
+ DB_BTREE_STAT *sp;
+ DB *db = db_table[dbi].db;
+
++#if DB_VERSION_MAJOR > 4 || ( DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3 )
++ ret = db->stat(db, db_txn, &sp, 0);
++#else
+ ret = db->stat(db, &sp, 0);
++#endif
+
+ if (ret) {
+ LOG(log_error, logtype_cnid, "error getting stat infotmation on database: %s", db_strerror(errno));
diff --git a/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-newerdb.patch b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-newerdb.patch
new file mode 100644
index 0000000000..f64c8cf5eb
--- /dev/null
+++ b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-newerdb.patch
@@ -0,0 +1,28 @@
+Index: netatalk-2.0.3/macros/db3-check.m4
+===================================================================
+--- netatalk-2.0.3.orig/macros/db3-check.m4
++++ netatalk-2.0.3/macros/db3-check.m4
+@@ -115,6 +115,14 @@ int main(void) {
+ AC_DEFUN([NETATALK_BERKELEY_LINK],
+ [
+ atalk_cv_lib_db=no
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db_4_dot_4,[-ldb-4.4])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db44,[-ldb44])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db_44,[-ldb-44])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db_4_4,[-ldb-4-4])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db_4_dot_3,[-ldb-4.3])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db43,[-ldb43])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db_43,[-ldb-43])
++NETATALK_BDB_LINK_TRY(atalk_cv_db_db_4_3,[-ldb-4-3])
+ NETATALK_BDB_LINK_TRY(atalk_cv_db_db_4_dot_2,[-ldb-4.2])
+ NETATALK_BDB_LINK_TRY(atalk_cv_db_db42,[-ldb42])
+ NETATALK_BDB_LINK_TRY(atalk_cv_db_db_42,[-ldb-42])
+@@ -134,7 +142,7 @@ AC_DEFUN([AC_PATH_BDB],
+ trybdbdir=""
+ dobdbsearch=yes
+ bdb_search_dirs="/usr/local/include /usr/include"
+- search_subdirs="/db4.2 /db42 /db4.1 /db41 /db4 /"
++ search_subdirs="/db4.4 /db44 /db4.3 /db43 /db4.2 /db42 /db4.1 /db41 /db4 /"
+
+ dnl required BDB version
+ DB_MAJOR_REQ=4
diff --git a/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-setXid.patch b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-setXid.patch
new file mode 100644
index 0000000000..70170c134d
--- /dev/null
+++ b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-setXid.patch
@@ -0,0 +1,14 @@
+Index: netatalk-2.0.3/bin/afppasswd/Makefile.am
+===================================================================
+--- netatalk-2.0.3.orig/bin/afppasswd/Makefile.am
++++ netatalk-2.0.3/bin/afppasswd/Makefile.am
+@@ -12,7 +12,8 @@ afppasswd_SOURCES = afppasswd.c
+ afppasswd_LDADD = $(top_builddir)/libatalk/libatalk.la @SSL_LIBS@
+
+ CFLAGS = @CFLAGS@ @SSL_CFLAGS@ -I$(top_srcdir)/sys \
+- -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\"
++ -D_PATH_AFPDPWFILE=\"$(pkgconfdir)/afppasswd\" \
++ @BINDNOW_FLAGS@
+
+ install-exec-hook:
+ if USE_DHX
diff --git a/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-xfs.patch b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-xfs.patch
new file mode 100644
index 0000000000..e91ebcebd2
--- /dev/null
+++ b/recipes/netatalk/netatalk-2.0.3/netatalk-2.0.3-xfs.patch
@@ -0,0 +1,22 @@
+Index: netatalk-2.0.3/configure.in
+===================================================================
+--- netatalk-2.0.3.orig/configure.in
++++ netatalk-2.0.3/configure.in
+@@ -694,12 +694,16 @@ fi
+ # AC_MSG_RESULT([enabling quotactl wrapper])
+ # )
+
++AC_ARG_WITH([xfs],
++ AS_HELP_STRING([--without-xfs], [Build without XFS filesystem quota support]))
++
++if test "x$with_xfs" != "xno"; then
+ # For quotas on Linux XFS filesystems
+ AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
+ AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)
+ # For linux > 2.5.56
+ AC_CHECK_HEADERS(linux/dqblk_xfs.h)
+-
++fi
+
+ dnl ----- as far as I can tell, dbtob always does the wrong thing
+ dnl ----- on every single version of linux I've ever played with.
diff --git a/recipes/netatalk/netatalk_2.0.3.bb b/recipes/netatalk/netatalk_2.0.3.bb
new file mode 100644
index 0000000000..0ed580d6f1
--- /dev/null
+++ b/recipes/netatalk/netatalk_2.0.3.bb
@@ -0,0 +1,46 @@
+SECTION = "net"
+PR = "r1"
+LICENSE = "GPL"
+
+DEPENDS = "cups db openssl"
+
+SRC_URI = "http://ovh.dl.sourceforge.net/sourceforge/netatalk/netatalk-${PV}.tar.gz \
+ file://netatalk-2.0.3-db43.patch;patch=1 \
+ file://netatalk-2.0.3-newerdb.patch;patch=1 \
+ file://netatalk-2.0.3-xfs.patch;patch=1 \
+ file://netatalk.conf \
+ file://init"
+
+inherit autotools update-rc.d
+
+INITSCRIPT_NAME = "atalk"
+INITSCRIPT_PARAMS = "defaults 65"
+
+PACKAGES = "${PN}-atalkd ${PN}-pap ${PN}-timelord ${PN}-dbg ${PN} ${PN}-doc ${PN}-dev"
+
+RRECOMMENDS_${PN}-atalkd = "kernel-module-appletalk"
+
+FILES_${PN}-atalkd += "${sysconfdir}/netatalk/atalkd.conf \
+ /usr/sbin/atalkd"
+FILES_${PN}-pap += "/usr/bin/pap \
+ ${sysconfdir}/netatalk/papd.conf \
+ /usr/sbin/papd \
+ /usr/bin/papstatus"
+FILES_${PN}-timelord += "/usr/sbin/timelord"
+FILES_${PN}-dbg += "${sysconfdir}/netatalk/uams/.debug"
+
+EXTRA_OECONF += "ac_cv_path_KRB5_CONFIG=no \
+ ac_cv_header_rpcsvc_rquota_h=no \
+ --with-bdb=${STAGING_DIR_TARGET}${layout_exec_prefix} \
+ --enable-timelord \
+ --without-shadow \
+ --enable-static=no \
+ --disable-srvloc \
+ --without-pam \
+ --with-ssl-dir=${STAGING_DIR_TARGET}${layout_exec_prefix}"
+LDFLAGS += "-lpthread -L${STAGING_LIBDIR}"
+
+do_install_append() {
+ install -D -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/atalk
+ install -D -m 0644 ${WORKDIR}/netatalk.conf ${D}${sysconfdir}/netatalk/netatalk.conf
+}