From patchwork Fri Apr 24 10:28:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3001 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 497r3y4ffJz3yCd for ; Fri, 24 Apr 2020 10:28:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 497r3x373Wz2MD; Fri, 24 Apr 2020 10:28:29 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 497r3w706pz30GN; Fri, 24 Apr 2020 10:28:28 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 497r3v02kNz30Fy for ; Fri, 24 Apr 2020 10:28:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 497r3t4cW3z28f; Fri, 24 Apr 2020 10:28:26 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1587724106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y69SiaaVn4wpi/y/a9SurCUGy4hST4XrTrpgAdQUnYg=; b=8g9fv3h/eJKYXSBffkXpTAM+iapvTiBQAnKEIDXp8Mpwnw3aWGgpmrBygunDtCBscDU5Ce AnMxqYYRe6/pleAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1587724106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y69SiaaVn4wpi/y/a9SurCUGy4hST4XrTrpgAdQUnYg=; b=ghnqDcq9Mc81XRj8v0zJ8Fy2sN57niQTG0DKlQIkSoPnT3Pu3LWu1fwMsXPtXvlCZegG+/ /ms+y2nRqDCW7ml+lK2vJAJjpfxW6nMytCL3lqgmqTShqodFIbpWrhbpa4emkYSC01D3tp W+p4LcrgB1VVkl8FSBAc7sWA5FZ8DkXMMwkHgUSHq/zUPcwggb/hHgW6inISFAgrV1u7xQ DDXeAqVXk0UVhu1FT5vG1nFWlvkhykKoXA+8sY2nUHLCL7mucOdM1LM2eZnrXHfBJ5sddT mGzWIsaA8StxkuqluTk/lNGJ8cbh5mV9Fg9PlvrTQryAuxgt/36DfeBYcKhGsQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 5/5] netatalk: New package Date: Fri, 24 Apr 2020 10:28:12 +0000 Message-Id: <20200424102812.16820-5-michael.tremer@ipfire.org> In-Reply-To: <20200424102812.16820-1-michael.tremer@ipfire.org> References: <20200424102812.16820-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This package adds a daemon for Apple's File Protocol Signed-off-by: Michael Tremer --- 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 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 # +# # +# 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 . # +# # +############################################################################### + +############################################################################### +# 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 . # +# # +############################################################################ +# +. /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 . # +# # +############################################################################ +# +. /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 . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh