123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- # $OpenBSD: Makefile.inc,v 1.94 2017/06/12 11:48:34 sthen Exp $
- BROKEN-hppa= no __sync_bool_compare_and_swap support nor asm fallback
- COMMENT-main= server-side HTML-embedded scripting language
- COMMENT-fastcgi= stand-alone FastCGI version of PHP
- PKGNAME-main?= php-${V}
- PKGNAME-fastcgi?= php-fastcgi-${V}
- DISTFILES?= php-${V}.tar.bz2
- DISTNAME?= php-${V}
- CATEGORIES= lang www
- MAINTAINER= Robert Nagy <robert@openbsd.org>
- HOMEPAGE= http://www.php.net/
- MASTER_SITES= http://se.php.net/distributions/ \
- http://us.php.net/distributions/ \
- http://no.php.net/distributions/ \
- http://uk.php.net/distributions/
- MASTER_SITES0= https://download.suhosin.org/
- # UPGRADERS: please read BOTH the PHP and Zend licenses
- # and make sure they are safe before an upgrade
- PERMIT_PACKAGE_CDROM= Yes
- MODULES+= gcc4
- # for atomic builtins
- MODGCC4_ARCHS+= arm
- MODGCC4_LANGS+= c++
- MODPHP_CONFIG_PATH= /var/www/conf
- # where the main php module is stored (outside the chroot)
- APACHE_MODULE_SUBDIR= lib/php-${PV}
- APACHE_MODULE_DIR= ${LOCALBASE}/${APACHE_MODULE_SUBDIR}
- # where the PEAR and extension modules are (inside the chroot)
- CHROOT_DIR?= /var/www
- MODULES_SUBDIR= lib/php-${PV}/modules
- MODULES_DIR= ${LOCALBASE}/${MODULES_SUBDIR}
- INI_TEMPLATES?= development production
- # XXX use the bundled libtool because it needs some specific options we
- # don't have.
- USE_LIBTOOL?= No
- .if ${PV} != "7.0"
- FLAVORS= no_suhosin
- .endif
- FLAVOR?=
- PATCHORIG= .orig.port
- CONFIGURE_STYLE= autoconf
- AUTOCONF_VERSION?= 2.69
- CONFIGURE_ENV+= CFLAGS="${CFLAGS} -I${LOCALBASE}/include -pthread" \
- LDFLAGS="-L${LOCALBASE}/lib -pthread" \
- EXTENSION_DIR=${MODULES_DIR} \
- LIBCXX="${LIBCXX}" \
- lt_cv_path_SED=/usr/bin/sed
- # configure detects us as having decimal fp support but it's not built in
- # in libgcc. https://bugs.php.net/bug.php?id=68114
- CONFIGURE_ENV+= ac_cv_decimal_fp_supported=no
- MAKE_ENV= ${CONFIGURE_ENV}
- CONFIGURE_ARGS+= --enable-shared \
- --disable-static \
- --disable-rpath \
- --with-config-file-path=${SYSCONFDIR} \
- --enable-inline-optimization \
- --with-pic \
- --with-pear=${LOCALBASE}/share/php-${PV} \
- --with-config-file-scan-dir=${SYSCONFDIR}/php-${PV} \
- --with-pdo-sqlite \
- --enable-sqlite-utf8 \
- --with-sqlite3 \
- --program-suffix=-${PV}
- # readline is broken in PHP-5.3
- .if ${PV} != 5.3
- CONFIGURE_ARGS += --with-readline
- .endif
- # apache module
- CONFIGURE_ARGS+= --with-apxs2=${LOCALBASE}/sbin/apxs2
- BUILD_DEPENDS+= www/apache-httpd
- # default included extensions
- CONFIGURE_ARGS+= --with-openssl \
- --with-zlib \
- --enable-xml \
- --enable-wddx \
- --enable-cli \
- --with-iconv=${LOCALBASE} \
- --with-gettext=${LOCALBASE} \
- --enable-bcmath \
- --enable-session \
- --enable-calendar \
- --enable-ctype \
- --enable-ftp \
- --with-pcre-regex \
- --enable-sockets \
- --enable-sysvmsg \
- --enable-sysvsem \
- --enable-sysvshm \
- --enable-mbstring \
- --enable-exif \
- --enable-zend-multibyte \
- --enable-fastcgi \
- --enable-fpm \
- --with-fpm-user=www \
- --with-fpm-group=www
- TEST_TARGET= test
- TEST_FLAGS= NO_INTERACTION=1
- MULTI_PACKAGES+= -main -fastcgi
- #
- # Loadable php extensions by name that are included in all versions
- #
- # bz2
- MULTI_PACKAGES+= -bz2
- COMMENT-bz2= bzip2 compression extensions for php5
- CONFIGURE_ARGS+= --with-bz2=shared,${LOCALBASE}
- LIB_DEPENDS-bz2= archivers/bzip2
- WANTLIB-bz2= bz2>=10 pthread
- # curl
- MULTI_PACKAGES+= -curl
- COMMENT-curl= curl URL library extensions for php5
- CONFIGURE_ARGS+= --with-curl=shared,${LOCALBASE}
- LIB_DEPENDS-curl= net/curl
- WANTLIB-curl= pthread crypto nghttp2 ssl z curl>=2
- # dba
- MULTI_PACKAGES+= -dba
- COMMENT-dba= dba GDBM access extensions for php5
- CONFIGURE_ARGS+= --enable-dba=shared --with-gdbm=${LOCALBASE}
- LIB_DEPENDS-dba= databases/gdbm
- WANTLIB-dba= gdbm>=2 pthread
- # gd
- MULTI_PACKAGES+= -gd
- COMMENT-gd= image manipulation extensions for php5
- LIB_DEPENDS-gd= graphics/jpeg \
- graphics/png
- .if ${PV} != "7.0"
- LIB_DEPENDS-gd+= devel/t1lib
- WANTLIB-gd+= t1>=5
- .endif
- WANTLIB-gd+= z jpeg>=62 png>=3 pthread X11 Xpm freetype
- CONFIGURE_ARGS+= --with-gd=shared \
- --with-jpeg-dir=${LOCALBASE} \
- --with-png-dir=${LOCALBASE} \
- --with-zlib-dir=/usr \
- --with-t1lib=${LOCALBASE} \
- --with-freetype-dir=${X11BASE} \
- --with-xpm-dir=${X11BASE}
- # gmp
- MULTI_PACKAGES+= -gmp
- COMMENT-gmp= gmp math library support for php5
- CONFIGURE_ARGS+= --with-gmp=shared,${LOCALBASE}
- LIB_DEPENDS-gmp= devel/gmp
- WANTLIB-gmp= gmp>=4 pthread
- # intl
- MULTI_PACKAGES+= -intl
- COMMENT-intl= intl library support for php5
- CONFIGURE_ARGS+= --enable-intl=shared \
- --with-icu-dir=${LOCALBASE}
- LIB_DEPENDS-intl= textproc/icu4c
- WANTLIB-intl= ${LIBCXX} icudata icui18n icuio icuuc m pthread
- # imap
- MULTI_PACKAGES+= -imap
- COMMENT-imap= imap, pop3 and nntp extensions for php5
- CONFIGURE_ARGS+= --with-imap=shared,${LOCALBASE} \
- --with-imap-ssl
- LIB_DEPENDS-imap= mail/alpine,-c-client
- WANTLIB-imap= pthread crypto ssl c-client>=5
- # ldap
- MULTI_PACKAGES+= -ldap
- COMMENT-ldap= ldap protocol extensions for php5
- CONFIGURE_ARGS+= --with-ldap=shared,${LOCALBASE}
- LIB_DEPENDS-ldap= databases/openldap
- WANTLIB-ldap= pthread ldap>=2 lber
- # mcrypt
- MULTI_PACKAGES+= -mcrypt
- COMMENT-mcrypt= mcrypt encryption/decryption extensions for php5
- CONFIGURE_ARGS+= --with-mcrypt=shared,${LOCALBASE}
- LIB_DEPENDS-mcrypt= security/libmcrypt devel/libtool,-ltdl
- WANTLIB-mcrypt= mcrypt ltdl>=1 pthread
- .if ${PV} != "7.0"
- # mysql
- MULTI_PACKAGES+= -mysql
- COMMENT-mysql= mysql database access extensions for php5
- CONFIGURE_ARGS+= --with-mysql=shared,${LOCALBASE}
- LIB_DEPENDS-mysql= databases/mariadb
- WANTLIB-mysql= pthread lib/mysql/mysqlclient
- .endif
- # mysqli
- MULTI_PACKAGES+= -mysqli
- COMMENT-mysqli= mysql database access extensions for php5
- CONFIGURE_ARGS+= --with-mysqli=shared,${LOCALBASE}/bin/mysql_config
- LIB_DEPENDS-mysqli= databases/mariadb
- WANTLIB-mysqli= crypto m pthread ssl z lib/mysql/mysqlclient
- # odbc
- MULTI_PACKAGES+= -odbc
- COMMENT-odbc= odbc database access extensions for php5
- CONFIGURE_ARGS+= --with-iodbc=shared,${LOCALBASE}
- LIB_DEPENDS-odbc= databases/iodbc
- WANTLIB-odbc= iodbc>=2 pthread
- .if ${PV} != "5.3"
- WANTLIB-odbc+= iodbcinst
- .endif
- # pcntl
- MULTI_PACKAGES+= -pcntl
- COMMENT-pcntl= PCNTL extensions for php5
- CONFIGURE_ARGS+= --enable-pcntl=shared
- LIB_DEPENDS-pcntl=
- WANTLIB-pcntl= pthread
- # pdo-mysql
- MULTI_PACKAGES+= -pdo_mysql
- COMMENT-pdo_mysql= PDO mysql database access extensions for php5
- CONFIGURE_ARGS+= --with-pdo-mysql=shared,${LOCALBASE}
- LIB_DEPENDS-pdo_mysql= databases/mariadb
- WANTLIB-pdo_mysql= crypto m pthread ssl z lib/mysql/mysqlclient
- # pdo-pgsql
- MULTI_PACKAGES+= -pdo_pgsql
- COMMENT-pdo_pgsql= PDO database access extensions for php5
- CONFIGURE_ARGS+= --with-pdo-pgsql=shared,${LOCALBASE}
- LIB_DEPENDS-pdo_pgsql= databases/postgresql
- WANTLIB-pdo_pgsql= pq>=2 pthread
- # pgsql
- MULTI_PACKAGES+= -pgsql
- COMMENT-pgsql= pgsql database access extensions for php5
- CONFIGURE_ARGS+= --with-pgsql=shared,${LOCALBASE}
- LIB_DEPENDS-pgsql= databases/postgresql
- WANTLIB-pgsql= pq>=2 pthread
- # pspell
- MULTI_PACKAGES+= -pspell
- COMMENT-pspell= pspell library extensions for php5
- CONFIGURE_ARGS+= --with-pspell=shared,${LOCALBASE}
- LIB_DEPENDS-pspell= textproc/aspell/core
- WANTLIB-pspell= aspell>=16 pspell>=16 pthread
- # shmop
- MULTI_PACKAGES+= -shmop
- COMMENT-shmop= shared memory extensions for php5
- CONFIGURE_ARGS+= --enable-shmop=shared,${LOCALBASE}
- LIB_DEPENDS-shmop=
- WANTLIB-shmop= pthread
- # soap
- MULTI_PACKAGES+= -soap
- COMMENT-soap= SOAP functions for php5
- CONFIGURE_ARGS+= --enable-soap=shared,${LOCALBASE}
- LIB_DEPENDS-soap= textproc/libxml
- WANTLIB-soap= iconv m pthread z xml2>=8 lzma
- # snmp
- MULTI_PACKAGES+= -snmp
- COMMENT-snmp= snmp protocol extensions for php5
- CONFIGURE_ARGS+= --with-snmp=shared,${LOCALBASE} --enable-ucd-snmp-hack
- LIB_DEPENDS-snmp= net/net-snmp
- WANTLIB-snmp= crypto m netsnmp>=6.2 pthread
- .if ${PV} != "7.0"
- # sybase-ct
- MULTI_PACKAGES+= -sybase_ct
- COMMENT-sybase_ct= sybase database access extensions for php5
- CONFIGURE_ARGS+= --with-sybase-ct=shared,${LOCALBASE}
- LIB_DEPENDS-sybase_ct= databases/freetds
- WANTLIB-sybase_ct= ct pthread
- .endif
- # pdo-dblib
- MULTI_PACKAGES+= -pdo_dblib
- COMMENT-pdo_dblib= PDO DB-LIB support for php5
- CONFIGURE_ARGS+= --with-pdo-dblib=shared,${LOCALBASE}
- LIB_DEPENDS-pdo_dblib= databases/freetds
- WANTLIB-pdo_dblib= sybdb>=6 pthread
- .if ${PV} != "7.0"
- # mssql
- MULTI_PACKAGES+= -mssql
- COMMENT-mssql= microsoft sql access extensions for php5
- CONFIGURE_ARGS+= --with-mssql=shared,${LOCALBASE}
- LIB_DEPENDS-mssql= databases/freetds
- WANTLIB-mssql= sybdb>=6 pthread
- .endif
- # tidy
- MULTI_PACKAGES+= -tidy
- COMMENT-tidy= tidy HTML cleaner bindings
- CONFIGURE_ARGS+= --with-tidy=shared,${LOCALBASE}
- LIB_DEPENDS-tidy= www/tidyp
- WANTLIB-tidy= tidyp pthread
- # xml-rpc
- MULTI_PACKAGES+= -xmlrpc
- COMMENT-xmlrpc= XML RPC functions for php5
- CONFIGURE_ARGS+= --with-xmlrpc=shared
- LIB_DEPENDS-xmlrpc= textproc/libxml
- WANTLIB-xmlrpc= iconv m z xml2>=8 pthread lzma
- # xsl
- MULTI_PACKAGES+= -xsl
- COMMENT-xsl= XSL functions for php5
- CONFIGURE_ARGS+= --with-xsl=shared --enable-dom
- LIB_DEPENDS-xsl= textproc/libxslt
- WANTLIB-xsl= iconv m xml2 z xslt>=3 exslt pthread lzma
- # zip
- MULTI_PACKAGES+= -zip
- COMMENT-zip= zip functions for php5
- CONFIGURE_ARGS+= --enable-zip=shared,${LOCALBASE}
- LIB_DEPENDS-zip=
- WANTLIB-zip= z pthread
- # some variables to substitute
- SUBST_VARS= MODPHP_CONFIG_PATH SV PV ^MODULE_NAME
- PHP_VERSION= ${V}
- SV= ${PV:S/.//}
- .for i in TRUEPREFIX MODULES_DIR PHP_VERSION APACHE_MODULE_DIR
- PHPXS_SUBST+= -e 's,${i},${${i}},'
- .endfor
- WANTLIB-main+= c crypto iconv intl lzma m pthread ssl xml2>=8 z
- WANTLIB-main+= ncurses readline ${LIBCXX}
- # php 5.4/5.5 : WANTLIB-main += ${LIBCXX}
- WANTLIB-fastcgi= ${WANTLIB-main}
- LIB_DEPENDS-main= devel/gettext \
- textproc/libxml
- RUN_DEPENDS-main= mail/femail,-chroot
- LIB_DEPENDS-fastcgi= ${LIB_DEPENDS-main}
- RUN_DEPENDS-fastcgi=
- SUHOSIN_V= 0.9.38
- .if ${FLAVOR:Mno_suhosin} || ${PV} == "7.0"
- SUPDISTFILES= suhosin-${SUHOSIN_V}.tar.gz:0
- .else
- DISTFILES+= suhosin-${SUHOSIN_V}.tar.gz:0
- PATCH_LIST= patch-* suhosin-*
- CONFIGURE_ARGS+= --enable-suhosin
- pre-patch:
- @mv ${WRKDIR}/suhosin-${SUHOSIN_V} ${WRKSRC}/ext/suhosin
- .endif
- pre-fake:
- ${INSTALL_DATA_DIR} ${PREFIX}/${APACHE_MODULE_SUBDIR}/modules
- INSTALL_TARGET= install-headers install-build install-programs
- DESTDIRNAME= INSTALL_ROOT
- pre-configure:
- ${SUBST_CMD} ${WRKSRC}/main/php_ini.c
- @perl -pi -e "s,OPENBSD_PEAR_ROOT,'${CHROOT_DIR}/pear',g;" \
- -e "s,OPENBSD_PREFIX,${TRUEPREFIX},;" \
- ${WRKSRC}/scripts/phpize.in \
- ${WRKSRC}/scripts/php-config.in
- .for i in ${MULTI_PACKAGES:N-main:N-fastcgi:S/-//g}
- MODULE_NAME-${i}= ${i}
- DESCR-${i}= ${.CURDIR}/../files/DESCR-${i}
- PKGNAME-${i}= php-${i}-${V}
- .if ${V:M5.4*}
- PKGSPEC-${i}= php-${i}->=5.4,<5.5
- .elif ${V:M5.5*}
- PKGSPEC-${i}= php-${i}->=5.5,<5.6
- .elif ${V:M5.6*}
- PKGSPEC-${i}= php-${i}->=5.6,<5.7
- .elif ${V:M7.0*}
- PKGSPEC-${i}= php-${i}->=7.0,<7.1
- .endif
- RUN_DEPENDS-${i}+= php-${V}:lang/php/${PV}
- .endfor
- DESCR-main= ${.CURDIR}/../files/DESCR-main
- DESCR-fastcgi= ${.CURDIR}/../files/DESCR-fastcgi
- post-install:
- ${SUBST_DATA} ${.CURDIR}/../files/README-main \
- ${PREFIX}/share/doc/pkg-readmes/${FULLPKGNAME-main}
- ${INSTALL_DATA} ${WRKBUILD}/.libs/libphp${PV:C/\.[0-9]$//}.so \
- ${PREFIX}/${APACHE_MODULE_SUBDIR}/
- ${INSTALL_DATA_DIR} ${WRKINST}/${CHROOT_DIR}/conf/php-${PV}.sample
- ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php-${PV}
- ${INSTALL_PROGRAM} ${WRKBUILD}/sapi/cli/php ${PREFIX}/bin/php-${PV}
- ${INSTALL_PROGRAM} ${WRKBUILD}/sapi/cgi/php-cgi ${PREFIX}/bin/php-fastcgi-${PV}
- ${INSTALL_PROGRAM} ${WRKBUILD}/sapi/fpm/php-fpm ${PREFIX}/sbin/php-fpm-${PV}
- ${INSTALL_MAN} ${WRKBUILD}/sapi/fpm/php-fpm.8 ${PREFIX}/man/man8/php-fpm-${PV}.8
- ${INSTALL_DATA} ${WRKBUILD}/sapi/fpm/php-fpm.conf \
- ${PREFIX}/share/examples/php-${PV}/php-fpm.conf
- .if ${PV} == "7.0"
- cat ${WRKBUILD}/sapi/fpm/www.conf >> \
- ${PREFIX}/share/examples/php-${PV}/php-fpm.conf
- .endif
- ${INSTALL_DATA} ${.CURDIR}/../files/php.conf \
- ${PREFIX}/share/examples/php-${PV}/php.conf
- @perl -pi -e "s,!!PREFIX!!,${TRUEPREFIX},g;s,!!PV!!,${PV},g;s,!!MV!!,${PV:R},g" \
- ${PREFIX}/share/examples/php-${PV}/php.conf
- .for m in ${MULTI_PACKAGES:N-main:N-fastcgi:S/-//g}
- ${INSTALL_DATA} ${WRKBUILD}/modules/${m}.so \
- ${PREFIX}/${MODULES_SUBDIR}/${m}.so
- echo "extension=${m}.so" > \
- ${PREFIX}/share/examples/php-${PV}/${m}.ini
- .endfor
- if [ -f ${WRKBUILD}/modules/opcache.so ]; then \
- ${INSTALL_DATA} ${WRKBUILD}/modules/opcache.so \
- ${PREFIX}/${MODULES_SUBDIR}/opcache.so; \
- echo "zend_extension=opcache.so" > \
- ${PREFIX}/share/examples/php-${PV}/opcache.ini; fi
- ${INSTALL_DATA_DIR} ${WRKINST}/${CHROOT_DIR}/etc
- echo "www:*:67:67::0:0:dummy user to appease c-client:/nonexistent:/sbin/nologin" > \
- ${WRKINST}/${CHROOT_DIR}/etc/master.passwd.imap
- pwd_mkdb -d ${WRKINST}/${CHROOT_DIR}/etc master.passwd.imap
- .for i in ${INI_TEMPLATES}
- @sed -e 's,MODULES_DIR,${MODULES_DIR},' \
- -e 's,OPENBSD_INCLUDE_PATH,/pear/lib:${CHROOT_DIR}/pear/lib,' \
- <${WRKSRC}/php.ini-${i} \
- >${PREFIX}/share/examples/php-${PV}/php.ini-${i}
- .endfor
- ${INSTALL_MAN} ${WRKSRC}/sapi/cli/php.1 ${PREFIX}/man/man1/php-${PV}.1
|