[5/5] netatalk: New package

Message ID 20200424102812.16820-5-michael.tremer@ipfire.org
State Accepted
Commit 18d000c486fa6323a4ceca0319b00a873564c7e9
Headers
Series [1/5] BerkeleyDB: Update to 0.63 |

Commit Message

Michael Tremer April 24, 2020, 10:28 a.m. UTC
  This package adds a daemon for Apple's File Protocol

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 config/backup/includes/netatalk    |  2 +
 config/rootfiles/packages/netatalk | 99 ++++++++++++++++++++++++++++++
 lfs/netatalk                       | 98 +++++++++++++++++++++++++++++
 make.sh                            |  1 +
 src/initscripts/packages/netatalk  | 41 +++++++++++++
 src/paks/netatalk/install.sh       | 37 +++++++++++
 src/paks/netatalk/uninstall.sh     | 38 ++++++++++++
 src/paks/netatalk/update.sh        | 27 ++++++++
 8 files changed, 343 insertions(+)
 create mode 100644 config/backup/includes/netatalk
 create mode 100644 config/rootfiles/packages/netatalk
 create mode 100644 lfs/netatalk
 create mode 100644 src/initscripts/packages/netatalk
 create mode 100644 src/paks/netatalk/install.sh
 create mode 100644 src/paks/netatalk/uninstall.sh
 create mode 100644 src/paks/netatalk/update.sh
  

Patch

diff --git a/config/backup/includes/netatalk b/config/backup/includes/netatalk
new file mode 100644
index 000000000..c2262dc49
--- /dev/null
+++ b/config/backup/includes/netatalk
@@ -0,0 +1,2 @@ 
+/etc/afp.conf
+/etc/extmap.conf
diff --git a/config/rootfiles/packages/netatalk b/config/rootfiles/packages/netatalk
new file mode 100644
index 000000000..074ae442d
--- /dev/null
+++ b/config/rootfiles/packages/netatalk
@@ -0,0 +1,99 @@ 
+etc/afp.conf
+etc/dbus-session.conf
+etc/extmap.conf
+etc/pam.d/netatalk
+etc/rc.d/init.d/netatalk
+usr/bin/ad
+usr/bin/afpldaptest
+usr/bin/afppasswd
+usr/bin/afpstats
+usr/bin/apple_dump
+usr/bin/asip-status.pl
+usr/bin/cnid2_create
+usr/bin/dbd
+usr/bin/macusers
+#usr/bin/netatalk-config
+#usr/include/atalk
+#usr/include/atalk/acl.h
+#usr/include/atalk/adouble.h
+#usr/include/atalk/afp.h
+#usr/include/atalk/bstrlib.h
+#usr/include/atalk/cnid.h
+#usr/include/atalk/compat.h
+#usr/include/atalk/dictionary.h
+#usr/include/atalk/ea.h
+#usr/include/atalk/globals.h
+#usr/include/atalk/hash.h
+#usr/include/atalk/iniparser.h
+#usr/include/atalk/list.h
+#usr/include/atalk/logger.h
+#usr/include/atalk/netatalk_conf.h
+#usr/include/atalk/paths.h
+#usr/include/atalk/standards.h
+#usr/include/atalk/uam.h
+#usr/include/atalk/unicode.h
+#usr/include/atalk/unix.h
+#usr/include/atalk/util.h
+#usr/include/atalk/vfs.h
+#usr/include/atalk/volume.h
+#usr/lib/libatalk.a
+#usr/lib/libatalk.la
+#usr/lib/libatalk.so
+usr/lib/libatalk.so.18
+usr/lib/libatalk.so.18.0.0
+#usr/lib/netatalk
+#usr/lib/netatalk/uams_clrtxt.so
+usr/lib/netatalk/uams_dhx.so
+usr/lib/netatalk/uams_dhx2.so
+#usr/lib/netatalk/uams_dhx2_pam.a
+#usr/lib/netatalk/uams_dhx2_pam.la
+usr/lib/netatalk/uams_dhx2_pam.so
+#usr/lib/netatalk/uams_dhx2_passwd.a
+#usr/lib/netatalk/uams_dhx2_passwd.la
+usr/lib/netatalk/uams_dhx2_passwd.so
+#usr/lib/netatalk/uams_dhx_pam.a
+#usr/lib/netatalk/uams_dhx_pam.la
+usr/lib/netatalk/uams_dhx_pam.so
+#usr/lib/netatalk/uams_dhx_passwd.a
+#usr/lib/netatalk/uams_dhx_passwd.la
+usr/lib/netatalk/uams_dhx_passwd.so
+#usr/lib/netatalk/uams_guest.a
+#usr/lib/netatalk/uams_guest.la
+usr/lib/netatalk/uams_guest.so
+#usr/lib/netatalk/uams_pam.a
+#usr/lib/netatalk/uams_pam.la
+usr/lib/netatalk/uams_pam.so
+#usr/lib/netatalk/uams_passwd.a
+#usr/lib/netatalk/uams_passwd.la
+usr/lib/netatalk/uams_passwd.so
+#usr/lib/netatalk/uams_randnum.a
+#usr/lib/netatalk/uams_randnum.la
+usr/lib/netatalk/uams_randnum.so
+usr/sbin/afpd
+usr/sbin/cnid_dbd
+usr/sbin/cnid_metad
+usr/sbin/netatalk
+#usr/share/aclocal/netatalk.m4
+#usr/share/man/man1/ad.1
+#usr/share/man/man1/afpldaptest.1
+#usr/share/man/man1/afppasswd.1
+#usr/share/man/man1/afpstats.1
+#usr/share/man/man1/apple_dump.1
+#usr/share/man/man1/asip-status.pl.1
+#usr/share/man/man1/dbd.1
+#usr/share/man/man1/macusers.1
+#usr/share/man/man1/netatalk-config.1
+#usr/share/man/man1/uniconv.1
+#usr/share/man/man5/afp.conf.5
+#usr/share/man/man5/afp_signature.conf.5
+#usr/share/man/man5/afp_voluuid.conf.5
+#usr/share/man/man5/extmap.conf.5
+#usr/share/man/man8/afpd.8
+#usr/share/man/man8/cnid_dbd.8
+#usr/share/man/man8/cnid_metad.8
+#usr/share/man/man8/netatalk.8
+var/ipfire/backup/addons/includes/netatalk
+var/state/netatalk
+#var/state/netatalk/CNID
+#var/state/netatalk/CNID/README
+#var/state/netatalk/README
diff --git a/lfs/netatalk b/lfs/netatalk
new file mode 100644
index 000000000..09107e2e8
--- /dev/null
+++ b/lfs/netatalk
@@ -0,0 +1,98 @@ 
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007-2018  IPFire Team  <info@ipfire.org>                     #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 3.1.12
+
+THISAPP    = netatalk-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = netatalk
+PAK_VER    = 1
+
+DEPS       = avahi dbus
+
+CFLAGS    += -Wno-unused-result
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 5aea4b1765171b8d2d240cf265d84171
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+	@$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+	@$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+	@$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+	@$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+	@$(PREBUILD)
+	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && ./configure \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--localstatedir=/var/state \
+		--without-libevent
+	cd $(DIR_APP) && make $(MAKETUNING)
+	cd $(DIR_APP) && make install
+
+	# Backup
+	install -v -m 644 $(DIR_SRC)/config/backup/includes/netatalk \
+		/var/ipfire/backup/addons/includes/netatalk
+
+	# Install initscript
+	$(call INSTALL_INITSCRIPT,netatalk)
+
+	@rm -rf $(DIR_APP)
+	@$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 9f05ee8ce..d1db51531 100755
--- a/make.sh
+++ b/make.sh
@@ -1408,6 +1408,7 @@  buildipfire() {
   lfsmake2 cifs-utils
   lfsmake2 krb5
   lfsmake2 samba
+  lfsmake2 netatalk
   lfsmake2 sudo
   lfsmake2 mc
   lfsmake2 wget
diff --git a/src/initscripts/packages/netatalk b/src/initscripts/packages/netatalk
new file mode 100644
index 000000000..c0e0771df
--- /dev/null
+++ b/src/initscripts/packages/netatalk
@@ -0,0 +1,41 @@ 
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/netatalk
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+	start)
+		boot_mesg "Starting Netatalk AFP File Server..."
+		loadproc /usr/sbin/netatalk
+		;;
+
+	stop)
+		boot_mesg "Stopping Netatalk AFP File Server..."
+		killproc /usr/sbin/netatalk
+		;;
+
+	reload)
+		boot_mesg "Reloading Netatalk AFP File Server..."
+		reloadproc /usr/sbin/netatalk
+		;;
+
+	restart)
+		${0} stop
+		sleep 1
+		${0} start
+		;;
+
+	status)
+		statusproc /usr/sbin/netatalk
+		;;
+
+	*)
+		echo "Usage: ${0} {start|stop|reload|restart|status}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/netatalk
diff --git a/src/paks/netatalk/install.sh b/src/paks/netatalk/install.sh
new file mode 100644
index 000000000..dd32da1eb
--- /dev/null
+++ b/src/paks/netatalk/install.sh
@@ -0,0 +1,37 @@ 
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+
+# Extract everything
+extract_files
+
+# Restore backup
+restore_backup "${NAME}"
+
+# Enable auto-start for service
+ln -sf  ../init.d/netatalk /etc/rc.d/rc0.d/K25netatalk
+ln -sf  ../init.d/netatalk /etc/rc.d/rc3.d/S35netatalk
+ln -sf  ../init.d/netatalk /etc/rc.d/rc6.d/K25netatalk
+
+exit 0
diff --git a/src/paks/netatalk/uninstall.sh b/src/paks/netatalk/uninstall.sh
new file mode 100644
index 000000000..a1e1f8ea0
--- /dev/null
+++ b/src/paks/netatalk/uninstall.sh
@@ -0,0 +1,38 @@ 
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+
+# Stop the service
+service_stop "${NAME}"
+
+# Create a backup
+make_backup "${NAME}"
+
+# Delete all program files
+remove_files
+
+# Disable auto-start
+rm -vf /etc/rc.d/rc*.d/*netatalk
+
+exit 0
diff --git a/src/paks/netatalk/update.sh b/src/paks/netatalk/update.sh
new file mode 100644
index 000000000..99776659c
--- /dev/null
+++ b/src/paks/netatalk/update.sh
@@ -0,0 +1,27 @@ 
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 2 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2007-2020 IPFire-Team <info@ipfire.org>.                   #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+extract_backup_includes
+./uninstall.sh
+./install.sh