Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0c9bf02
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,131 @@
+#
+#    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 make file for libnl, a library for
+#      applications dealing with Linux netlink sockets. The library
+#      provides an interface for raw netlink messaging and various
+#      netlink family specific interfaces.
+#
+
+
+include pre.mak
+
+PackageName		:= libnl
+
+PackageExtension	:= tar.gz
+PackageSeparator	:= -
+
+PackagePatchArgs	:= -p1
+
+PackageArchive		:= $(PackageName).$(PackageExtension)
+PackageSourceDir	:= $(PackageName)$(PackageSeparator)$(PackageVersion)
+
+PackageBuildMakefile	= $(call GenerateBuildPaths,Makefile)
+
+LicenseSourceFile	:= $(PackageSourceDir)/COPYING
+
+CleanPaths		+= $(PackageLicenseFile)
+
+LinuxIncDir		:= $(call GenerateResultPaths,sw/tps/linux,include)
+
+SOURCEDIRS                      = $(PackageSourceDir)
+$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(LicenseSourceFile): $(BuildDirectory)/source
+
+$(PackageLicenseFile): $(LicenseSourceFile)
+	$(copy-result)
+
+# 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.
+
+# Configure the source for building.
+
+$(BuildDirectory)/configure: $(BuildDirectory)/source | $(PackageSourceDir) $(BuildDirectory) $(ResultDirectory)
+	$(Verbose)cd $(BuildDirectory) && \
+	$(CURDIR)/$(PackageSourceDir)/configure \
+	CC="$(CC)" CXX="$(CXX)" AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	CPPFLAGS="-I$(LinuxIncDir)" \
+	--build=$(HostTuple) \
+	--host=$(TargetTuple) \
+	--prefix=/usr \
+	--sysconfdir=/etc \
+	--localstatedir=/var \
+	--disable-static
+	$(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) \
+	all
+	$(Verbose)touch $@
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+#
+# We explictly remove 'libfoo.la' because some packages that depend on
+# these libraries use libtool. If libtool finds a 'libfoo.la' file for
+# a library, it uses the value of 'libdir=<dir>' it finds. In our
+# case, since '--prefix=/usr' this value is '/usr/lib'. It then
+# resolves '-lfoo'. In a cross-compilation environment, this is likely
+# to be neither the right architecture nor the right version to link
+# against. In short, we lose.
+#
+# We could also handle this by removing DESTDIR and setting the prefix
+# to $(ResultDirectory); however, that results in libtool hard-coding
+# $(ResultDirectory) as the RPATH in the linked executables which is
+# NOT what we want either. We lose again.
+#
+# By removing the '*.la' file, we win by ensuring neither a misdirected
+# link nor an RPATH.
+
+$(BuildDirectory)/stage: $(BuildDirectory)/build | $(ResultDirectory)
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	DESTDIR=$(ResultDirectory) \
+	install
+	$(Verbose)$(RM) $(RMFLAGS) $(call GenerateResultPaths,,$(addprefix usr/lib/,libnl.la libnl-nf.la libnl-genl.la libnl-route.la libnl-cli.la))
+	$(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/libnl.patches/libnl-50.description b/libnl.patches/libnl-50.description
new file mode 100644
index 0000000..9cc7d22
--- /dev/null
+++ b/libnl.patches/libnl-50.description
@@ -0,0 +1,2 @@
+This patch ensures that the build picks up the auto-generated header file
+pktloc_syntax.h.
diff --git a/libnl.patches/libnl-50.patch b/libnl.patches/libnl-50.patch
new file mode 100644
index 0000000..525a6d3
--- /dev/null
+++ b/libnl.patches/libnl-50.patch
@@ -0,0 +1,12 @@
+diff -aruN a/lib/Makefile.in b/lib/Makefile.in
+--- a/lib/Makefile.in	2010-10-13 07:50:57.000000000 -0700
++++ b/lib/Makefile.in	2010-11-15 15:57:54.885153794 -0800
+@@ -254,7 +254,7 @@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-AM_CPPFLAGS = -Wall -I${top_srcdir}/include -I${top_builddir}/include -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)/libnl\"
++AM_CPPFLAGS = -Wall -I${top_srcdir}/include -I${top_builddir}/include -I${builddir}/route -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)/libnl\"
+ lib_LTLIBRARIES = \
+ 	libnl.la libnl-genl.la libnl-route.la libnl-nf.la
+ 
diff --git a/libnl.patches/libnl-51.description b/libnl.patches/libnl-51.description
new file mode 100644
index 0000000..242686c
--- /dev/null
+++ b/libnl.patches/libnl-51.description
@@ -0,0 +1,7 @@
+Was getting this build error:
+/home/bamboo/bamboo-agent-home/xml-data/build-dir/STESTS-ECIC-JOB1/production/sw/tps/libnl/libnl-2.0/lib/route/pktloc.c:39: fatal error: pktloc_syntax.h: No such file or directoryI
+
+Related to parallel build.
+
+Looks like part of this should fix it:
+http://patchwork.openembedded.org/patch/12583/
diff --git a/libnl.patches/libnl-51.patch b/libnl.patches/libnl-51.patch
new file mode 100644
index 0000000..406d97c
--- /dev/null
+++ b/libnl.patches/libnl-51.patch
@@ -0,0 +1,24 @@
+diff -Naur a/lib/Makefile.in b/lib/Makefile.in
+--- a/lib/Makefile.in	2015-03-13 22:44:43.967266167 -0700
++++ b/lib/Makefile.in	2015-03-13 22:47:05.496603070 -0700
+@@ -301,7 +301,7 @@
+ 	\
+ 	route/pktloc_syntax.c route/pktloc_grammar.c route/pktloc.c
+ 
+-all: defs.h
++all: defs.h route/pktloc_syntax.h route/pktloc_grammar.h
+ 	$(MAKE) $(AM_MAKEFLAGS) all-am
+ 
+ .SUFFIXES:
+@@ -977,9 +977,11 @@
+ 
+ # Hack to avoid using ylwrap. It does not function correctly in combination
+ # with --header-file=
++route/pktloc_grammar.h: route/pktloc_grammar.c
+ route/pktloc_grammar.c: route/pktloc_grammar.l
+ 	$(LEX) --header-file=route/pktloc_grammar.h $(LFLAGS) -o $@ $^
+ 
++route/pktloc_syntax.h: route/pktloc_syntax.c
+ route/pktloc_syntax.c: route/pktloc_syntax.y
+ 	$(YACC) -d $(YFLAGS) -o $@ $^
+ 
diff --git a/libnl.tar.gz b/libnl.tar.gz
new file mode 100644
index 0000000..58a3c07
--- /dev/null
+++ b/libnl.tar.gz
Binary files differ
diff --git a/libnl.url b/libnl.url
new file mode 100644
index 0000000..cd1dcda
--- /dev/null
+++ b/libnl.url
@@ -0,0 +1 @@
+http://www.infradead.org/~tgr/libnl/files/libnl-2.0.tar.gz
diff --git a/libnl.version b/libnl.version
new file mode 100644
index 0000000..cd5ac03
--- /dev/null
+++ b/libnl.version
@@ -0,0 +1 @@
+2.0