summaryrefslogtreecommitdiffstats
path: root/dev-lang/php/files/eblits/pkg_postinst-v2.eblit
blob: 70bb7e879e3e55466c6b23ecdb63151e35f2934f (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_postinst-v2.eblit,v 1.12 2011/02/18 09:18:38 olemarkus Exp $

eblit-php-pkg_postinst() {
	# Output some general info to the user
	if use apache2 ; then
		APACHE2_MOD_DEFINE="PHP5"
		APACHE2_MOD_CONF="70_mod_php5"
		apache-module_pkg_postinst
	fi

	
	# Create the symlinks for php
	for m in ${SAPIS}; do
		[[ ${m} == 'embed' ]] && continue;
		if use $m ; then
			local ci=$(eselect php show $m)
			if [[ -z $ci ]]; then
				eselect php set $m php${SLOT}
				einfo "Switched ${m} to use php:${SLOT}"
				einfo
			elif [[ $ci != "php${SLOT}" ]] ; then
				elog "To switch $m to use php:${SLOT}, run"
				elog "    eselect php set $m php${SLOT}"
				elog
			fi
		fi
	done

	elog "You may have to recompile third-party extensions now"
	elog "(includes every dev-php5/pecl-* package and probably others in that category)"
	elog "Make sure that PHP_TARGETS in /etc/make.conf includes php${SLOT/./-} in order"
	elog "to compile extensions for the ${SLOT} ABI"
	elog
	if ! use readline && use cli ; then
		ewarn "Note that in order to use php interactivly, you need to enable"
		ewarn "the readline USE flag or php -a will hang"
	fi
	elog
	elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
	elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
	elog "'production' or 'development' in /etc/make.conf"
	ewarn "Both versions of php.ini can be found in /usr/share/doc/${PF}"

	# check for not yet migrated old style config dirs
	ls "${ROOT}"/etc/php/*-php5 &>/dev/null
	if [[ $? -eq 0 ]]; then
		ewarn "Make sure to migrate your config files, starting with php-5.3.4 and php-5.2.16 config"
		ewarn "files are now kept at ${ROOT}etc/php/{apache2,cli,cgi,fpm}-php5.x"
	fi
	elog
	elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
	elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml"
	elog

	if ( [[ -z SUHOSIN_VERSION ]] && use suhosin && version_is_at_least 5.3.6_rc1 ) ; then
		ewarn "The suhosin USE flag now only installs the suhosin patch!"
		ewarn "If you want the suhosin extension, make sure you install"
		ewarn " dev-php5/suhosin"
		ewarn
	fi
}