Subject: pkg/14814: suggested package clean-ups for netatalk-asun
To: None <gnats-bugs@gnats.netbsd.org>
From: None <ball@iprotium.com>
List: netbsd-bugs
Date: 12/02/2001 15:11:56
>Number:         14814
>Category:       pkg
>Synopsis:       suggested package clean-ups for netatalk-asun
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 02 15:12:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Allen D. Ball
>Release:        NetBSD 1.5.2; PKGSRC sup'ed 20011201
>Organization:
	N/A
>Environment:
System: NetBSD proton. 1.5.2 NetBSD 1.5.2 (INTEL-ISP1100) #0: Sat Dec 1 20:02:36 PST 2001 ball@proton.:/usr/src/sys/arch/i386/compile/INTEL-ISP1100 i386
Architecture: i386
Machine: i386
>Description:
The PLIST in net/netatalk-sun does not quite correspond to reality.
Installing and de-installing the package will leave a number of orphaned
files.  Specifically:

        share/examples/netatalk/AppleVolumes.system.orig
        libexec/psffilters/
        include/atalk/
        share/examples/netatalk

While I was here, I noticed that the package does not yet use the new
PKG_SYSCONF* machinery, it installs duplicate headers (to NetBSD) in
include/netatalk, and has an rc script that does not use the new rcorder
machinery.

(The script was inspired by an similar, older script in the samba package.)
>How-To-Repeat:
cd .../pkgsrc/net/netatalk-sun; make install; make deinstall

will leave a number of files behind (see above).
>Fix:
The following patch uses the new PKG_SYSCONF* machinery, cleans up the
PLIST, does not install the headers in to include/netatalk, and suggests
a new /etc/rc.d script for NetBSD.


Index: pkgsrc/net/netatalk-asun/Makefile
diff -c pkgsrc/net/netatalk-asun/Makefile:1.1.1.2 pkgsrc/net/netatalk-asun/Makefile:1.1.1.1.2.2
*** pkgsrc/net/netatalk-asun/Makefile:1.1.1.2	Sat Dec  1 22:26:24 2001
--- pkgsrc/net/netatalk-asun/Makefile	Sun Dec  2 14:41:17 2001
***************
*** 14,19 ****
--- 14,21 ----
  CONFLICTS=	netatalk-[0-9]*
  CONFLICTS+=	netatalk-umich-[0-9]*
  
+ PKG_SYSCONFSUBDIR?=	netatalk
+ 
  post-extract:
  		@${MV} ${WRKSRC}/man/man8/papd.8 ${WRKSRC}/man/man8/papd.tbl
  
Index: pkgsrc/net/netatalk-asun/PLIST
diff -c pkgsrc/net/netatalk-asun/PLIST:1.1.1.1 pkgsrc/net/netatalk-asun/PLIST:1.1.1.1.2.1
*** pkgsrc/net/netatalk-asun/PLIST:1.1.1.1	Tue Nov 20 21:30:28 2001
--- pkgsrc/net/netatalk-asun/PLIST	Sun Dec  2 14:41:17 2001
***************
*** 32,44 ****
  include/atalk/server_child.h
  include/atalk/util.h
  include/atalk/zip.h
- include/netatalk/aarp.h
- include/netatalk/at.h
- include/netatalk/at_var.h
- include/netatalk/ddp.h
- include/netatalk/ddp_var.h
- include/netatalk/endian.h
- include/netatalk/phase2.h
  lib/libatalk.a
  lib/libatalk_p.a
  libexec/afpd
--- 32,37 ----
***************
*** 92,97 ****
--- 85,91 ----
  man/man8/psf.8
  share/examples/netatalk/AppleVolumes.default
  share/examples/netatalk/AppleVolumes.system
+ share/examples/netatalk/AppleVolumes.system.orig
  share/examples/netatalk/afpd.conf
  share/examples/netatalk/atalkd.conf
  share/examples/netatalk/netatalk.pamd
***************
*** 100,102 ****
--- 94,99 ----
  share/nls/maccode.850
  share/nls/maccode.iso8859-1
  share/pagecount.ps
+ @dirrm libexec/psffilters
+ @dirrm include/atalk
+ @dirrm share/examples/netatalk
Index: pkgsrc/net/netatalk-asun/files/netatalk.sh
diff -c /dev/null pkgsrc/net/netatalk-asun/files/netatalk.sh:1.1.2.1
*** /dev/null	Sun Dec  2 14:47:13 2001
--- pkgsrc/net/netatalk-asun/files/netatalk.sh	Sun Dec  2 14:42:08 2001
***************
*** 0 ****
--- 1,79 ----
+ #!/bin/sh
+ #
+ # $NetBSD$
+ #
+ # PROVIDE: atalkd
+ # REQUIRE: DAEMON
+ #
+ # To use this script, copy to /etc/rc.d and set atalk=YES in /etc/rc.conf.
+ # You may also set atalkd_flags, papd_flags, and afpd_flags to any additional
+ # options you wish to pass to the netatalk daemons.
+ 
+ if [ -d /etc/rc.d -a -f /etc/rc.subr ]; then
+ 	. /etc/rc.subr
+ fi
+ 
+ machine_name=`hostname -s |sed 's/\..*$//'`
+ 
+ arg="$1"
+ rcvar="atalkd"
+ 
+ name="atalkd"
+ command=":LIBEXECDIR:/atalkd"
+ pidfile="/var/run/${name}.pid"
+ 
+ if [ ! -d /etc/rc.d ]; then
+ 	echo -n ' ${name}'
+ 	${command} ${atalkd_flags} ${command_args}
+ else
+ 	load_rc_config $name
+ 	run_rc_command "$arg"
+ fi
+ 
+ case ${arg} in
+ start)
+ 	register=:BINDIR:/nbprgstr
+ 	if checkyesno ${rcvar} && [ -x ${register} ]; then
+ 		${register} -p 4 ${machine_name}:Workstation
+ 		${register} -p 4 ${machine_name}:netatalk
+ 	fi
+ 	;;
+ stop)
+ 	;;
+ restart)
+ 	( $0 stop )
+ 	sleep 5
+ 	$0 start
+ 	;;
+ *)
+ 	echo "Unexpected argument: ${arg}"
+ 	;;
+ esac
+ 
+ name="papd"
+ command=":LIBEXECDIR:/papd"
+ pidfile="/var/run/${name}.pid"
+ 
+ if [ -x ${command} -a -e :ETCDIR:/papd.conf ]; then
+ 	if [ ! -d /etc/rc.d ]; then
+ 		echo -n ' ${name}'
+ 		${command} ${papd_flags} ${command_args}
+ 	else
+ 		load_rc_config $name
+ 		run_rc_command "$1"
+ 	fi
+ fi
+ 
+ name="afpd"
+ command=":LIBEXECDIR:/afpd"
+ pidfile="/var/run/${name}.pid"
+ 
+ if [ -x ${command} -a -e :ETCDIR:/AppleVolumes.system ]; then
+ 	if [ ! -d /etc/rc.d ]; then
+ 		echo -n ' ${name}'
+ 		${command} ${afpd_flags} ${command_args}
+ 	else
+ 		load_rc_config $name
+ 		run_rc_command "$1"
+ 	fi
+ fi
Index: pkgsrc/net/netatalk-asun/patches/patch-bj
diff -c pkgsrc/net/netatalk-asun/patches/patch-bj:1.1.1.1 pkgsrc/net/netatalk-asun/patches/patch-bj:1.1.1.1.2.1
*** pkgsrc/net/netatalk-asun/patches/patch-bj:1.1.1.1	Tue Nov 20 21:30:29 2001
--- pkgsrc/net/netatalk-asun/patches/patch-bj	Sun Dec  2 14:44:41 2001
***************
*** 1,5 ****
! $NetBSD: patch-bj,v 1.3 2001/05/24 17:00:58 abs Exp $
  
  --- sys/netbsd/Makefile.orig	Thu Feb  4 07:30:30 1999
  +++ sys/netbsd/Makefile
  @@ -1,10 +1,10 @@
--- 1,17 ----
! $NetBSD$
  
+ --- Makefile.orig	Sun Dec  2 12:01:33 2001
+ +++ Makefile	Sun Dec  2 12:02:39 2001
+ @@ -14,7 +14,7 @@
+  # for configuration files (AppleVolumes.system, etc.)
+  ETCDIR=/etc/netatalk
+  # for startup script
+ -RCDIR=$(DESTDIR)/etc/rc.d
+ +RCDIR=/etc/rc.d
+  # for include files
+  INCDIR=$(DESTDIR)/include
+  # Root of man pages.  Subdirectories will be
+ 
  --- sys/netbsd/Makefile.orig	Thu Feb  4 07:30:30 1999
  +++ sys/netbsd/Makefile
  @@ -1,10 +1,10 @@
***************
*** 50,56 ****
  -	    < ../../rc.atalk.bsd > ${ETCDIR}/rc.atalk
  +		-e s@:LIBEXECDIR:@${LIBEXECDIR}@ \
  +		-e s@:EXAMPLEDIR:@${EXAMPLEDIR}@ \
! +	    < ../../rc.atalk.bsd > ${RCDIR}/netatalk
  +	chmod 755 ${RCDIR}/netatalk
  +	@echo "Install is done."
   	@echo
--- 62,68 ----
  -	    < ../../rc.atalk.bsd > ${ETCDIR}/rc.atalk
  +		-e s@:LIBEXECDIR:@${LIBEXECDIR}@ \
  +		-e s@:EXAMPLEDIR:@${EXAMPLEDIR}@ \
! +	    < ../../../../files/netatalk.sh > ${RCDIR}/netatalk
  +	chmod 755 ${RCDIR}/netatalk
  +	@echo "Install is done."
   	@echo
***************
*** 64,70 ****
  -	@echo "Don't forget to call rc.atalk in /etc/rc.local.  See README"
  -	@echo "and README.NETBSD for more information."
  -
! +	@echo "Don't forget to call ${RCDIR}/netatalk in /etc/rc.local."
  +	@echo "See README.NETBSD for kernel configuration information."
   clean :
   	for i in ${ALL}; \
--- 76,82 ----
  -	@echo "Don't forget to call rc.atalk in /etc/rc.local.  See README"
  -	@echo "and README.NETBSD for more information."
  -
! +	@echo "Don't forget to add \"atalkd=YES\" to /etc/rc.conf."
  +	@echo "See README.NETBSD for kernel configuration information."
   clean :
   	for i in ${ALL}; \
Index: pkgsrc/net/netatalk-asun/patches/patch-bo
diff -c /dev/null pkgsrc/net/netatalk-asun/patches/patch-bo:1.1.2.1
*** /dev/null	Sun Dec  2 14:47:13 2001
--- pkgsrc/net/netatalk-asun/patches/patch-bo	Sun Dec  2 14:44:41 2001
***************
*** 0 ****
--- 1,10 ----
+ $NetBSD$
+ 
+ --- include/Makefile.orig	Tue May 20 10:35:42 1997
+ +++ include/Makefile	Sun Dec  2 13:14:56 2001
+ @@ -1,4 +1,4 @@
+ -TARGETS=	atalk netatalk
+ +TARGETS=	atalk
+  
+  INSTALL=	install
+  
>Release-Note:
>Audit-Trail:
>Unformatted: