--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/xattr/Makefile Tue Apr 29 13:36:45 2014 -0700
@@ -0,0 +1,85 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../../make-rules/shared-macros.mk
+
+COMPONENT_NAME= xattr
+COMPONENT_VERSION= 0.7.4
+COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH= \
+ sha256:16c612ac01b9b5a31967e231c7f7d32b7263f151d5e3c617c69378170054805f
+COMPONENT_ARCHIVE_URL= $(call pypi_url)
+COMPONENT_PROJECT_URL= http://github.com/xattr/xattr
+COMPONENT_BUGDB= python-mod/xattr
+
+include $(WS_TOP)/make-rules/prep.mk
+include $(WS_TOP)/make-rules/setup.py.mk
+include $(WS_TOP)/make-rules/ips.mk
+
+ASLR_MODE = $(ASLR_NOT_APPLICABLE)
+
+# Look over into the pycparser and cffi proto areas until they're available in
+# the build environment. Make sure that cffi is built.
+PYCPARSER = $(WS_COMPONENTS)/python/pycparser/build/prototype/$(MACH)/$(PYTHON_LIB)
+CFFI = $(WS_COMPONENTS)/python/cffi/build/prototype/$(MACH)/$(PYTHON_LIB)
+
+$(CFFI):
+ (cd ../cffi; $(MAKE) install)
+
+PYTHONPATH_DEP = $(PYCPARSER):$(CFFI)
+COMPONENT_BUILD_ENV += PYTHONPATH=$(PYTHONPATH_DEP)
+COMPONENT_INSTALL_ENV += PYTHONPATH=$(PYTHONPATH_DEP):$(PROTO_DIR)/$(PYTHON_LIB)
+COMPONENT_TEST_ENV += PYTHONPATH=$(PYTHONPATH_DEP):$(PROTO_DIR)/$(PYTHON_LIB)
+# The test suite wants to use some unicode filenames, which don't work in the C
+# locale.
+COMPONENT_TEST_ENV += LC_CTYPE=en_US.UTF-8
+COMPONENT_TEST_DIR = $(@D)/tests
+COMPONENT_TEST_CMD = $(PYTHON) setup.py
+COMPONENT_TEST_ARGS = test
+
+COMPONENT_POST_INSTALL_ACTION += \
+ (cd $(PROTO_DIR)/usr/bin; $(MV) xattr xattr-$(PYTHON_VERSION))
+
+# Tests run under setuptools work very hard to run in the source directory
+# itself, and will thus blow up with an VerificationError (wrong ELF class)
+# when running 64-bit tests after 32-bit or vice-versa. So copy the source off
+# to a target-specific directory and run the tests. Note that this will also
+# rebuild the package, since it doesn't want to use what it should already be
+# finding in PYTHONPATH.
+COMPONENT_PRE_TEST_ACTION = $(CP) -r $(SOURCE_DIR) $(@D)/tests
+
+$(BUILD_32_and_64): $(CFFI)
+
+# common targets
+build: $(BUILD_32_and_64)
+
+install: $(INSTALL_32_and_64)
+
+test: $(TEST_32_and_64)
+
+BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
+
+include $(WS_TOP)/make-rules/depend.mk