Subject: [alpine-devel] [PATCH 1/2] Initial commit of Netatalk Version 3.0.1

From: Oliver Loch <[email-masked]>
Date: Sun, 28 Oct 2012 21:21:53 +0100

---
 main/netatalk/APKBUILD              | 80 +++++++++++++++++++++++++++++++++++++
 main/netatalk/netatalk.confd        |  7 ++++
 main/netatalk/netatalk.initd        | 28 +++++++++++++
 main/netatalk/netatalk.post-install | 42 +++++++++++++++++++
 main/netatalk/netatalk.pre-install  |  4 ++
 5 files changed, 161 insertions(+)
 create mode 100644 main/netatalk/APKBUILD
 create mode 100644 main/netatalk/netatalk.confd
 create mode 100644 main/netatalk/netatalk.initd
 create mode 100644 main/netatalk/netatalk.post-install
 create mode 100644 main/netatalk/netatalk.pre-install

diff --git a/main/netatalk/APKBUILD b/main/netatalk/APKBUILD
new file mode 100644
index 0000000..241d6f0
--- /dev/null
+++ b/main/netatalk/APKBUILD
@@ -0,0 +1,80 @@
+# Contributor: Oliver Loch <[email-masked]>
+# Maintainer:
+pkgname=netatalk
+pkgver=3.0.1
+pkgrel=1
+pkgdesc="High performance, super stable AFP Fileserver for Macintosh Computers"
+url="http://netatalk.sourceforge.net"
+arch="all"
+license="GPL2"
+depends="dbus libintl libattr readline sqlite-libs dbus-libs avahi-libs avahi libsasl libevent libgssglue heimdal"
+depends_dev="libiconv-dev db-dev dbus-dev readline-dev avahi-dev libdaemon-dev libevent-dev libgssglue-dev heimdal-dev $depends"
+# depends_dev="libiconv-dev libintl-dev db-dev dbus-dev py-dbus-dev libcddb-dev gdbm-dev unixodbc-dev eggdbus-dev dbus-glib-dev readline-dev avahi-dev libgpg-error-dev libsasl-dev 
+# depends_dev=""
+makedepends="$depends_dev"
+install="$pkgname.pre-install $pkgname.post-install"
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://downloads.sourceforge.net/project/netatalk/netatalk/3.0.1/netatalk-3.0.1.tar.bz2
+	http://sourceforge.net/p/netatalk/bugs/459/attachment/bundled-libevent.patch
+	netatalk.initd
+	netatalk.confd
+	"
+options="libtool"
+
+_builddir="$srcdir"/"$pkgname"-"$pkgver"
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+			*.patch) _filename="$(basename "${i}")"; msg $_filename; patch -p1 -i "$srcdir"/$_filename || return 1;;
+		esac
+	done
+}
+
+build() {
+	export CPPFLAGS="-I /usr/include/"
+	export LDFLAGS="-levent"
+	cd "$_builddir"
+	./configure \
+	--prefix=/usr \
+	--bindir=/usr/bin \
+	--sbindir=/usr/sbin \
+	--sysconfdir=/etc \
+	--localstatedir=/var \
+	--mandir=/usr/share/man \
+	--infodir=/usr/share/info \
+	--enable-quota \
+	--enable-zeroconf \
+	--enable-krbV-uam \
+	--enable-overwrite \
+	--disable-bundled-libevent \
+	--enable-fhs \
+	--with-pam=no \
+	--with-kerberos \
+	--with-libevent-header=/usr/include/ \
+	--with-libevent-lib=/usr/lib/ \
+		|| return 1
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install || return 1
+	[ ! -d "$pkgdir/usr/" ] && mkdir "$pkgdir/usr/"
+	[ ! -d "$pkgdir/etc/netatalk/" ] && mkdir "$pkgdir/etc/netatalk/"
+	[ -d "$pkgdir/sbin/" ] && mv "$pkgdir/sbin/" "$pkgdir/usr/sbin/"
+	[ -d "$pkgdir/bin/" ] && mv "$pkgdir/bin/" "$pkgdir/usr/bin/"
+	[ -d "$pkgdir/lib/" ] && mv "$pkgdir/lib/" "$pkgdir/usr/lib/"
+	[ -f "$pkgdir/etc/afp.conf" ] && mv "$pkgdir/etc/afp.conf" "$pkgdir/etc/netatalk/afp.conf"	
+
+	install -m755 -D "$srcdir"/$pkgname.initd \
+		"$pkgdir"/etc/init.d/$pkgname || return 1
+	install -m644 -D "$srcdir"/$pkgname.confd \
+		"$pkgdir"/etc/conf.d/$pkgname || return 1
+}
+
+md5sums="b4f5c932b2ca99f5292bd6b6d69b3ebc  netatalk-3.0.1.tar.bz2
+862c94ef061911f5ace94665a070a939  bundled-libevent.patch
+c71bb49dda54fbc15fe9551f9052b3f9  netatalk.initd
+d4dd129f376ac2e75329f9faeaa11a59  netatalk.confd"
diff --git a/main/netatalk/netatalk.confd b/main/netatalk/netatalk.confd
new file mode 100644
index 0000000..e701df8
--- /dev/null
+++ b/main/netatalk/netatalk.confd
@@ -0,0 +1,7 @@
+# Sample conf.d file for alpine linux
+
+#
+# Specify daemon options here.
+#
+ADDITIONAL_OPTIONS="-F /etc/netatalk/afpd.conf"
+
diff --git a/main/netatalk/netatalk.initd b/main/netatalk/netatalk.initd
new file mode 100644
index 0000000..bf3019f
--- /dev/null
+++ b/main/netatalk/netatalk.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+
+# Sample init.d file for alpine linux.
+
+name=netatalk
+daemon=/usr/sbin/netatalk
+
+depend() {
+	need net dbus avahi-daemon
+	after firewall
+}
+
+start() {
+	ebegin "Starting ${name}"
+		start-stop-daemon --start --quiet \
+			--pidfile /var/run/${name}.pid \
+			--exec ${daemon} -- ${ADDITIONAL_OPTIONS}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping ${name}"
+		start-stop-daemon --stop --quiet \
+			--pidfile /var/run/$name.pid \
+			--exec ${daemon}
+	eend $?
+}
+
diff --git a/main/netatalk/netatalk.post-install b/main/netatalk/netatalk.post-install
new file mode 100644
index 0000000..3438aca
--- /dev/null
+++ b/main/netatalk/netatalk.post-install
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# get some environment settings - helpers
+
+_HOSTNAME=$(uname -n)
+
+generate_example_config() {
+
+	echo "; Netatalk 3.x configuration file."
+	echo "; Syntax now follows the Samba syntax."
+	echo "; This is an example, to help you set netatalk up."
+	echo ""
+	echo "[Global]"
+	[ "${_HOSTNAME}x" != "x" ] && echo "hostname = ${_HOSTNAME}"
+	echo "advertise ssh = no"
+	echo "; afp listen = 127.0.0.1, ::1"
+	echo "uam path = /usr/lib/netatalk/"
+	echo "uam list = uams_dhx.so, uams_dhx2.so"
+	echo "log file = /var/log/netatalk.log"
+	echo "; log level = default:maxdebug, afpdaemon:maxdebug, logger:maxdebug, uamsdaemon:maxdebug"
+	echo "zeroconf = yes"
+	echo "admin group = root"
+	echo "unix charset = iso-8859-15"
+	echo ""
+	echo "; Example share for a folder."
+	echo "[srv]"
+	echo "path = /srv"
+	echo "valid users = root"
+	echo ""
+	echo "; Example share to use with Apple's TimeMachine"
+	echo ";[TimeMachine]"
+	echo ";path = /srv/timemachine"
+	echo ";valid users = root"
+	echo ";time machine = yes"
+	echo ";vol size limit = 409600"
+	echo ""
+
+	return 0;
+}
+
+generate_example_config > /etc/netatalk/afp.conf
+
diff --git a/main/netatalk/netatalk.pre-install b/main/netatalk/netatalk.pre-install
new file mode 100644
index 0000000..46079e0
--- /dev/null
+++ b/main/netatalk/netatalk.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# add something which happends before install
+
-- 
1.8.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Oliver Loch <[email-masked]>
Date: Sun, 28 Oct 2012 21:21:54 +0100

---
 main/netatalk/APKBUILD | 2 --
 1 file changed, 2 deletions(-)

diff --git a/main/netatalk/APKBUILD b/main/netatalk/APKBUILD
index 241d6f0..6c160a9 100644
--- a/main/netatalk/APKBUILD
+++ b/main/netatalk/APKBUILD
@@ -9,8 +9,6 @@ arch="all"
 license="GPL2"
 depends="dbus libintl libattr readline sqlite-libs dbus-libs avahi-libs avahi libsasl libevent libgssglue heimdal"
 depends_dev="libiconv-dev db-dev dbus-dev readline-dev avahi-dev libdaemon-dev libevent-dev libgssglue-dev heimdal-dev $depends"
-# depends_dev="libiconv-dev libintl-dev db-dev dbus-dev py-dbus-dev libcddb-dev gdbm-dev unixodbc-dev eggdbus-dev dbus-glib-dev readline-dev avahi-dev libgpg-error-dev libsasl-dev 
-# depends_dev=""
 makedepends="$depends_dev"
 install="$pkgname.pre-install $pkgname.post-install"
 subpackages="$pkgname-dev $pkgname-doc"
-- 
1.8.0

---