Andrzej Szeszo
2013-06-04 453bf5a3004107204e1858532a38b3e703e32995
commit | author | age
59c102 1 #
AC 2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20
21 #
ad2fa3 22 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
59c102 23 #
AC 24
25 include ../../make-rules/shared-macros.mk
26
27 COMPONENT_NAME=        pylint
dd7055 28 COMPONENT_VERSION=    0.25.2
59c102 29 COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
AC 30 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.gz
35e110 31 COMPONENT_ARCHIVE_HASH=    \
dd7055 32     sha256:757f2b97071a87fb7e4d017fc7c9eb74f26dcf412e683b614d3c5d54b217212d
AC 33 COMPONENT_ARCHIVE_URL=    http://download.logilab.org/pub/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
59c102 34 COMPONENT_PROJECT_URL=  http://www.logilab.org/project/pylint/
3b89c9 35 COMPONENT_BUGDB=    utility/pylint
59c102 36
AC 37 include $(WS_TOP)/make-rules/prep.mk
38 include $(WS_TOP)/make-rules/ips.mk
39 include $(WS_TOP)/make-rules/setup.py.mk
40
e3b3f6 41 # There are several pylint documentation files that setup.py isn't installing
RB 42 # but are present in the pylint package on other distributions. Copy them into
43 # the proto area "manually", so they can be included in the package.
44 PDOC =            $(PROTO_DIR)/usr/share/doc
45 PDOC_PYLINT =        $(PDOC)/pylint
46 PDOC_PYLINT_EXAMPLES =    $(PDOC_PYLINT)/examples
47
48 COMPONENT_POST_INSTALL_ACTION += \
49     $(MKDIR) $(PDOC_PYLINT) ;
50 COMPONENT_POST_INSTALL_ACTION += \
51     $(CP) $(COMPONENT_SRC)/doc/beginner_pylint_tutorial.txt $(PDOC_PYLINT) ;
52 COMPONENT_POST_INSTALL_ACTION += \
53     $(CP) $(COMPONENT_SRC)/doc/FAQ.txt $(PDOC_PYLINT) ;
54 COMPONENT_POST_INSTALL_ACTION += \
55     $(CP) $(COMPONENT_SRC)/doc/features.txt $(PDOC_PYLINT) ;
56 COMPONENT_POST_INSTALL_ACTION += \
57     $(CP) $(COMPONENT_SRC)/doc/manual.txt $(PDOC_PYLINT) ;
58 COMPONENT_POST_INSTALL_ACTION += \
59     $(CP) $(COMPONENT_SRC)/doc/quickstart.txt $(PDOC_PYLINT) ;
60 COMPONENT_POST_INSTALL_ACTION += \
61     $(CP) $(COMPONENT_SRC)/README $(PDOC_PYLINT) ;
62
63 COMPONENT_POST_INSTALL_ACTION += \
64     $(MKDIR) $(PDOC_PYLINT_EXAMPLES) ;
65 COMPONENT_POST_INSTALL_ACTION += \
66     $(CP) $(COMPONENT_SRC)/examples/custom.py $(PDOC_PYLINT_EXAMPLES) ;
67 COMPONENT_POST_INSTALL_ACTION += \
68     $(CP) $(COMPONENT_SRC)/examples/custom_raw.py $(PDOC_PYLINT_EXAMPLES) ;
69 COMPONENT_POST_INSTALL_ACTION += \
70     $(CP) $(COMPONENT_SRC)/elisp/pylint.el $(PDOC_PYLINT_EXAMPLES) ;
71 COMPONENT_POST_INSTALL_ACTION += \
72     $(CP) $(COMPONENT_SRC)/examples/pylintrc_camelcase $(PDOC_PYLINT_EXAMPLES) ;
73 COMPONENT_POST_INSTALL_ACTION += \
74     $(CP) $(COMPONENT_SRC)/examples/pylintrc $(PDOC_PYLINT_EXAMPLES) ;
7d22b7 75 COMPONENT_POST_INSTALL_ACTION += \
NJ 76     (cd $(PROTO_DIR)/usr/bin; $(MV) epylint epylint-$(PYTHON_VERSION)) ;
77 COMPONENT_POST_INSTALL_ACTION += \
78     (cd $(PROTO_DIR)/usr/bin; $(MV) pylint pylint-$(PYTHON_VERSION)) ;
79 COMPONENT_POST_INSTALL_ACTION += \
80     (cd $(PROTO_DIR)/usr/bin; $(MV) pylint-gui pylint-gui-$(PYTHON_VERSION)) ;
81 COMPONENT_POST_INSTALL_ACTION += \
82     (cd $(PROTO_DIR)/usr/bin; $(MV) pyreverse pyreverse-$(PYTHON_VERSION)) ;
83 COMPONENT_POST_INSTALL_ACTION += \
84     (cd $(PROTO_DIR)/usr/bin; $(MV) symilar symilar-$(PYTHON_VERSION)) ;
e3b3f6 85
RB 86
59c102 87 # common targets
AC 88
ad2fa3 89 build:        $(BUILD_NO_ARCH)
59c102 90
ad2fa3 91 install:    $(INSTALL_NO_ARCH)
59c102 92
dd7055 93 # The tests are run using python 2.7 only and require that
AC 94 # the python-27 package is installed (does not have to be the default python). 
95 # Testing using python-26 is done manually, since it requires
96 # downloading and installing the unittest2 component (not part of Solaris),
97 # which provides python 2.7 functionality to the unittest python library
98 # in the python2.6 package.
99
100 # Use the python 2.7 libraries for testing.
101 test: PYTHON_VERSION=2.7
102
103 # logilab-common and logilab-astng are runtime dependencies of pylint,
104 # and we need to use their latest versions from this workspace.
105 # We can't just add their install targets as dependencies here,
106 # so just "gmake install" in the logilab-common and logilab-astng
107 # component directories before running the pylint tests.
108 COMPONENT_PRE_TEST_ACTION = ($(GMAKE) -C \
109     $(COMPONENT_DIR)/../logilab-common install; \
110     $(GMAKE) -C $(COMPONENT_DIR)/../logilab-astng install )
111
112 COMPONENT_TEST_ENV = PYTHONPATH=$(COMPONENT_DIR)/../logilab-common/build/prototype/$(MACH)$(PYTHON_VENDOR_PACKAGES):$(COMPONENT_DIR)/../logilab-astng/build/prototype/$(MACH)$(PYTHON_VENDOR_PACKAGES):$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
113
114 # Run pytest-2.7 from logilab-common's proto area for now, until the 
115 # new version of logilab-common containing pytest is in CBE.
116 # Then we can change it to /usr/bin/pytest-$(PYTHON_VERSION).
117 COMPONENT_TEST_CMD = $(COMPONENT_DIR)/../logilab-common/build/prototype/$(MACH)/usr/bin/pytest-$(PYTHON_VERSION)
118 COMPONENT_TEST_ARGS =
119
120 # Expected failures for test target:
121 # 799 test cases, 4 errors, 6 failures, 4 skipped
122 # 9 modules OK (2 failed)
123 # failures: smoketest [7/14], unittest_lint [3/21]
124
ad2fa3 125 test:        $(TEST_NO_ARCH)
59c102 126
AC 127 BUILD_PKG_DEPENDENCIES =    $(BUILD_TOOLS)
128
129 include $(WS_TOP)/make-rules/depend.mk