Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3c93572
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,107 @@
+#
+#    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 the TCP/IP port number to RPC
+#      number mapper daemon and utilities.
+#
+
+
+include pre.mak
+
+PackageName		:= portmap
+
+PackageExtension	:= tar.gz
+PackageSeparator	:= _
+
+PackagePatchArgs	:= -p1
+
+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)/portmap.c: $(BuildDirectory)/source
+
+$(PackageLicenseFile): $(PackageSourceDir)/portmap.c
+	$(Verbose)$(SED) -n -e '/^\/\*-$$/,/\*\/$$/{;p;/\*\/$$/q;}' < $< > $@
+
+# Extract the source from the archive and apply patches, if any.
+
+$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
+	$(expand-and-patch-package)
+
+# Prepare the sources.
+
+$(BuildDirectory)/source: | $(PackageSourceDir)
+	$(Verbose)touch $@
+
+# Patch the sources, if necessary.
+
+$(BuildDirectory)/patch: $(BuildDirectory)/source
+	$(Verbose)touch $@
+
+# Generate the package build makefile.
+
+$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory)
+	$(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
+
+# Configure the source for building.
+
+$(BuildDirectory)/configure: $(BuildDirectory)/source $(PackageBuildMakefile)
+	$(Verbose)touch $@
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/build: $(BuildDirectory)/configure
+	$(Verbose)unset MAKEFLAGS && \
+	CPPFLAGS="$(call ToolGenerateIncludeArgument,$(LinuxIncludePath))" \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	WRAP_INC="$(call ToolGenerateIncludeArgument,$(TcpWrappersIncludePath))" \
+	WRAP_LIB="$(call GenerateLibraryArgument,$(TcpWrappersLibraryPath))" \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	CC="$(CC) $(CPPOPTFLAGS)" \
+	all
+	$(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) \
+	BASEDIR=$(ResultDirectory) \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	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/portmap.patches/portmap-50.description b/portmap.patches/portmap-50.description
new file mode 100644
index 0000000..4049b94
--- /dev/null
+++ b/portmap.patches/portmap-50.description
@@ -0,0 +1,3 @@
+This patch adds support for specifying a non-standard location for TCP 
+Wrappers headers, disables stripping binaries and setting user/group 
+attributes (which fails for non-privileged users).
diff --git a/portmap.patches/portmap-50.patch b/portmap.patches/portmap-50.patch
new file mode 100644
index 0000000..7aa8bd5
--- /dev/null
+++ b/portmap.patches/portmap-50.patch
@@ -0,0 +1,32 @@
+diff -r -N -u portmap_6.0/Makefile portmap_6.0.N/Makefile
+--- portmap_6.0/Makefile	2007-05-10 20:02:10.000000000 -0700
++++ portmap_6.0.N/Makefile	2008-01-22 16:09:21.000000000 -0800
+@@ -128,6 +128,7 @@
+ portmap: CFLAGS   += -fpie
+ portmap: LDLIBS   += $(WRAP_LIB)
+ portmap: LDFLAGS  += -pie
++portmap: CPPFLAGS += $(WRAP_INC)
+ portmap: portmap.o pmap_check.o from_local.o
+ 
+ from_local: CPPFLAGS += -DTEST
+@@ -136,12 +137,14 @@
+ 	sed $(MAN_SED) < portmap.8 > portmap.man
+ 
+ install: all
+-	install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
+-	install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin
+-	install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin
+-	install -o root -g root -m 0644 portmap.man ${BASEDIR}/usr/share/man/man8/portmap.8
+-	install -o root -g root -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8
+-	install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
++	mkdir -p ${BASEDIR}/sbin
++	install -m 0755 portmap ${BASEDIR}/sbin
++	install -m 0755 pmap_dump ${BASEDIR}/sbin
++	install -m 0755 pmap_set ${BASEDIR}/sbin
++	mkdir -p ${BASEDIR}/usr/share/man/man8
++	install -m 0644 portmap.man ${BASEDIR}/usr/share/man/man8/portmap.8
++	install -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8
++	install -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
+ 
+ clean:
+ 	rm -f *.o portmap pmap_dump pmap_set from_local \
diff --git a/portmap.tar.gz b/portmap.tar.gz
new file mode 100644
index 0000000..e517542
--- /dev/null
+++ b/portmap.tar.gz
Binary files differ
diff --git a/portmap.url b/portmap.url
new file mode 100644
index 0000000..6b2aff3
--- /dev/null
+++ b/portmap.url
@@ -0,0 +1 @@
+http://neil.brown.name/portmap/portmap-6.0.tgz
diff --git a/portmap.version b/portmap.version
new file mode 100644
index 0000000..e0ea36f
--- /dev/null
+++ b/portmap.version
@@ -0,0 +1 @@
+6.0