Allow multiple values for package_data in setup.cfg (#11805).

Even though the resources system obsoletes data_files and package_data
(see bug discussion), package_data still exists to allow compatibility
with distutils and thus an easier transition.  In setup.py, the values
are lists of glob patterns, so the setup.cfg syntax needed a way to
express multiple values too.

Doc for this option will be added later as part of the big packaging doc
patches.  For now, the test serves as example.

Reported by Erik Bray.
diff --git a/Lib/packaging/config.py b/Lib/packaging/config.py
index 366faea..ab026a8 100644
--- a/Lib/packaging/config.py
+++ b/Lib/packaging/config.py
@@ -20,7 +20,6 @@
     if '.' not in name:
         return
     parts = name.split('.')
-    modname = parts[-1]
     parent = '.'.join(parts[:-1])
     if parent not in packages:
         # we could log a warning instead of raising, but what's the use
@@ -227,13 +226,25 @@
                 self.dist.scripts = [self.dist.scripts]
 
             self.dist.package_data = {}
+            # bookkeeping for the loop below
+            firstline = True
+            prev = None
+
             for line in files.get('package_data', []):
-                data = line.split('=')
-                if len(data) != 2:
-                    raise ValueError('invalid line for package_data: %s '
-                                     '(misses "=")' % line)
-                key, value = data
-                self.dist.package_data[key.strip()] = value.strip()
+                if '=' in line:
+                    # package name -- file globs or specs
+                    key, value = line.split('=')
+                    prev = self.dist.package_data[key.strip()] = value.split()
+                elif firstline:
+                    # invalid continuation on the first line
+                    raise PackagingOptionError(
+                        'malformed package_data first line: %r (misses "=")' %
+                        line)
+                else:
+                    # continuation, add to last seen package name
+                    prev.extend(line.split())
+
+                firstline = False
 
             self.dist.data_files = []
             for data in files.get('data_files', []):