Fixup fromcvs/togit conversion
[pkgsrcv2.git] / lang / python25 / Makefile
1 # $NetBSD: Makefile,v 1.40 2012/05/13 09:00:43 obache Exp $
2
3 .include "dist.mk"
4
5 PKGNAME=        python25-${PY_DISTVERSION}
6 PKGREVISION=    3
7 CATEGORIES=     lang python
8
9 MAINTAINER=     pkgsrc-users@NetBSD.org
10 HOMEPAGE=       http://www.python.org/
11 COMMENT=        Interpreted, interactive, object-oriented programming language
12 LICENSE=        python-software-foundation
13
14 PKG_DESTDIR_SUPPORT=    user-destdir
15
16 CONFLICTS+=     python-[0-9]*
17
18 GNU_CONFIGURE=          yes
19 CONFIGURE_ARGS+=        --with-threads
20 CONFIGURE_ARGS+=        --enable-shared
21 CONFIGURE_ARGS+=        OPT=${CFLAGS:M*:Q}
22 CONFIGURE_ARGS+=        --with-system-ffi
23
24 LDFLAGS+=               -L${WRKSRC}
25
26 USE_LANGUAGES=          c c++
27
28 PTHREAD_OPTS+=  require
29 .include "../../mk/pthread.buildlink3.mk"
30 .if ${PTHREAD_TYPE} == "pth"
31 CONFIGURE_ARGS+=        --with-pth
32 .endif
33
34 .include "../../mk/bsd.prefs.mk"
35
36 # fdatasync()
37 LIBS.SunOS+=            -lrt
38
39 PY_VER_SUFFIX=          2.5
40
41 PLIST_SRC=      ${.CURDIR}/../../lang/python25/PLIST.common
42 .if exists(${.CURDIR}/../../lang/python25/PLIST.${OPSYS})
43 PLIST_SRC+=     ${.CURDIR}/../../lang/python25/PLIST.${OPSYS}
44 .endif
45
46 .if ${OPSYS} == "NetBSD"
47 PRIVILEGED_STAGES+=     clean
48 # XXX work around a botched autoconf check which ignores libintl
49 CONFIGURE_ENV+=         ac_cv_func_bind_textdomain_codeset=yes
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 CONFIGURE_ENV+= ac_cv_header_netpacket_packet_h=no
60 .elif ${OPSYS} == "HPUX"
61 PY_PLATNAME=    hp-ux11
62 .else
63 PY_PLATNAME=    ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
64 .endif
65 PLIST_SUBST+=   PY_PLATNAME=${PY_PLATNAME:Q}
66
67 PLIST_VARS+=    linux2
68 .if ${PY_PLATNAME} == "linux2"
69 PLIST.linux2=   yes
70 .endif
71
72 .if (${MACHINE_ARCH} == "alpha") || (${MACHINE_ARCH} == "amd64") || \
73     (${MACHINE_ARCH} == "sparc64") || (${MACHINE_ARCH} == "x86_64") || \
74     (defined(ABI) && ${ABI} == "64")
75 IS_64BIT_PLATFORM?=     yes
76 .else
77 IS_64BIT_PLATFORM?=     no
78 .endif
79
80 # the dl module isn't built for 64 bit archs
81 PLIST_VARS+=    dl
82 .if empty(IS_64BIT_PLATFORM:M[yY][eE][sS])
83 PLIST.dl=       yes
84 .endif
85
86 # builds additional modules if OpenSSL < 0.9.8
87 PLIST_VARS+=            openssl097
88 CHECK_BUILTIN.openssl:= yes
89 .include "../../security/openssl/builtin.mk"
90 CHECK_BUILTIN.openssl:= no
91 .if !empty(USE_BUILTIN.openssl:M[yY][eE][sS]) && \
92     !empty(BUILTIN_PKG.openssl:Mopenssl-0.9.[67]*)
93 PLIST.openssl097=       yes
94 .endif
95
96 # setup.py causes some modules to be built if the platform is *not* 64bit.
97 PLIST_VARS+=    extra-so
98 .if !empty(IS_64BIT_PLATFORM:M[nN][oO])
99 PLIST.extra-so= yes
100 .endif
101
102 # ossaudiodev is only available on x86 for the following platforms
103 PLIST_VARS+=    oss
104 .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && \
105     ${PY_PLATNAME} == "linux2"
106 PLIST.oss=      yes
107 .endif
108
109 # Make sure python modules can link correctly
110 .if ${OPSYS} == "Darwin"
111 INSTALL_UNSTRIPPED=     yes
112
113 .  if empty(OS_VERSION:M[1-9].*)
114 CFLAGS+=                -D_DARWIN_C_SOURCE
115 .  endif
116 .endif
117
118 PLIST_VARS+=    bsddb dll nis no-nis
119 .if ${OPSYS} == "IRIX"
120 .  if ${ABI} == "64"
121 PLIST.no-nis=   yes
122 .  else
123 PLIST.nis=      yes
124 .  endif
125 .else
126 .  include "../../mk/bdb.buildlink3.mk"
127 MAKE_ENV+=      PY_BDB_TYPE=${BDB_TYPE}
128 MAKE_ENV+=      PY_BDB_INCDIRS=${BUILDLINK_INCDIRS.${BDB_TYPE}:S,^,${BDBBASE}/,:Q}
129 MAKE_ENV+=      PY_BDB_LIBDIRS=${BDBBASE}/lib
130 PLIST.bsddb=    yes
131 PLIST.dll=      yes
132 .  if ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat)
133 PLIST.nis=      yes
134 .  else
135 PLIST.no-nis=   yes
136 .  endif
137 .endif
138
139 .if ${OPSYS} == "OSF1"
140 # configure complains about buggy getaddrinfo()
141 CONFIGURE_ARGS+=        --disable-ipv6
142 .endif
143
144 .if defined(BUILDLINK_TRANSFORM)
145 MAKE_ENV+=      PY_BDB_TRANSFORM=${BUILDLINK_TRANSFORM:Q}
146 .endif
147
148 PLIST_SUBST+=   PY_VER_SUFFIX=${PY_VER_SUFFIX:Q}
149
150 TEST_TARGET=    test
151 INSTALL_TARGET= altinstall
152
153 REPLACE_INTERPRETER+=   py25
154 REPLACE.py25.old=       .*python[^ ]*
155 REPLACE.py25.new=       ${PREFIX}/bin/python${PY_VER_SUFFIX}
156 REPLACE_FILES.py25=     Lib/*.py Lib/*/*.py Lib/*/*/*.py
157
158 post-extract:
159         ${MV} ${WRKSRC}/Lib/smtpd.py ${WRKSRC}/Lib/smtpd${PY_VER_SUFFIX}.py
160         ${MV} ${WRKSRC}/Tools/scripts/pydoc ${WRKSRC}/Tools/scripts/pydoc${PY_VER_SUFFIX}
161
162 .if ${OPSYS} == "HPUX"
163 post-install:
164         ${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.5.sl \
165                 ${DESTDIR}${PREFIX}/lib/libpython2.5.sl.1.0
166 .endif
167
168 USE_GNU_READLINE=                       yes
169 BUILDLINK_DEPMETHOD.readline=           build
170
171 .include "../../archivers/bzip2/buildlink3.mk"
172 .include "../../devel/gettext-lib/buildlink3.mk"
173 .include "../../devel/libffi/buildlink3.mk"
174 .include "../../devel/readline/buildlink3.mk"
175 .include "../../devel/zlib/buildlink3.mk"
176 .include "../../security/openssl/buildlink3.mk"
177 .include "../../mk/dlopen.buildlink3.mk"
178 .include "../../mk/oss.buildlink3.mk"
179 .include "../../mk/bsd.pkg.mk"