aur/netatalk to 2.2.2-3

This commit is contained in:
Kevin Mihelich 2012-04-15 12:58:08 -04:00
parent 088cfc5e74
commit c6f822de21
12 changed files with 439 additions and 195 deletions

View file

@ -1,51 +1,71 @@
# Maintainer: Andrea Crotti <mail andrea dot crotti dot 0 at gmail dot com>
# Maintainer: SJ_UnderWater
# Based on netatalk package :
# Maintainer: Dominik Dingel <mail at wodar dot de>
# Contributor: William Udovich <nerdzrule7 at earthlink dot net>
# Contributor: Farhan Yousaf <farhany at xaviya dot com>
plugrel=1
pkgname=netatalk
pkgbase=netatalk
pkgname=('netatalk' 'netatalk-ddp')
pkgver=2.2.2
pkgrel=0
pkgdesc="A kernel level implementation of the AppleTalk Protocol Suite"
pkgrel=3
pkgdesc='A kernel-level implementation of AppleTalk, AFP, and PAP services'
arch=('i686' 'x86_64')
url="http://netatalk.sourceforge.net"
options=('!libtool')
license=("GPL")
url='http://netatalk.sourceforge.net'
license=('GPL')
depends=('avahi>=0.6' 'libldap' 'libgcrypt>=1.2.3')
conflicts=('netatalk-ddp')
replaces=('netatalk-git' 'netatalk2')
backup=('etc/netatalk/afpd.conf'
'etc/netatalk/netatalk.conf'
'etc/netatalk/atalkd.conf'
'etc/netatalk/papd.conf'
'etc/netatalk/AppleVolumes.default'
'etc/netatalk/AppleVolumes.system')
depends=('libcups' 'pam' 'coreutils>=7.1-2' 'db')
optdepends=('avahi' 'tcp_wrappers' 'openssl' 'libgcrypt')
makedepends=('make' 'patch' 'gcc')
source=(http://voxel.dl.sourceforge.net/project/netatalk/netatalk/$pkgver/netatalk-$pkgver.tar.bz2 \
afpd atalkd papd cnid afpd.service)
install=netatalk.install
md5sums=('bd42b686ec7209d9ab47bd8e2e2431c4'
'16ab9fa50ec4abde6de478fc7de57805'
'2d05de4a16faf7d4af21b5f14e33fa82'
'b16a687c96dd1ca7ffefd7c995356c0d'
'e21ef8051269583764e68d00683691bb'
'9b6b2fee54fe052bba0c69f00d335bdb')
'etc/netatalk/netatalk.conf'
'etc/netatalk/AppleVolumes.default'
'etc/netatalk/AppleVolumes.system')
options=('!libtool')
install=$pkgname.install
changelog=$pkgname.changelog
source=(a2boot afpd atalkd cnid_metad netatalk papd timelord \
http://hivelocity.dl.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.bz2)
md5sums=('747f0f3870fc0472fff5d502acd83fda'
'3b936b466b00a479aadb32df60960538'
'14dd9d43125eec9be438e4474b271ff0'
'1eb353a1e0581f9d764826a2f2d9b6f2'
'c89d35e5ea67edfd08ebfccb306f6c47'
'd8fa2b290cac33b4de77a7b69ef03db9'
'80299f81b0413329479073fe02e85de5'
'bd42b686ec7209d9ab47bd8e2e2431c4')
_options='--disable-ddp --disable-srvloc --disable-timelord --disable-cups --disable-a2boot'
build() {
cd $startdir/src/netatalk-$pkgver
./configure --prefix=/usr --with-ssl-dir=/usr --localstatedir=/var --enable-fhs --enable-zeroconf=/usr --disable-srvloc --with-cnid-cdb-backend --enable-ddp
make || return 1
make DESTDIR=$startdir/pkg install
mv $startdir/pkg/usr/include/netatalk{,2}
install -d $startdir/pkg/etc/rc.d
install -m755 ../{afpd,atalkd,papd,cnid} $startdir/pkg/etc/rc.d
install -d $startdir/pkg/etc/avahi/services
install -m744 ../afpd.service $startdir/pkg/etc/avahi/services
rm -f $startdir/pkg/usr/share/man/man1/timeout.1{,.gz}
if [ "$pkgname" = "netatalk-ddp" ];then build_netatalk-ddp;fi
cd "$srcdir"/$pkgbase-$pkgver
msg2 'Configuring...'
CFLAGS="-Wno-unused-result" ./configure --prefix=/usr --localstatedir=/var --libexecdir='${libdir}' \
--with-cracklib --with-cnid-cdb-backend --enable-fhs $_options
msg2 'Making...'
make >/dev/null
echo $pkgname >made
}
build_netatalk-ddp() {
depends=('openslp' 'libcups' 'libgcrypt>=1.2.3')
resolve_deps ${depends[@]}
optdepends+=('cups: required for PAP support')
conflicts=('netatalk')
_options=`echo $_options | sed s/disable/enable/g`
}
package_netatalk() {
package_netatalk-ddp
rm "$pkgdir"/usr/share/man/man8/timelord.8 "$pkgdir"/etc/rc.d/{a2boot,atalkd,papd,timelord}
rmdir "$pkgdir"/usr/share/man/man3 "$pkgdir"/usr/share/man/man4
}
package_netatalk-ddp() {
cd "$srcdir"/$pkgbase-$pkgver
if [ -f made ];then rm made;else continue;fi
msg2 'Building...'
make DESTDIR="$pkgdir" install >/dev/null
msg2 'Copying initscripts...'
install -d "$pkgdir"/etc/rc.d
install -m755 "$srcdir"/{a2boot,atalkd,afpd,cnid_metad,netatalk,papd,timelord} "$pkgdir"/etc/rc.d
msg2 'Removing extraneous files...'
rm -r "$pkgdir"/usr/include "$pkgdir"/usr/share/aclocal
}

53
aur/netatalk/a2boot Normal file
View file

@ -0,0 +1,53 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
NAME="Apple II Boot Daemon"
ARGS=
DEPENDS=atalkd
REQUIRED=
DAEMON=`basename "$0"`
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
PID=`get_pid $DAEMON`
get_pid_r() {
local pid=()
for i in $@
do j=`get_pid $i` || return 1;pid+=($j);done
echo ${pid[@]};
}
case "$1" in
start)
stat_busy "Starting $NAME"
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
exit 1
fi
;;
stop)
stat_busy "Stopping $NAME"
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View file

@ -3,36 +3,51 @@
. /etc/rc.conf
. /etc/rc.d/functions
PID=$(pidof -o %PPID /usr/sbin/afpd)
case $1 in
start)
stat_busy "Starting afpd Daemon"
[ -z "$PID" ] && /usr/sbin/afpd
if [ $? -gt 0 ]; then
stat_fail
else
PID=$(pidof -o %PPID /usr/sbin/afpd)
echo "$PID" > /var/run/afpd.pid
add_daemon afpd
stat_done
fi
;;
stop)
stat_busy "Stopping afpd Daemon"
[ ! -z "$PID" ] && kill "$PID" &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon afpd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
NAME="Apple Filing Protocol Daemon"
ARGS=
DEPENDS=cnid_metad
REQUIRED=
DAEMON=`basename "$0"`
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
PID=`get_pid $DAEMON`
get_pid_r() {
local pid=()
for i in $@
do j=`get_pid $i` || return 1;pid+=($j);done
echo ${pid[@]};
}
case "$1" in
start)
stat_busy "Starting $NAME"
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
exit 1
fi
;;
stop)
stat_busy "Stopping $NAME"
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View file

@ -1,14 +0,0 @@
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>

View file

@ -3,40 +3,51 @@
. /etc/rc.conf
. /etc/rc.d/functions
myhostname=`hostname|sed 's/\..*$//'`
NAME="AppleTalk Protocol Daemon"
ARGS=
DEPENDS=init
REQUIRED="a2boot papd timelord"
DAEMON=`basename "$0"`
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
PID=`get_pid $DAEMON`
get_pid_r() {
local pid=()
for i in $@
do j=`get_pid $i` || return 1;pid+=($j);done
echo ${pid[@]};
}
PID=`pidof -o %PPID /usr/sbin/atalkd`
case "$1" in
start)
stat_busy "Starting atalkd Daemon"
[ -z "$PID" ] && /usr/sbin/atalkd
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/atalkd.pid
# Setting AppleTalk info with nbprgstr
add_daemon atalkd
stat_done
fi
;;
stop)
stat_busy "Stopping atalkd Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/atalkd.pid
rm_daemon atalkd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
start)
stat_busy "Starting $NAME"
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
exit 1
fi
;;
stop)
stat_busy "Stopping $NAME"
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View file

@ -1,39 +0,0 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
PID=$(pidof -o %PPID /usr/sbin/cnid_metad)
case "$1" in
start)
stat_busy "Starting cnid Daemon"
[ -z "$PID" ] && /usr/sbin/cnid_metad
if [ $? -gt 0 ]; then
stat_fail
else
PID=$(pidof -o %PPID /usr/sbin/cnid_metad)
echo "$PID" > /var/run/cnid.pid
add_daemon cnid
stat_done
fi
;;
stop)
stat_busy "Stopping cnid Daemon"
[ ! -z "$PID" ] && kill "$PID" &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon cnid
rm /var/run/cnid.pid
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0

53
aur/netatalk/cnid_metad Normal file
View file

@ -0,0 +1,53 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
NAME="CNID Meta-Daemon"
ARGS=
DEPENDS=init
REQUIRED=afpd
DAEMON=`basename "$0"`
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
PID=`get_pid $DAEMON`
get_pid_r() {
local pid=()
for i in $@
do j=`get_pid $i` || return 1;pid+=($j);done
echo ${pid[@]};
}
case "$1" in
start)
stat_busy "Starting $NAME"
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
exit 1
fi
;;
stop)
stat_busy "Stopping $NAME"
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

42
aur/netatalk/netatalk Normal file
View file

@ -0,0 +1,42 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
NAME="NetATalk Meta-Daemon"
DAEMON=`basename "$0"`
RUNNING=()
STOPPED=()
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
for i in atalkd papd timelord a2boot cnid_metad afpd
do
if [ `type -p $i` ]; then if [ `get_pid $i` ]; then RUNNING+=($i); else STOPPED+=($i); fi; fi
done
case "$1" in
start)
STARTING=''; rc.d start ${STOPPED[@]}
if [ $? = 0 ]; then
add_daemon $DAEMON
else
exit 1
fi
;;
stop)
for ((i=${#RUNNING[@]}-1; i>=0; i--));do rc.d stop ${RUNNING[$i]}; done
if [ $? = 0 ]; then
rm_daemon $DAEMON
else
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

View file

@ -0,0 +1,21 @@
2012-04-08 SJ_UnderWater
* 2.2.2-3 :
fixed extra dependencies
FHS compliance
NAMCAP checking
moved cups to optdepends
2012-04-07 SJ_UnderWater
* 2.2.2-2 :
added Install
changed "conflicts" with "replace"
cleaned up PKGBUILD
* 2.2.2-1 :
added ChangeLog.
moved to split package format
bidirectional dependency-checking
moved to release package format
PKGBUILD compliance

View file

@ -1,2 +1,16 @@
To configure shares, please edit /etc/netatalk/AppleVolumes.default.
To run as a daemon, add afpd to MODULES line in /etc/rc.conf
post_install() {
post_upgrade
}
post_upgrade() {
if [ "`grep -E '(cnid|atalkd|afpd)' /etc/rc.conf`" ];then
echo '>>> Detected old netatalk daemon entries in';
echo '>>> /etc/rc.conf, please replace these with';
echo '>>> "netatalk" before restarting!';
else echo '>>> Add "netatalk" to your DAEMONS list in /etc/rc.conf';fi
echo '>>>';
if [ -f /etc/avahi/services/adisk.service ] ||
[ -f /etc/avahi/services/afpd.service ];then
echo '>>> Detected old netatalk service files in';
echo '>>> /etc/avahi/services, please delete these';
echo '>>> before restarting!';fi
}

View file

@ -3,36 +3,51 @@
. /etc/rc.conf
. /etc/rc.d/functions
PID=`pidof -o %PPID /usr/sbin/papd`
NAME="AppleTalk Printer Daemon"
ARGS=
DEPENDS=atalkd
REQUIRED=
DAEMON=`basename "$0"`
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
PID=`get_pid $DAEMON`
get_pid_r() {
local pid=()
for i in $@
do j=`get_pid $i` || return 1;pid+=($j);done
echo ${pid[@]};
}
case "$1" in
start)
stat_busy "Starting papd Daemon"
[ -z "$PID" ] && /usr/sbin/papd
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/papd.pid
add_daemon papd
stat_done
fi
;;
stop)
stat_busy "Stopping papd Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/papd.pid
rm_daemon papd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
start)
stat_busy "Starting $NAME"
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
exit 1
fi
;;
stop)
stat_busy "Stopping $NAME"
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac

53
aur/netatalk/timelord Normal file
View file

@ -0,0 +1,53 @@
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
NAME="AppleTalk Time Daemon"
ARGS=
DEPENDS=atalkd
REQUIRED=
DAEMON=`basename "$0"`
[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
PID=`get_pid $DAEMON`
get_pid_r() {
local pid=()
for i in $@
do j=`get_pid $i` || return 1;pid+=($j);done
echo ${pid[@]};
}
case "$1" in
start)
stat_busy "Starting $NAME"
[ `get_pid_r $DEPENDS` ] && [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ ! `get_pid_r $DEPENDS` ];then echo "Error: \"$DAEMON\" refusing to start, dependency \"$DEPENDS\" not met" >&2;fi
exit 1
fi
;;
stop)
stat_busy "Stopping $NAME"
[ ! `get_pid_r $REQUIRED` ] && [ -n "$PID" ] && kill $PID &>/dev/null
if [ $? = 0 ]; then
stat_done
else
stat_fail
if [ `get_pid_r $REQUIRED` ];then echo "Error: Dependency \"$REQUIRED\" requires \"$DAEMON\", stop it first" >&2;fi
exit 1
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac