PEL: Create python package for msg registry

There is, or rather soon will be, a python tool to decode PELs that runs
on platforms other than the BMC.  It needs access to the message
registry so it can display an error message for a PEL created by the
BMC.

To support this, create a python package called pel-message-registry
that will hold the message registry and component name files and provide
functions to access them:

import pel_registry

reg = pel_registry.get_registry_path()
compIDs = pel_registry.get_comp_id_file_path(creatorID)

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I5aa2ddc27e74aa81485c87141569ebef2901c800
diff --git a/extensions/openpower-pels/setup.py b/extensions/openpower-pels/setup.py
new file mode 100644
index 0000000..c04678e
--- /dev/null
+++ b/extensions/openpower-pels/setup.py
@@ -0,0 +1,27 @@
+from setuptools import setup
+import os
+import shutil
+
+# Builds the message registry and other data files into a python package
+
+# Copy the msg registry and comp IDs files into the subdir with
+# the __init__.py before building the package so they can reside in
+# ../site-packages/pel_registry/ instead of site-packages/registry.
+this_dir = os.path.dirname(__file__)
+target_dir = os.path.join(this_dir, 'pel_registry')
+shutil.copy(os.path.join(
+    this_dir, 'registry/message_registry.json'), target_dir)
+shutil.copy(os.path.join(this_dir, 'registry/O_component_ids.json'),
+            target_dir)
+shutil.copy(os.path.join(this_dir, 'registry/B_component_ids.json'),
+            target_dir)
+
+setup(
+    name="pel_message_registry",
+    version="1.0",
+    classifiers=["License :: OSI Approved :: Apache Software License"],
+    packages=['pel_registry'],
+    package_data={'': ['message_registry.json',
+                       'O_component_ids.json',
+                       'B_component_ids.json']},
+)