summaryrefslogtreecommitdiff
path: root/package/php/Makefile
blob: 21bc36c8681cb40fc61f73d0077037869377d22e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# $Id$
#-
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include $(TOPDIR)/rules.mk

PKG_NAME:=		php
PKG_VERSION:=		5.2.9
PKG_RELEASE:=		1
PKG_MD5SUM:=		98b647561dc664adefe296106056cf11
MASTER_SITES:=		http://de.php.net/distributions/

include $(TOPDIR)/mk/package.mk

$(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE}))
$(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE}))

define PKG_mod_template

INSTALL_MODS_$${ADK_PACKAGE_${1}}+=    ${2}-install

${2}-install:
	${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
	${INSTALL_DATA} $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php

endef

PKG_CONFIGURE_OPTS:=	\
	--without-pear \
	--disable-spl \
	--with-config-file-path=/etc \
	--enable-magic-quotes \
	--disable-short-tags \
	--disable-ctype \
	--disable-dom \
	--enable-ftp=shared \
	--without-gettext \
	--without-iconv \
	--disable-libxml \
	--without-libxml-dir \
	--disable-mbstring \
	--disable-mbregex \
	--with-openssl=shared,"$(STAGING_DIR)/usr" \
	--with-kerberos=no \
	--with-openssl-dir="$(STAGING_DIR)/usr" \
	--enable-session=shared \
	--disable-simplexml \
	--disable-soap \
	--enable-sockets=shared \
	--disable-tokenizer \
	--disable-filter \
	--disable-xmlreader \
	--disable-xmlwriter \
	--with-zlib="$(STAGING_DIR)/usr" \
	--with-zlib-dir="$(STAGING_DIR)/usr" \
	--enable-cli \
	--enable-cgi \
	--enable-fastcgi \
	--enable-force-cgi-redirect \
	--enable-discard-path \

ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
PKG_CONFIGURE_OPTS+=	--with-curl=shared,"$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--without-curl
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
PKG_CONFIGURE_OPTS+=	--with-gd=shared,"$(STAGING_DIR)/usr" \
	--without-freetype-dir \
	--with-jpeg-dir="$(STAGING_DIR)/usr" \
	--with-png-dir="$(STAGING_DIR)/usr" \
	--without-xpm-dir \
	--without-ttf \
	--without-t1lib	\
	--enable-gd-native-ttf \
	--disable-gd-jis-conv
else
PKG_CONFIGURE_OPTS+=	--without-gd
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
PKG_CONFIGURE_OPTS+=	--with-gmp=shared,"$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--without-gmp
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
PKG_CONFIGURE_OPTS+=	--with-ldap=shared,"$(STAGING_DIR)/usr" \
	--with-ldap-sasl="$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--without-ldap
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
PKG_CONFIGURE_OPTS+=	--with-mysql=shared,"$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--without-mysql
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
PKG_CONFIGURE_OPTS+=	--with-pcre-regex=shared,"$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--without-pcre-regex
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
PKG_CONFIGURE_OPTS+=	--with-pgsql=shared,"$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--without-pgsql
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
PKG_CONFIGURE_OPTS+=	--without-sqlite
PKG_CONFIGURE_OPTS+=	--with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
PKG_CONFIGURE_OPTS+=	--enable-pdo=shared
else
PKG_CONFIGURE_OPTS+=	--without-sqlite
endif
ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
PKG_CONFIGURE_OPTS+=	--enable-xml=shared,"$(STAGING_DIR)/usr" \
	--with-libexpat-dir="$(STAGING_DIR)/usr"
else
PKG_CONFIGURE_OPTS+=	--disable-xml
endif

$(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_PCRE,php-mod-pcre,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-$(PKG_RELEASE)))
$(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-$(PKG_RELEASE)))

$(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
$(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
$(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
$(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
$(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
$(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
$(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
$(eval $(call PKG_mod_template,PHP_MOD_PCRE,pcre))
$(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
$(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
$(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
$(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo))
$(eval $(call PKG_mod_template,PHP_MOD_XML,xml))

TLDFLAGS+=		-L$(STAGING_DIR)/usr/lib/mysql
CONFIGURE_STYLE:=	gnu
CONFIGURE_ARGS+=	$(PKG_CONFIGURE_OPTS)
BUILD_STYLE:=		auto

do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
	${INSTALL_DIR} $(IDIR_PHP_CLI)/etc
	${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_CLI)/etc/
	${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
	${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
	${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc
	${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_FASTCGI)/etc/
	${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc/init.d
	${INSTALL_BIN} ./files/php.init \
		$(IDIR_PHP_FASTCGI)/etc/init.d/php
	${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/sbin
	${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi $(IDIR_PHP_FASTCGI)/usr/sbin/php

include ${TOPDIR}/mk/pkg-bottom.mk