From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Date: Sat, 2 May 2015 10:26:51 +0200
Subject: debian_quirks

---
 configure.ac          |  5 ++++-
 php.ini-development   |  2 +-
 php.ini-production    |  2 +-
 sapi/cli/php.1.in     | 11 ++++++-----
 scripts/Makefile.frag |  4 ++--
 scripts/php-config.in |  8 ++++----
 scripts/phpize.in     |  4 ++--
 7 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index b08c691..8a4a8b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1161,7 +1161,7 @@ if test "$PHP_CLI" = "no"; then
 fi
 
 PHP_ARG_WITH(pear, [whether to install PEAR],
-[  --with-pear=DIR         Install PEAR in DIR @<:@PREFIX/lib/php@:>@
+[  --with-pear=DIR         Install PEAR in DIR @<:@PREFIX/share/php@:>@
   --without-pear          Do not install PEAR], DEFAULT, yes)
 
 if test "$PHP_PEAR" != "no"; then
@@ -1191,6 +1191,7 @@ if test "$PHP_PEAR" != "no"; then
   PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
 fi
 
+PEAR_INSTALLDIR=/usr/share/php
 
 dnl Configuring Zend and TSRM.
 dnl -------------------------------------------------------------------------
@@ -1263,6 +1264,8 @@ dnl Build extension directory path
 
 ZEND_MODULE_API_NO=`$EGREP '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO //'`
 
+AC_SUBST(ZEND_MODULE_API_NO)
+
 if test -z "$EXTENSION_DIR"; then
   extbasedir=$ZEND_MODULE_API_NO
   if test "$oldstyleextdir" = "yes"; then
diff --git a/php.ini-development b/php.ini-development
index b8ed4fb..990e095 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -726,7 +726,7 @@ default_charset = "UTF-8"
 ;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ; UNIX: "/path1:/path2"
-;include_path = ".:/php/includes"
+;include_path = ".:/usr/share/php"
 ;
 ; Windows: "\path1;\path2"
 ;include_path = ".;c:\php\includes"
diff --git a/php.ini-production b/php.ini-production
index ee1ff07..c0b2b41 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -728,7 +728,7 @@ default_charset = "UTF-8"
 ;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ; UNIX: "/path1:/path2"
-;include_path = ".:/php/includes"
+;include_path = ".:/usr/share/php"
 ;
 ; Windows: "\path1;\path2"
 ;include_path = ".;c:\php\includes"
diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in
index 88a43d3..2fd01a4 100644
--- a/sapi/cli/php.1.in
+++ b/sapi/cli/php.1.in
@@ -365,13 +365,14 @@ Shows configuration for extension
 Show configuration file names
 .SH FILES
 .TP 15
-.B php\-cli.ini
+.B /etc/php/@PHP_MAJOR_VERSION@.@PHP_MINOR_VERSION@/cli/php.ini
 The configuration file for the CLI version of PHP.
 .TP
-.B php.ini
-The standard configuration file will only be used when
-.B php\-cli.ini
-cannot be found.
++.B /etc/php/@PHP_MAJOR_VERSION@.@PHP_MINOR_VERSION@/cgi/php.ini
++The configuration file for the CGI version of PHP.
++.TP
++.B /etc/php/@PHP_MAJOR_VERSION@.@PHP_MINOR_VERSION@/apache2/php.ini
++The configuration file for the version of PHP that apache2 uses.
 .SH EXAMPLES
 .TP 5
 \fI@program_prefix@php \-r 'echo "Hello World\\n";'\fP
diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag
index 05659d8..2a81518 100644
--- a/scripts/Makefile.frag
+++ b/scripts/Makefile.frag
@@ -2,8 +2,8 @@
 # Build environment install
 #
 
-phpincludedir = $(includedir)/php
-phpbuilddir = $(libdir)/build
+phpincludedir = $(includedir)/php/$(DEBIAN_PHP_API)
+phpbuilddir = $(prefix)/lib/php/$(DEBIAN_PHP_API)/build
 
 BUILD_FILES = \
 	scripts/phpize.m4 \
diff --git a/scripts/php-config.in b/scripts/php-config.in
index d6c62cc..fa25dc7 100644
--- a/scripts/php-config.in
+++ b/scripts/php-config.in
@@ -6,11 +6,11 @@ datarootdir="@datarootdir@"
 exec_prefix="@exec_prefix@"
 version="@PHP_VERSION@"
 vernum="@PHP_VERSION_ID@"
-include_dir="@includedir@/php"
-includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"
-ldflags="@PHP_LDFLAGS@"
+include_dir="@includedir@/php/@DEBIAN_PHP_API@"
+includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib $(getconf LFS_CFLAGS)"
+ldflags="-L$prefix/lib/php/@DEBIAN_PHP_API@ @PHP_LDFLAGS@"
 libs="@EXTRA_LIBS@"
-extension_dir='@EXTENSION_DIR@'
+extension_dir="@EXTENSION_DIR@"
 man_dir=`eval echo @mandir@`
 program_prefix="@program_prefix@"
 program_suffix="@program_suffix@"
diff --git a/scripts/phpize.in b/scripts/phpize.in
index 74e8bc3..7d86b2e 100644
--- a/scripts/phpize.in
+++ b/scripts/phpize.in
@@ -4,8 +4,8 @@
 prefix='@prefix@'
 datarootdir='@datarootdir@'
 exec_prefix="`eval echo @exec_prefix@`"
-phpdir="`eval echo @libdir@`/build"
-includedir="`eval echo @includedir@`/php"
+phpdir="$prefix/lib/php/@DEBIAN_PHP_API@/build"
+includedir="$prefix/include/php/@DEBIAN_PHP_API@"
 builddir="`pwd`"
 SED="@SED@"
 
