From d954f6d4cf38909264a861af73b57a0cff7bc03f Mon Sep 17 00:00:00 2001 From: apccv Date: Thu, 23 May 2024 10:02:48 -0400 Subject: [PATCH] Reinstate netatalk package with updated code base. --- net/netatalk/Makefile | 98 +++++++++++++++++++ net/netatalk/files/afpd.init | 23 +++++ .../patches/001-automake-compat.patch | 9 ++ .../patches/002-ld_library_path.patch | 26 +++++ net/netatalk/patches/101-hack.patch | 14 +++ 5 files changed, 170 insertions(+) create mode 100644 net/netatalk/Makefile create mode 100644 net/netatalk/files/afpd.init create mode 100644 net/netatalk/patches/001-automake-compat.patch create mode 100644 net/netatalk/patches/002-ld_library_path.patch create mode 100644 net/netatalk/patches/101-hack.patch diff --git a/net/netatalk/Makefile b/net/netatalk/Makefile new file mode 100644 index 0000000000000..794d744efe293 --- /dev/null +++ b/net/netatalk/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2009-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=netatalk +PKG_VERSION:=3.1.18 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/netatalk +PKG_HASH:=86d209dc7776a4ba17845164d2e376a469cee376a27b18ae31898e3f4ba41655 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +PKG_CPE_ID:=cpe:/a:netatalk:netatalk + +PKG_BUILD_DEPENDS:=libevent2 + +include $(INCLUDE_DIR)/package.mk + +define Package/netatalk + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS:=+libattr +libdb47 +libgcrypt +libopenssl +libevent2 + TITLE:=netatalk + URL:=http://netatalk.sourceforge.net + MAINTAINER:=Antonio Pastor <3aipdck5@duck.com> +endef + +define Package/netatalk/decription + Netatalk is a freely-available Open Source AFP fileserver. + It also provides a kernel level implementation of the AppleTalk + Protocol Suite. +endef + +TARGET_CFLAGS += -std=gnu99 + +CONFIGURE_ARGS += \ + --disable-afs \ + --disable-hfs \ + --enable-debugging \ + --disable-shell-check \ + --disable-timelord \ + --disable-a2boot \ + --disable-cups \ + --disable-tcp-wrappers \ + --with-cnid-default-backend=dbd \ + --with-bdb="$(STAGING_DIR)/usr/" \ + --with-libevent=no \ + --with-libgcrypt-dir="$(STAGING_DIR)/usr" \ + --with-ssl-dir="$(STAGING_DIR)/usr" \ + --with-uams-path="/usr/lib/uams" \ + --without-acls \ + --without-kerberos \ + --without-mysql \ + --with-mysql-config=false \ + --without-pam \ + --disable-admin-group \ + --disable-srvloc \ + --disable-zeroconf \ + $(if $(CONFIG_SHADOW_PASSWORDS),--with-shadow,--without-shadow) \ + --without-dtrace \ + --without-ldap + +define Package/netatalk/conffiles +/etc/afp.conf +/etc/extmap.conf +/etc/netatalk/ +endef + +define Package/netatalk/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/lib/uams + $(INSTALL_DIR) $(1)/etc/init.d + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libatalk.so* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/bin/dbd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ad $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/afppasswd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/afpd $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/afp.conf $(1)/etc/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/extmap.conf $(1)/etc/ + $(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd +endef + +$(eval $(call BuildPackage,netatalk)) diff --git a/net/netatalk/files/afpd.init b/net/netatalk/files/afpd.init new file mode 100644 index 0000000000000..8fab349e31d3c --- /dev/null +++ b/net/netatalk/files/afpd.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2012 OpenWrt.org + +START=80 +STOP=10 + +USE_PROCD=1 + +start_service() { + mkdir -p /var/netatalk/CNID/ + + procd_open_instance + procd_set_param command /usr/sbin/afpd -d -F /etc/afp.conf + procd_set_param file /etc/afp.conf + procd_set_param respawn + procd_close_instance + + procd_open_instance + procd_set_param command /usr/sbin/cnid_metad -d + procd_set_param respawn + procd_close_instance +} + diff --git a/net/netatalk/patches/001-automake-compat.patch b/net/netatalk/patches/001-automake-compat.patch new file mode 100644 index 0000000000000..28c107a35ea6d --- /dev/null +++ b/net/netatalk/patches/001-automake-compat.patch @@ -0,0 +1,9 @@ +--- a/macros/iconv.m4 ++++ b/macros/iconv.m4 +@@ -115,6 +115,5 @@ int main() { + + CFLAGS="$savedcflags" + LDFLAGS="$savedldflags" +- CPPFLAGS="$saved_CPPFLAGS" + + ]) diff --git a/net/netatalk/patches/002-ld_library_path.patch b/net/netatalk/patches/002-ld_library_path.patch new file mode 100644 index 0000000000000..fc7b343663d43 --- /dev/null +++ b/net/netatalk/patches/002-ld_library_path.patch @@ -0,0 +1,26 @@ +--- a/macros/db3-check.m4 ++++ b/macros/db3-check.m4 +@@ -141,9 +141,9 @@ if test "x$bdb_required" = "xyes"; then + dnl -- LD_LIBRARY_PATH on many platforms. This will be fairly + dnl -- portable hopefully. Reference: + dnl -- http://lists.gnu.org/archive/html/autoconf/2009-03/msg00040.html +- test "$cross_compiling" = yes || eval export $shlibpath_var=$bdblibdir ++# test "$cross_compiling" = yes || eval export $shlibpath_var=$bdblibdir + NETATALK_BDB_TRY_LINK +- eval export $shlibpath_var=$saved_shlibpath_var ++# eval export $shlibpath_var=$saved_shlibpath_var + + if test x"${atalk_cv_bdb_version}" = x"yes"; then + BDB_CFLAGS="-I${bdbdir}/include${subdir}" +@@ -170,9 +170,9 @@ if test "x$bdb_required" = "xyes"; then + CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" + LDFLAGS="-L$bdblibdir $LDFLAGS" + +- test "$cross_compiling" = yes || eval export $shlibpath_var=$bdblibdir ++# test "$cross_compiling" = yes || eval export $shlibpath_var=$bdblibdir + NETATALK_BDB_TRY_LINK +- eval export $shlibpath_var=$saved_shlibpath_var ++# eval export $shlibpath_var=$saved_shlibpath_var + + if test x"${atalk_cv_bdb_version}" = x"yes"; then + BDB_CFLAGS="-I${bdbdir}/include${subdir}" diff --git a/net/netatalk/patches/101-hack.patch b/net/netatalk/patches/101-hack.patch new file mode 100644 index 0000000000000..b35e86f4c583d --- /dev/null +++ b/net/netatalk/patches/101-hack.patch @@ -0,0 +1,14 @@ +--- a/libatalk/adouble/ad_open.c ++++ b/libatalk/adouble/ad_open.c +@@ -1284,7 +1284,10 @@ + /* It doesnt exist, EPERM or another error */ + if (!(errno == ENOATTR || errno == ENOENT)) { + LOG(log_error, logtype_ad, "ad_open_hf_ea: unexpected: %s", strerror(errno)); ++ /* OpenWrt ends up with EINVAL at this point, no clue why. Log it but keep going. */ ++ if (errno != EINVAL) { ++ EC_FAIL; ++ } +- EC_FAIL; + } + + /* Create one */