Remove hack for building Python support with Bazel.

This change makes use of new imports attribute for Bazel's Python rules, which
enable adding directories to the PYTHONPATH. This allows us to remove
the hack for building protobuf's Python support with Bazel and now
allows projects to include protobuf using a Bazel external repository
rather than requiring it to be imported directly into the source tree as
//google/protobuf.

This change also updates the protobuf BUILD file to use a named
repository, @python//, for including Python headers rather than
//util/python. This allows projects to specify their own package for
Python headers when including protobuf with an external repository.

Fixes #1230
diff --git a/protobuf.bzl b/protobuf.bzl
index e5af333..71eaba2 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -117,10 +117,10 @@
         deps=[],
         cc_libs=[],
         include=None,
-        protoc="//google/protobuf:protoc",
+        protoc="//:protoc",
         internal_bootstrap_hack=False,
         use_grpc_plugin=False,
-        default_runtime="//google/protobuf:protobuf",
+        default_runtime="//:protobuf",
         **kargs):
   """Bazel rule to create a C++ protobuf library from proto source files
 
@@ -199,35 +199,6 @@
       includes=includes,
       **kargs)
 
-def internal_copied_filegroup(
-        name,
-        srcs,
-        include,
-        **kargs):
-  """Bazel rule to fix sources file to workaround with python path issues.
-
-  Args:
-    name: the name of the internal_copied_filegroup rule, which will be the
-        name of the generated filegroup.
-    srcs: the source files to be copied.
-    include: the expected import root of the source.
-    **kargs: extra arguments that will be passed into the filegroup.
-  """
-  outs = [_RelativeOutputPath(s, include) for s in srcs]
-
-  native.genrule(
-      name=name+"_genrule",
-      srcs=srcs,
-      outs=outs,
-      cmd=" && ".join(["cp $(location %s) $(location %s)" %
-                       (s, _RelativeOutputPath(s, include))
-                       for s in srcs]))
-
-  native.filegroup(
-      name=name,
-      srcs=outs,
-      **kargs)
-
 def py_proto_library(
         name,
         srcs=[],
@@ -235,8 +206,8 @@
         py_libs=[],
         py_extra_srcs=[],
         include=None,
-        default_runtime="//google/protobuf:protobuf_python",
-        protoc="//google/protobuf:protoc",
+        default_runtime="//:protobuf_python",
+        protoc="//:protoc",
         **kargs):
   """Bazel rule to create a Python protobuf library from proto source files
 
@@ -276,15 +247,6 @@
       visibility=["//visibility:public"],
   )
 
-  if include != None:
-    # Copy the output files to the desired location to make the import work.
-    internal_copied_filegroup_name=name + "_internal_copied_filegroup"
-    internal_copied_filegroup(
-        name=internal_copied_filegroup_name,
-        srcs=outs,
-        include=include)
-    outs=[internal_copied_filegroup_name]
-
   if default_runtime and not default_runtime in py_libs + deps:
     py_libs += [default_runtime]
 
@@ -292,6 +254,7 @@
       name=name,
       srcs=outs+py_extra_srcs,
       deps=py_libs+deps,
+      imports=includes,
       **kargs)
 
 def internal_protobuf_py_tests(
@@ -308,8 +271,7 @@
 
   """
   for m in modules:
-    s = _RelativeOutputPath(
-        "python/google/protobuf/internal/%s.py" % m, "python")
+    s = "python/google/protobuf/internal/%s.py" % m
     native.py_test(
         name="py_%s" % m,
         srcs=[s],