Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c5ad04c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,108 @@
+#
+#    Copyright (c) 2010-2011 Nest, Inc.
+#    All rights reserved.
+#
+#    This document is the property of Nest. It is considered
+#    confidential and proprietary information.
+#
+#    This document may not be reproduced or transmitted in any form,
+#    in whole or in part, without the express written permission of
+#    Nest.
+#
+#    Description:
+#      This file is the makefile for c-kermit, a combined serial and
+#      network communication software package.
+#
+
+
+include pre.mak
+
+PackageName		:= ckermit
+
+PackageExtension	:= tar.gz
+PackageSeparator	:= -
+
+PackagePatchArgs	:=
+
+PackageArchive		:= $(PackageName).$(PackageExtension)
+PackageSourceDir	:= $(PackageName)$(PackageSeparator)$(PackageVersion)
+
+PackageBuildMakefile	= $(call GenerateBuildPaths,makefile)
+
+CleanPaths		+= $(PackageLicenseFile)
+
+SOURCEDIRS                      = $(PackageSourceDir)
+$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(PackageSourceDir)/COPYING.TXT: $(BuildDirectory)/source
+
+$(PackageLicenseFile): $(PackageSourceDir)/COPYING.TXT
+	$(copy-result)
+
+# Extract the source from the archive and apply patches, if any.
+
+$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
+	$(create-directory)
+	$(call expand-archive,$(PackageArchive),$(@))
+	$(Verbose)touch $(@)
+	$(call patch-directory,$(@),$(PackagePatchArgs),$(PackagePatchPaths))
+
+# Prepare the sources.
+
+$(BuildDirectory)/source: | $(PackageSourceDir) $(BuildDirectory)
+	$(Verbose)touch $@
+
+# Patch the sources, if necessary.
+
+$(BuildDirectory)/patch: $(BuildDirectory)/source
+	$(Verbose)touch $@
+
+# Generate the package build makefile.
+# Configure the source for building.
+
+$(BuildDirectory)/configure: $(BuildDirectory)/source | $(PackageSourceDir) $(BuildDirectory)
+	$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
+	$(Verbose)touch $@
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/build: $(BuildDirectory)/configure
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	CC="$(CC) $(CPPOPTFLAGS)" CXX="$(CXX) $(CPPOPTFLAGS)" AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+	KFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \
+	NCURSES_CPPFLAGS=$(call ToolGenerateIncludeArgument,$(NCursesIncludePath)) \
+	NCURSES_LDFLAGS=$(call GenerateLibraryPathArgument,$(NCursesLibraryPath)) \
+	linux-cross
+	$(Verbose)touch $@
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory)
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	DESTDIR=$(ResultDirectory) \
+	prefix=/usr \
+	MANDIR="" \
+	install
+	$(Verbose)touch $@
+
+.PHONY: stage
+stage: $(BuildDirectory)/stage
+
+clean:
+	$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
+
+include post.mak
diff --git a/ckermit.patches/ckermit-50.description b/ckermit.patches/ckermit-50.description
new file mode 100644
index 0000000..344772b
--- /dev/null
+++ b/ckermit.patches/ckermit-50.description
@@ -0,0 +1 @@
+This patch creates a target that allows c-kermit to be cross-compiled for a linux target on a linux host.
diff --git a/ckermit.patches/ckermit-50.patch b/ckermit.patches/ckermit-50.patch
new file mode 100644
index 0000000..cd698a9
--- /dev/null
+++ b/ckermit.patches/ckermit-50.patch
@@ -0,0 +1,48 @@
+--- a/makefile	2004-04-17 11:52:00.000000000 -0700
++++ b/makefile	2012-05-24 11:32:58.656618936 -0700
+@@ -966,7 +966,7 @@
+ 		else\
+ 			echo "Creating $(DESTDIR)...";\
+ 			DESTDIR=`echo $(DESTDIR) | sed 's!/*$$!!'`;\
+-			mkdir $$DESTDIR  || exit 1;\
++			mkdir -p $$DESTDIR  || exit 1;\
+ 		fi;\
+ 		chmod 755 $(DESTDIR) || exit 1;\
+ 	fi;\
+@@ -985,14 +985,14 @@
+ 		echo  "$(DESTDIR)$(BINDIR) exists...";\
+ 	else\
+ 		echo "Creating $(DESTDIR)$(BINDIR)/...";\
+-		mkdir     $(DESTDIR)$(BINDIR) || exit 1;\
++		mkdir -p  $(DESTDIR)$(BINDIR) || exit 1;\
+ 		chmod 755 $(DESTDIR)$(BINDIR);\
+ 	fi;\
+ 	rm -f $(DESTDIR)$(BINDIR)/kermit;\
+ 	cp $(BINARY) $(DESTDIR)$(BINDIR)/kermit || exit 1;\
+ 	chmod 755    $(DESTDIR)$(BINDIR)/kermit || exit 1;\
+ 	rm -f        $(DESTDIR)$(BINDIR)/kermit-sshsub;\
+-	ln -s        $(DESTDIR)$(BINDIR)/kermit\
++	ln -s        kermit\
+ 		     $(DESTDIR)$(BINDIR)/kermit-sshsub || exit 1;\
+ 	echo 'set flag=f\nPrC Removing binaries' >&3;\
+ 	echo "RmF $(DESTDIR)$(BINDIR)/kermit-sshsub" >&3;\
+@@ -5450,6 +5450,19 @@
+ 	-DCK_NEWTERM -DTCPSOCKET -DLINUXFSSTND -DNOCOTFMC -DPOSIX \
+ 	-DUSE_STRERROR $(KFLAGS)" "LNKFLAGS = $(LNKFLAGS)" "LIBS = $(LIBS) -lm"
+ 
++linux-cross:
++	@echo 'Making C-Kermit $(CKVER) for Linux (cross-compiled)...'
++	gcc -o ckwart.o -c ckwart.c
++	gcc -o wart ckwart.o
++	$(MAKE) xermit KTARGET=$${KTARGET:-$(@)} \
++	"CC = $(CC)" "CC2 = $(CC)" "HOSTCC = gcc" \
++	"CFLAGS = -O -DLINUX -pipe -funsigned-char -DFNFLOAT -DCK_POSIX_SIG \
++	-DCK_NCURSES -DHAVE_PTMX \
++	-DCK_NEWTERM -DTCPSOCKET -DLINUXFSSTND -DNOCOTFMC -DPOSIX \
++	-DUSE_STRERROR $(NCURSES_CPPFLAGS) $(KFLAGS)" \
++	"LNKFLAGS = $(NCURSES_LDFLAGS) $(LNKFLAGS)" \
++	"LIBS = $(LIBS) -lncurses -lresolv -lcrypt -lm"
++
+ # As above but with profiling
+ linuxp:
+ 	$(MAKE) linuxa KTARGET=$${KTARGET:-$(@)} "KFLAGS=$(KFLAGS) -pg" \
diff --git a/ckermit.tar.gz b/ckermit.tar.gz
new file mode 100644
index 0000000..259de77
--- /dev/null
+++ b/ckermit.tar.gz
Binary files differ
diff --git a/ckermit.url b/ckermit.url
new file mode 100644
index 0000000..ad51c6e
--- /dev/null
+++ b/ckermit.url
@@ -0,0 +1 @@
+ftp://kermit.columbia.edu/kermit/archives/cku211.tar.gz
diff --git a/ckermit.version b/ckermit.version
new file mode 100644
index 0000000..e7c9920
--- /dev/null
+++ b/ckermit.version
@@ -0,0 +1 @@
+8.0.211