# FIXME: eventually split this up into different packages
Package-Name: netkit-combo
Requires: ncurses|ncurses4
Homepage: http://www.hcs.harvard.edu/~dholland/computers/netkit.html
Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-combo-(\d+.\d+).tar.gz $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	if packager c Linux-PAM ; then PAM= ; else PAM=--without-pam ; fi ; \
	CC=gcc CXX=g++ CFLAGS="-O2 $(GCC_OPT_FLAGS)" CXXFLAGS="-O2 $(GCC_OPT_FLAGS)" ./configure --prefix="$(PREFIX)" $$PAM
	$(MAKE)
	mkdir -p "$(PREFIX)"/{bin,sbin,man/man{1,5,8}}
	$(MAKE) install
Install:
	mv -f "$(PREFIX)"/bin/{ftp,pftp,telnet} /bin/
	$(MAKE) instbin BIN="biff callbootd finger rcp rexec rlogin rsh rup ruptime rusers rwall rwho talk tftp write"
	$(MAKE) instsbin SBIN="in.comsat in.fingerd in.ftpd in.ntalkd in.rexecd in.rlogind in.rshd in.talkd in.telnetd in.tftpd in.writed inetd ripquery routed rpc.bootparamd rpc.rusersd rpc.rwalld rwhod"
	$(MAKE) instman SECTION=1 MAN="biff finger ftp pftp rcp rexec rlogin rsh rup ruptime rusers rwall rwho talk telnet tftp write"
	$(MAKE) instman SECTION=5 MAN="ftpusers issue.net netrc"
	$(MAKE) instman SECTION=8 MAN="bootparamd fingerd ftpd in.comsat in.fingerd in.ftpd in.ntalkd in.rexecd in.rlogind in.rshd in.talkd in.telnetd in.tftpd in.writed inetd ntalkd rexecd ripquery rlogind routed rpc.bootparamd rpc.rusersd rpc.rwalld rshd rusersd rwalld rwhod talkd telnetd tftpd writed"
Patch: <<EOT
######## begin timed disabling patch (no more CLK_TCK)
--- Makefile.old	1999-12-13 03:34:35 +0900
+++ Makefile	2007-07-17 01:18:49 +0900
@@ -5,7 +5,7 @@
       netkit-ntalk bsd-finger linux-ftpd netkit-ftp netwrite \
       netkit-bootparamd netkit-tftp \
       biff+comsat netkit-rusers netkit-rwho netkit-rwall \
-      netkit-routed netkit-rsh netkit-telnet netkit-timed
+      netkit-routed netkit-rsh netkit-telnet
 
 
 %.build:
######## end timed disabling patch
######## begin GCC4 patch
--- netkit-base/inetd/servtab.c.old	2000-07-23 05:20:50 +0900
+++ netkit-base/inetd/servtab.c	2005-07-23 07:43:10 +0900
@@ -771,7 +771,7 @@
 			return;
 		}
 		
-#define SWAP(type, a, b) {type c=(type)a; (type)a=(type)b; (type)b=(type)c;}
+#define SWAP(type, a, b) {type c=(type)a; a=(typeof(a))b; b=(typeof(b))c;}
 
 		/*
 		 * sep->se_wait may be holding the pid of a daemon
--- linux-ftpd/ftpd/ftpcmd.y.old	1999-10-09 11:32:12 +0900
+++ linux-ftpd/ftpd/ftpcmd.y	2005-07-23 07:45:32 +0900
@@ -100,7 +100,14 @@
 char	cbuf[512];
 char	*fromname;
 
-struct tab;
+struct tab {
+	const char	*name;
+	short	token;
+	short	state;
+	short	implemented;	/* 1 if command is implemented */
+	const char	*help;
+};
+
 static int	 yylex __P((void));
 static void	 sizecmd __P((char *));
 static void	 help __P((struct tab *, char *));
@@ -832,14 +839,6 @@
 #define	SITECMD	7	/* SITE command */
 #define	NSTR	8	/* Number followed by a string */
 
-struct tab {
-	const char	*name;
-	short	token;
-	short	state;
-	short	implemented;	/* 1 if command is implemented */
-	const char	*help;
-};
-
 struct tab cmdtab[] = {		/* In order defined in RFC 765 */
 	{ "USER", USER, STR1, 1,	"<sp> username" },
 	{ "PASS", PASS, ZSTR1, 1,	"<sp> password" },
--- netkit-rwho/rwhod/rwhod.c.old	2000-07-23 12:19:48 +0900
+++ netkit-rwho/rwhod/rwhod.c	2005-07-23 07:47:16 +0900
@@ -95,7 +95,7 @@
 static void	broadcaster(void);
 static int	configure(int s);
 static int	verify(const char *name);
-static int	getloadavg(double ptr[3], int n);
+       int	getloadavg(double ptr[3], int n);
 
 /*
  * We communicate with each neighbor in
######## end GCC4 patch
--- biff+comsat/comsat/Makefile.old	Sun Aug  1 06:09:46 1999
+++ biff+comsat/comsat/Makefile	Fri Nov 15 09:02:49 2002
@@ -13,7 +13,7 @@
 install: comsat
 	install -s -m$(DAEMONMODE) comsat $(INSTALLROOT)$(SBINDIR)/in.comsat
 	install -m$(MANMODE) comsat.8 $(INSTALLROOT)$(MANDIR)/man8/in.comsat.8
-	ln -sf in.comsat.8 $(MANDIR)/man8/comsat.8
+	ln -sf in.comsat.8 $(INSTALLROOT)$(MANDIR)/man8/comsat.8
 
 clean:
 	rm -f *.o comsat
--- netkit-ntalk/talkd/announce.c.old	Sun Jul 23 00:27:39 2000
+++ netkit-ntalk/talkd/announce.c	Fri Nov 15 08:34:29 2002
@@ -49,6 +49,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <paths.h>
+#include <time.h>
 #include "prot_talkd.h"
 #include "proto.h"
 
--- bsd-finger/finger/lprint.c.old	Tue Sep 14 19:51:11 1999
+++ bsd-finger/finger/lprint.c	Fri Nov 15 08:35:12 2002
@@ -45,6 +45,7 @@
 #include <paths.h>
 #include <string.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/file.h>
 #include <sys/stat.h>
--- bsd-finger/finger/sprint.c.old	Mon Dec 13 03:59:33 1999
+++ bsd-finger/finger/sprint.c	Fri Nov 15 08:35:47 2002
@@ -44,6 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 #include "finger.h"
 
 static void stimeprint(WHERE *w);
--- netwrite/write/write.c.old	Mon Dec 13 04:56:40 1999
+++ netwrite/write/write.c	Fri Nov 15 08:37:04 2002
@@ -73,9 +73,7 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <utmp.h>
-#if 0
-	#include <time.h>
-#endif
+#include <time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
--- netkit-telnet/telnet/main.cc.old	Sun Aug  1 14:06:37 1999
+++ netkit-telnet/telnet/main.cc	Fri Nov 15 09:09:29 2002
@@ -45,6 +45,7 @@
 
 #include <sys/types.h>
 #include <getopt.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "ring.h"
--- netkit-telnet/telnet/netlink.cc.old	Sun Jul 23 13:16:25 2000
+++ netkit-telnet/telnet/netlink.cc	Fri Nov 15 10:12:13 2002
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
--- netkit-telnet/telnet/network.cc.old	Tue Aug 13 17:09:58 1996
+++ netkit-telnet/telnet/network.cc	Fri Nov 15 09:13:25 2002
@@ -40,6 +40,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <arpa/telnet.h>
 
--- netkit-telnet/telnet/terminal.cc.old	Mon Dec 13 04:48:05 1999
+++ netkit-telnet/telnet/terminal.cc	Fri Nov 15 10:18:27 2002
@@ -45,6 +45,8 @@
 #include <signal.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include "ring.h"
 #include "defines.h"
--- netkit-telnet/telnet/utilities.cc.old	Mon Dec 13 00:33:40 1999
+++ netkit-telnet/telnet/utilities.cc	Fri Nov 15 10:11:42 2002
@@ -45,6 +45,8 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/socket.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <ctype.h>
 
--- netkit-timed/timed/timed/timed.c.old	Mon Dec 13 03:05:07 1999
+++ netkit-timed/timed/timed/timed.c	Fri Nov 15 08:41:10 2002
@@ -899,7 +899,7 @@
 get_goodgroup(int force)
 {
 # define NG_DELAY (30*60*CLK_TCK)	/* 30 minutes */
-	static unsigned long last_update = -NG_DELAY;
+	static unsigned long last_update = -0x7FFFFFFF;
 	unsigned long new_update;
 /*	struct hosttbl *htp; */
 	struct goodhost *ghp, **ghpp;
EOT

/bin/ftp
/bin/pftp
/bin/telnet
/pkg/netkit-combo/
/usr/bin/biff
/usr/bin/callbootd
/usr/bin/finger
/usr/bin/rcp
/usr/bin/rexec
/usr/bin/rlogin
/usr/bin/rsh
/usr/bin/rup
/usr/bin/ruptime
/usr/bin/rusers
/usr/bin/rwall
/usr/bin/rwho
/usr/bin/talk
/usr/bin/telnet
/usr/bin/tftp
/usr/bin/write
/usr/man/man1/biff.1.gz
/usr/man/man1/finger.1.gz
/usr/man/man1/ftp.1.gz
/usr/man/man1/pftp.1.gz
/usr/man/man1/rcp.1.gz
/usr/man/man1/rexec.1.gz
/usr/man/man1/rlogin.1.gz
/usr/man/man1/rsh.1.gz
/usr/man/man1/rup.1.gz
/usr/man/man1/ruptime.1.gz
/usr/man/man1/rusers.1.gz
/usr/man/man1/rwall.1.gz
/usr/man/man1/rwho.1.gz
/usr/man/man1/talk.1.gz
/usr/man/man1/telnet.1.gz
/usr/man/man1/tftp.1.gz
/usr/man/man1/write.1.gz
/usr/man/man5/ftpusers.5.gz
/usr/man/man5/issue.net.5.gz
/usr/man/man5/netrc.5.gz
/usr/man/man8/bootparamd.8.gz
/usr/man/man8/fingerd.8.gz
/usr/man/man8/ftpd.8.gz
/usr/man/man8/in.comsat.8.gz
/usr/man/man8/in.fingerd.8.gz
/usr/man/man8/in.ftpd.8.gz
/usr/man/man8/in.ntalkd.8.gz
/usr/man/man8/in.rexecd.8.gz
/usr/man/man8/in.rlogind.8.gz
/usr/man/man8/in.rshd.8.gz
/usr/man/man8/in.talkd.8.gz
/usr/man/man8/in.telnetd.8.gz
/usr/man/man8/in.tftpd.8.gz
/usr/man/man8/in.writed.8.gz
/usr/man/man8/inetd.8.gz
/usr/man/man8/ntalkd.8.gz
/usr/man/man8/rexecd.8.gz
/usr/man/man8/ripquery.8.gz
/usr/man/man8/rlogind.8.gz
/usr/man/man8/routed.8.gz
/usr/man/man8/rpc.bootparamd.8.gz
/usr/man/man8/rpc.rusersd.8.gz
/usr/man/man8/rpc.rwalld.8.gz
/usr/man/man8/rshd.8.gz
/usr/man/man8/rusersd.8.gz
/usr/man/man8/rwalld.8.gz
/usr/man/man8/rwhod.8.gz
/usr/man/man8/talkd.8.gz
/usr/man/man8/telnetd.8.gz
/usr/man/man8/tftpd.8.gz
/usr/man/man8/timed.8.gz
/usr/man/man8/timedc.8.gz
/usr/man/man8/writed.8.gz
/usr/sbin/in.comsat
/usr/sbin/in.fingerd
/usr/sbin/in.ftpd
/usr/sbin/in.ntalkd
/usr/sbin/in.rexecd
/usr/sbin/in.rlogind
/usr/sbin/in.rshd
/usr/sbin/in.talkd
/usr/sbin/in.telnetd
/usr/sbin/in.tftpd
/usr/sbin/in.writed
/usr/sbin/inetd
/usr/sbin/ripquery
/usr/sbin/routed
/usr/sbin/rpc.bootparamd
/usr/sbin/rpc.rusersd
/usr/sbin/rpc.rwalld
/usr/sbin/rwhod
/usr/sbin/timed
/usr/sbin/timedc
