update Sat Sep 12 18:37:00 PDT 2009
[pkgsrc.git] / lang / python25 / Makefile
1 # $NetBSD: Makefile,v 1.21 2009/09/12 22:24:06 tron Exp $
2
3 DISTNAME=       Python-2.5.4
4 PKGNAME=        python25-2.5.4
5 PKGREVISION=    3
6 CATEGORIES=     lang python
7 MASTER_SITES=   http://www.python.org/ftp/python/2.5.4/
8 EXTRACT_SUFX=   .tar.bz2
9
10 MAINTAINER=     recht@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:M*:Q}
24 CONFIGURE_ARGS+=        --with-system-ffi
25
26 LDFLAGS+=               -L${WRKSRC}
27
28 USE_LANGUAGES=          c c++
29
30 PTHREAD_OPTS+=  require
31 .include "../../mk/pthread.buildlink3.mk"
32 .if ${PTHREAD_TYPE} == "pth"
33 CONFIGURE_ARGS+=        --with-pth
34 .endif
35
36 .include "../../mk/bsd.prefs.mk"
37
38 # fdatasync()
39 LIBS.SunOS+=            -lrt
40
41 PY_VER_SUFFIX=          2.5
42
43 PLIST_SRC=      ${.CURDIR}/../../lang/python25/PLIST.common
44 .if exists(${.CURDIR}/../../lang/python25/PLIST.${OPSYS})
45 PLIST_SRC+=     ${.CURDIR}/../../lang/python25/PLIST.${OPSYS}
46 .endif
47
48 .if ${OPSYS} == "NetBSD"
49 PRIVILEGED_STAGES+=     clean
50 .endif
51
52 .if ${OPSYS} == "Darwin" || ${OPSYS} == "Interix"
53 PY_PLATNAME=    ${LOWER_OPSYS}
54 USE_TOOLS+=     gmake
55 .elif ${OPSYS} == "IRIX"
56 PY_PLATNAME=    ${LOWER_OPSYS:C/\..*//}
57 .elif ${OPSYS} == "SunOS"
58 PY_PLATNAME=    sunos${OS_VERSION:C/\..*//}
59 .elif ${OPSYS} == "HPUX"
60 PY_PLATNAME=    hp-ux11
61 .else
62 PY_PLATNAME=    ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
63 .endif
64 PLIST_SUBST+=   PY_PLATNAME=${PY_PLATNAME:Q}
65
66 .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "amd64") || \
67     (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "x86_64") || \
68     (defined(ABI) && ${ABI} == "64")
69 IS_64BIT_PLATFORM?=     yes
70 .else
71 IS_64BIT_PLATFORM?=     no
72 .endif
73
74 # the dl module isn't built for 64 bit archs
75 PLIST_VARS+=    dl
76 .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS])
77 PLIST.dl=       yes
78 .endif
79
80 # builds additional modules if OpenSSL < 0.9.8
81 PLIST_VARS+=            openssl097
82 CHECK_BUILTIN.openssl:= no
83 .include "../../security/openssl/builtin.mk"
84 CHECK_BUILTIN.openssl:= yes
85 .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) && \
86     !empty(BUILTIN_PKG.openssl:Mopenssl-0.9.[67]*)
87 PLIST.openssl097=       yes
88 .endif
89
90 # setup.py causes some modules to be built if the platform is *not* 64bit.
91 PLIST_VARS+=    extra-so
92 .if !empty(IS_64BIT_PLATFORM:M[nN][oO])
93 PLIST.extra-so= yes
94 .endif
95
96 # ossaudiodev is only available on x86 for the following platforms
97 PLIST_VARS+=    oss
98 .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
99     (${PY_PLATNAME} == "linux2" || ${OPSYS} == "FreeBSD")
100 PLIST.oss=      yes
101 .endif
102
103 # Make sure python modules can link correctly
104 .if ${OPSYS} == "Darwin"
105 INSTALL_UNSTRIPPED=     yes
106
107 .  if empty(OS_VERSION:M[1-9].*)
108 CFLAGS+=                -D_DARWIN_C_SOURCE
109 .  endif
110 .endif
111
112 PLIST_VARS+=    bsddb dll nis no-nis
113 .if ${OPSYS} == "IRIX"
114 .  if ${ABI} == "64"
115 PLIST.no-nis=   yes
116 .  else
117 PLIST.nis=      yes
118 .  endif
119 .else
120 .  include "../../mk/bdb.buildlink3.mk"
121 MAKE_ENV+=      PY_BDB_TYPE=${BDB_TYPE}
122 MAKE_ENV+=      PY_BDB_INCDIRS=${BUILDLINK_INCDIRS.${BDB_TYPE}:S,^,${BDBBASE}/,:Q}
123 MAKE_ENV+=      PY_BDB_LIBDIRS=${BDBBASE}/lib
124 PLIST.bsddb=    yes
125 PLIST.dll=      yes
126 .  if ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat)
127 PLIST.nis=      yes
128 .  else
129 PLIST.no-nis=   yes
130 .  endif
131 .endif
132
133 .if defined(BUILDLINK_TRANSFORM)
134 MAKE_ENV+=      PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q}
135 .endif
136
137 PLIST_SUBST+=   PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
138
139 TEST_TARGET=    test
140 INSTALL_TARGET= altinstall
141
142 REPLACE_INTERPRETER+=   py25
143 REPLACE.py25.old=       .*python[^ ]*
144 REPLACE.py25.new=       ${PREFIX}/bin/python${PY_VER_SUFFIX}
145 REPLACE_FILES.py25=     Lib/cgi.py      # explicitly demanded to be patched
146 REPLACE_FILES.py25+=    Lib/bsddb/dbshelve.py Lib/test/test_bz2.py
147 REPLACE_FILES.py25+=    Lib/test/test_largefile.py Lib/test/test_optparse.py
148
149 post-extract:
150         ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py
151         ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX}
152
153 .if ${OPSYS} == "HPUX"
154 post-install:
155         ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.5.sl \
156                 ${DESTDIR}${PREFIX}/lib/libpython2.5.sl.1.0
157 .endif
158
159 USE_GNU_READLINE=                       yes
160 BUILDLINK_DEPMETHOD.readline=           build
161
162 .include "../../archivers/bzip2/buildlink3.mk"
163 .include "../../devel/gettext-lib/buildlink3.mk"
164 .include "../../devel/libffi/buildlink3.mk"
165 .include "../../devel/readline/buildlink3.mk"
166 .include "../../devel/zlib/buildlink3.mk"
167 .include "../../security/openssl/buildlink3.mk"
168 .include "../../mk/dlopen.buildlink3.mk"
169 .include "../../mk/oss.buildlink3.mk"
170 .include "../../mk/bsd.pkg.mk"