update Sun Jan 17 06:37:00 PST 2010
[pkgsrc.git] / lang / python26 / Makefile
1 # $NetBSD: Makefile,v 1.17 2010/01/17 12:02:22 wiz Exp $
2
3 DISTNAME=       Python-2.6.4
4 PKGNAME=        ${DISTNAME:S/Python/python26/}
5 PKGREVISION=    3
6 CATEGORIES=     lang python
7 MASTER_SITES=   http://www.python.org/ftp/python/2.6.4/
8 EXTRACT_SUFX=   .tar.bz2
9
10 MAINTAINER=     pkgsrc-users@NetBSD.org
11 HOMEPAGE=       http://www.python.org/
12 COMMENT=        Interpreted, interactive, object-oriented programming language
13
14 PKG_DESTDIR_SUPPORT=    user-destdir
15
16 # Remember to update pkgsrc/lang/python/srcdist.mk when version changes
17
18 CONFLICTS+=     python-[0-9]*
19
20 GNU_CONFIGURE=          yes
21 CONFIGURE_ARGS+=        --with-threads
22 CONFIGURE_ARGS+=        --enable-shared
23 CONFIGURE_ARGS+=        OPT=${CFLAGS:Q}
24 CONFIGURE_ARGS+=        --with-system-ffi
25
26 LDFLAGS+=               -L${WRKSRC}
27
28 # $RANDOM usage there is fine
29 CHECK_PORTABILITY_SKIP= Tools/faqwiz/move-faqwiz.sh
30
31 USE_LANGUAGES=          c c++
32
33 PTHREAD_OPTS+=  require
34 .include "../../mk/pthread.buildlink3.mk"
35 .if ${PTHREAD_TYPE} == "pth"
36 CONFIGURE_ARGS+=        --with-pth
37 .endif
38
39 .include "../../mk/bsd.prefs.mk"
40
41 # fdatasync()
42 LIBS.SunOS+=            -lrt
43
44 PY_VER_SUFFIX=          2.6
45
46 PLIST_SRC=      ${.CURDIR}/../../lang/python26/PLIST.common
47 .if exists(${.CURDIR}/../../lang/python26/PLIST.${OPSYS})
48 PLIST_SRC+=     ${.CURDIR}/../../lang/python26/PLIST.${OPSYS}
49 .endif
50 PLIST_SRC+=     ${.CURDIR}/../../lang/python26/PLIST.common_end
51
52 .if ${OPSYS} == "NetBSD"
53 PRIVILEGED_STAGES+=     clean
54 .endif
55
56 .if ${OPSYS} == "Darwin" || ${OPSYS} == "Interix"
57 PY_PLATNAME=    ${LOWER_OPSYS}
58 USE_TOOLS+=     gmake
59 .elif ${OPSYS} == "IRIX"
60 PY_PLATNAME=    ${LOWER_OPSYS:C/\..*//}
61 .elif ${OPSYS} == "SunOS"
62 PY_PLATNAME=    sunos${OS_VERSION:C/\..*//}
63 .elif ${OPSYS} == "HPUX"
64 PY_PLATNAME=    hp-ux11
65 .else
66 PY_PLATNAME=    ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
67 .endif
68 PLIST_SUBST+=   PY_PLATNAME=${PY_PLATNAME:Q}
69
70 .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "amd64") || \
71     (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "x86_64") || \
72     (defined(ABI) && ${ABI} == "64")
73 IS_64BIT_PLATFORM?=     yes
74 .else
75 IS_64BIT_PLATFORM?=     no
76 .endif
77
78 # the dl module isn't built for 64 bit archs
79 PLIST_VARS+=    dl
80 .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS])
81 PLIST.dl=       yes
82 .endif
83
84 # builds additional modules if OpenSSL < 0.9.8
85 PLIST_VARS+=            openssl097
86 CHECK_BUILTIN.openssl:= no
87 .include "../../security/openssl/builtin.mk"
88 CHECK_BUILTIN.openssl:= yes
89 .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) && \
90     !empty(BUILTIN_PKG.openssl:Mopenssl-0.9.[67]*)
91 PLIST.openssl097=       yes
92 .endif
93
94 # setup.py causes some modules to be built if the platform is *not* 64bit.
95 PLIST_VARS+=    extra-so
96 .if !empty(IS_64BIT_PLATFORM:M[nN][oO])
97 PLIST.extra-so= yes
98 .endif
99
100 # ossaudiodev is only available on x86 for the following platforms
101 PLIST_VARS+=    oss
102 .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
103     (${PY_PLATNAME} == "linux2" || ${OPSYS} == "FreeBSD")
104 PLIST.oss=      yes
105 .endif
106
107 # Make sure python modules can link correctly
108 .if ${OPSYS} == "Darwin"
109 INSTALL_UNSTRIPPED=     yes
110
111 PLIST_VARS+=    nav
112 .  if ${ABI} != "64"
113 PLIST.nav=      yes
114 .  endif
115 .endif
116
117 PLIST_VARS+=    bsddb dll nis no-nis
118 .if ${OPSYS} == "IRIX"
119 .  if ${ABI} == "64"
120 PLIST.no-nis=   yes
121 .  else
122 PLIST.nis=      yes
123 .  endif
124 .else
125 .  include "../../mk/bdb.buildlink3.mk"
126 MAKE_ENV+=      PY_BDB_TYPE=${BDB_TYPE}
127 MAKE_ENV+=      PY_BDB_INCDIRS=${BUILDLINK_INCDIRS.${BDB_TYPE}:S,^,${BDBBASE}/,:Q}
128 MAKE_ENV+=      PY_BDB_LIBDIRS=${BDBBASE}/lib
129 .if empty(BDB_LIBS)
130 BUILDLINK_TRANSFORM+=   rm:-ldb
131 .endif
132 CFLAGS+=        -DHAVE_DB_185_H
133 PLIST.bsddb=    yes
134 PLIST.dll=      yes
135 .  if ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat)
136 PLIST.nis=      yes
137 .  else
138 PLIST.no-nis=   yes
139 .  endif
140 .endif
141
142 .if ${OPSYS} == "OSF1"
143 # configure complains about buggy getaddrinfo()
144 CONFIGURE_ARGS+=        --disable-ipv6
145 .endif
146
147 .if defined(BUILDLINK_TRANSFORM)
148 MAKE_ENV+=      PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q}
149 .endif
150
151 PLIST_SUBST+=   PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
152
153 TEST_TARGET=    test
154 INSTALL_TARGET= altinstall
155
156 REPLACE_INTERPRETER+=   py26
157 REPLACE.py26.old=       .*python[^ ]*
158 REPLACE.py26.new=       ${PREFIX}/bin/python${PY_VER_SUFFIX}
159 REPLACE_FILES.py26=     Lib/cgi.py      # explicitly demanded to be patched
160 REPLACE_FILES.py26+=    Lib/bsddb/dbshelve.py Lib/test/test_bz2.py
161 REPLACE_FILES.py26+=    Lib/test/test_largefile.py Lib/test/test_optparse.py
162
163 post-extract:
164         ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py
165         ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX}
166
167 .if ${OPSYS} == "HPUX"
168 post-install:
169         ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.6.sl \
170                 ${DESTDIR}${PREFIX}/lib/libpython2.6.sl.1.0
171 .endif
172
173 USE_GNU_READLINE=                       yes
174 BUILDLINK_DEPMETHOD.readline=           build
175
176 .include "../../archivers/bzip2/buildlink3.mk"
177 .include "../../devel/gettext-lib/buildlink3.mk"
178 .include "../../devel/libffi/buildlink3.mk"
179 .include "../../devel/readline/buildlink3.mk"
180 .include "../../devel/zlib/buildlink3.mk"
181 .include "../../security/openssl/buildlink3.mk"
182 .include "../../mk/dlopen.buildlink3.mk"
183 .include "../../mk/oss.buildlink3.mk"
184 .include "../../mk/bsd.pkg.mk"