Makefile revision 3996
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# CDDL HEADER START
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# The contents of this file are subject to the terms of the
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# Common Development and Distribution License (the "License").
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# You may not use this file except in compliance with the License.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# or http://www.opensolaris.org/os/licensing.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# See the License for the specific language governing permissions
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# and limitations under the License.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# When distributing Covered Code, include this CDDL HEADER in each
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# If applicable, add the following below this CDDL HEADER, with the
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# fields enclosed by brackets "[]" replaced with your own identifying
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# information: Portions Copyright [yyyy] [name of copyright owner]
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# CDDL HEADER END
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff#
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graffinclude ../../../make-rules/shared-macros.mk
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_NAME= xattr
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_VERSION= 0.7.4
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
0b14ebe3132846e91bea02992493e3d506233e76Michael GraffCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_ARCHIVE_HASH= \
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff sha256:16c612ac01b9b5a31967e231c7f7d32b7263f151d5e3c617c69378170054805f
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_ARCHIVE_URL= $(call pypi_url)
8d1943e8ffa991d54c5406342e44d7134762e7eaMichael GraffCOMPONENT_PROJECT_URL= http://github.com/xattr/xattr
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_BUGDB= python-mod/xattr
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael GraffTPNO= 16912
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffinclude $(WS_MAKE_RULES)/prep.mk
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffinclude $(WS_MAKE_RULES)/setup.py.mk
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffinclude $(WS_MAKE_RULES)/ips.mk
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael GraffASLR_MODE = $(ASLR_NOT_APPLICABLE)
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff# Look over into the pycparser and cffi proto areas until they're available in
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff# the build environment. Make sure that cffi is built.
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael GraffPYCPARSER = $(WS_COMPONENTS)/python/pycparser/build/prototype/$(MACH)/$(PYTHON_LIB)
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCFFI = $(WS_COMPONENTS)/python/cffi/build/prototype/$(MACH)/$(PYTHON_LIB)
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael Graff
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff$(CFFI):
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff (cd ../cffi; $(MAKE) install)
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffPYTHONPATH_DEP = $(PYCPARSER):$(CFFI)
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael GraffCOMPONENT_BUILD_ENV += PYTHONPATH=$(PYTHONPATH_DEP)
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael GraffCOMPONENT_INSTALL_ENV += PYTHONPATH=$(PYTHONPATH_DEP):$(PROTO_DIR)/$(PYTHON_LIB)
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael GraffCOMPONENT_TEST_ENV += PYTHONPATH=$(PYTHONPATH_DEP):$(PROTO_DIR)/$(PYTHON_LIB)
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# The test suite wants to use some unicode filenames, which don't work in the C
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff# locale.
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael GraffCOMPONENT_TEST_ENV += LC_CTYPE=en_US.UTF-8
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_TEST_DIR = $(@D)/tests
d1ba6e9180c7d7458656a6e53e52fde056fd244cMichael GraffCOMPONENT_TEST_CMD = $(PYTHON) setup.py
d1ba6e9180c7d7458656a6e53e52fde056fd244cMichael GraffCOMPONENT_TEST_ARGS = test
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_POST_INSTALL_ACTION += \
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff (cd $(PROTO_DIR)/usr/bin; $(MV) xattr xattr-$(PYTHON_VERSION))
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# Tests run under setuptools work very hard to run in the source directory
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# itself, and will thus blow up with an VerificationError (wrong ELF class)
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# when running 64-bit tests after 32-bit or vice-versa. So copy the source off
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# to a target-specific directory and run the tests. Note that this will also
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# rebuild the package, since it doesn't want to use what it should already be
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff# finding in PYTHONPATH.
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffCOMPONENT_PRE_TEST_ACTION = $(CP) -r $(SOURCE_DIR) $(@D)/tests
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael Graff$(BUILD_32_and_64): $(CFFI)
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff# common targets
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffbuild: $(BUILD_32_and_64)
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graffinstall: $(INSTALL_32_and_64)
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Graff
1ec39fc7a8b6ad92de3363d4c50b75e24fcd6accMichael Grafftest: $(TEST_32_and_64)
d1ba6e9180c7d7458656a6e53e52fde056fd244cMichael Graff
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael Graff
ab0e5066083abcbec62513a3cc041d1f1eb9098aMichael GraffREQUIRED_PACKAGES += library/python/setuptools-26
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffREQUIRED_PACKAGES += library/python/setuptools-27
83f8c56f43852bf9a9c6964eae285284b23f9d8dMichael GraffREQUIRED_PACKAGES += library/python/setuptools-34
a8dcebd0419f27234664e89b9cd48bc54cad08a7Michael GraffREQUIRED_PACKAGES += system/library
d1ba6e9180c7d7458656a6e53e52fde056fd244cMichael Graff