Project = php
ProjectName = apache_mod_php
UserType = Developer
ToolType = Commands
Submission = 53.4
Environment = YACC=/usr/local/bin/bison-1.28 \
php_cv_bison_version=1.28 \
LEX=/usr/local/bin/lex-2.5.4 \
MAKEOBJDIR="$(BuildDirectory)" \
INSTALL_ROOT="$(DSTROOT)" \
TMPDIR="$(TMPDIR)" TEMPDIR="$(TMPDIR)"
Extra_Configure_Environment = CFLAGS="$$RC_CFLAGS -Os -g" \
LDFLAGS="$$RC_CFLAGS -Os -g" \
EXTRA_LIBS="-lresolv" \
EXTRA_LDFLAGS_PROGRAM="-mdynamic-no-pic"
Extra_Configure_Flags = --sysconfdir=$(ETCDIR) \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/usr \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir=$(DSTROOT)/usr/local \
--with-png-dir=$(DSTROOT)/usr/local \
--enable-gd-native-ttf \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-iodbc=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg --enable-sysvsem --enable-sysvshm \
--enable-wddx \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--enable-zend-multibyte \
--enable-zip
ifneq ($(strip $(wildcard /usr/local/include/pcre.*)),)
Extra_Configure_Flags += --with-pcre-regex=/usr
endif
CommonNoInstallSource = YES
AEP = YES
AEP_Version = 5.3.4
AEP_LicenseFile = $(Sources)/LICENSE
AEP_Patches = MacOSX_build.patch arches.patch \
iconv.patch mysql_sock.patch pear.patch phar.patch
AEP_ConfigDir = $(ETCDIR)
AEP_ManPages = pear.1 phar.1 phar.phar.1
Dependencies = libjpeg libpng
GnuAfterInstall = install-macosx
PROJECT_FILES = Makefile AEP.make $(ProjectName).plist $(AEP_ManPages)
.PHONY: do_installsrc post-extract-source build-dependencies $(GnuAfterInstall)
include $(MAKEFILEPATH)/CoreOS/ReleaseControl/GNUSource.make
include AEP.make
BuildDirectory = $(OBJROOT)/Build/$(AEP_Project)
Install_Target = install
TMPDIR = $(OBJROOT)/Build/tmp
Install_Flags = DESTDIR="$(DSTROOT)"
$(GNUConfigStamp): post-extract-source build-dependencies
install_source:: do_installsrc
do_installsrc:
@echo "Installing $(ProjectName) sources in $(SRCROOT)..."
-$(RMDIR) $(SRCROOT)
$(MKDIR) $(SRCROOT)
$(CP) $(PROJECT_FILES) $(SRCROOT)
$(CP) $(AEP_Filename) $(SRCROOT)
ifdef Dependencies
$(CP) $(Dependencies) $(SRCROOT)
endif
ifdef SubProjects
$(CP) $(SubProjects) $(SRCROOT)
endif
ifdef AEP_Patches
$(MKDIR) $(SRCROOT)/patches
for patchfile in $(AEP_Patches); do \
$(CP) patches/$$patchfile $(SRCROOT)/patches; \
done
endif
$(CP) patches/pearcmd.patch $(SRCROOT)/patches
build-dependencies: $(TMPDIR)
$(_v) for Dependency in $(Dependencies); do \
$(MAKE) -C $${Dependency} $(TARGET) \
SRCROOT=$(SRCROOT)/$${Dependency} \
OBJROOT=$(OBJROOT) \
SYMROOT=$(SYMROOT) \
DSTROOT=$(DSTROOT) \
BuildDirectory=$(OBJROOT)/Build/$${Dependency} \
Sources=$(OBJROOT)/$${Dependency} \
CoreOSMakefiles=$(CoreOSMakefiles); \
done
post-extract-source: extract-source
@echo "Executing extra patch after extraction..."
$(PERL) -i -pe 's|-i -a -n php5|-i -n php5|g' $(Sources)/configure
PEAR = $(DSTROOT)$(USRBINDIR)/php -C -q \
-n -d include_path=$(DSTROOT)$(USRLIBDIR)/php $(PEAR_Cmd)
PEAR_Cmd = $(TMPDIR)/pearcmd.php
install-macosx:
@echo "Cleaning up install for Mac OS X..."
-$(RMDIR) $(DSTROOT)$(ETCDIR)/apache2
$(CHOWN) -R root:wheel $(DSTROOT)/
$(INSTALL_FILE) $(Sources)/php.ini-production $(DSTROOT)$(AEP_ConfigDir)/php.ini.default
$(PERL) -i -pe 's|^extension_dir =.*|extension_dir = /usr/lib/php/extensions/no-debug-non-zts-20060613|' $(DSTROOT)$(AEP_ConfigDir)/php.ini.default
@echo "$(INSTALL_DIRECTORY) $(DSTROOT)/usr/lib/php/extensions/no-debug-non-zts-20060613"
@echo "Removing references to DSTROOT in php-config and include files..."
$(CP) $(DSTROOT)$(USRBINDIR)/php-config $(SYMROOT)/php-config \
&& $(SED) -e 's=-L$(DSTROOT)$(USRDIR)/local/lib==' $(SYMROOT)/php-config \
| $(SED) -e 's@$(DSTROOT)@@g' > $(DSTROOT)$(USRBINDIR)/php-config
$(CP) $(DSTROOT)$(USRINCLUDEDIR)/$(Project)/main/build-defs.h $(SYMROOT) \
&& $(SED) -e 's@$(DSTROOT)@@g' $(SYMROOT)/build-defs.h \
> $(DSTROOT)$(USRINCLUDEDIR)/$(Project)/main/build-defs.h
@echo "Archiving and stripping binaries..."
if [ ! -d $(SYMROOT) ]; then \
$(MKDIR) -m 755 $(SYMROOT); \
fi
$(_v) for file in "$(DSTROOT)`/usr/sbin/apxs -q LIBEXECDIR`/"*.so $(DSTROOT)/usr/bin/php; \
do \
$(CP) $${file} $(SYMROOT); \
$(DSYMUTIL) --out=$(SYMROOT)/$${file##*/}.dSYM $${file}; \
$(STRIP) -S $${file}; \
done
-$(MV) $(DSTROOT)$(USRDIR)/local/lib/* $(SYMROOT)
@echo "Deleting private dependencies..."
-$(RMDIR) $(DSTROOT)$(USRDIR)/local/lib
-$(RMDIR) $(DSTROOT)$(USRDIR)/local/include
@echo "Fixing PEAR configuration file..."
if [ -e $(DSTROOT)/$(USRLIBDIR)/php/pearcmd.php ]; then \
$(CP) $(DSTROOT)/$(USRLIBDIR)/php/pearcmd.php $(PEAR_Cmd); \
$(PATCH) -l $(PEAR_Cmd) $(SRCROOT)/patches/pearcmd.patch; \
$(PEAR) -C $(DSTROOT)$(ETCDIR)/pear.conf config-set \
cache_dir /tmp/pear/cache system; \
$(PEAR) -C $(DSTROOT)$(ETCDIR)/pear.conf config-set \
download_dir /tmp/pear/download system; \
$(PEAR) -C $(DSTROOT)$(ETCDIR)/pear.conf config-set \
temp_dir /tmp/pear/temp system; \
fi
@echo "Cleaning up PEAR junk files..."
-$(RMDIR) $(DSTROOT)/usr/lib/php/test
-$(RM) -rf $(DSTROOT)/.channels \
$(DSTROOT)/.depdb \
$(DSTROOT)/.depdblock \
$(DSTROOT)/.filemap \
$(DSTROOT)/.lock \
$(DSTROOT)/.registry \
$(DSTROOT)/usr/lib/php/.lock \
$(DSTROOT)/usr/lib/php/.depdblock \
@echo "Mac OS X-specific cleanup complete."
$(DSTROOT) $(DSTROOT)$(ETCDIR) $(DSTROOT)/usr/libexec/apache2 $(TMPDIR):
$(MKDIR) $@