Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 46048
Collapse All | Expand All

(-)mod_php.old/ChangeLog (-1 / +4 lines)
Lines 1-9 Link Here
1
# ChangeLog for dev-php/mod_php
1
# ChangeLog for dev-php/mod_php
2
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
2
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
3
# $Header: /home/cvsroot/gentoo-x86/dev-php/mod_php/ChangeLog,v 1.130 2004/03/29 00:05:16 stuart Exp $
3
# $Header: /home/cvsroot/gentoo-x86/dev-php/mod_php/ChangeLog,v 1.130 2004/03/29 01:11:04 shawm Exp $
4
4
5
*mod_php-4.3.5 (29 Mar 2004)
5
*mod_php-4.3.5 (29 Mar 2004)
6
6
7
  29 Mar 2004; Shawn Holwegner <shawn@holwegner.com> mod_php-4.3.5-r1.ebuild
8
  Fixed trivial patch to work with Apache 1; Apache 2 patches outdated.
9
7
  29 Mar 2004; Stuart Herbert <stuart@gentoo.org> mod_php-4.3.5.ebuild:
10
  29 Mar 2004; Stuart Herbert <stuart@gentoo.org> mod_php-4.3.5.ebuild:
8
  Version bump
11
  Version bump
9
12
(-)mod_php.old/Manifest (+2 lines)
Lines 17-22 Link Here
17
MD5 f72efb54e1262a9401817b6034bfd00c mod_php-4.3.2-r3.ebuild 4939
17
MD5 f72efb54e1262a9401817b6034bfd00c mod_php-4.3.2-r3.ebuild 4939
18
MD5 8f98d3d3c91b0024416c8a52afc2641d mod_php-4.3.4-r4.ebuild 5389
18
MD5 8f98d3d3c91b0024416c8a52afc2641d mod_php-4.3.4-r4.ebuild 5389
19
MD5 1830642d4029e3f2eec92cb9a7b7d846 mod_php-4.3.5.ebuild 5422
19
MD5 1830642d4029e3f2eec92cb9a7b7d846 mod_php-4.3.5.ebuild 5422
20
MD5 811254b2df5489879b1abe5d95c066c2 mod_php-4.3.5-r1.ebuild
20
MD5 cceddd5c262e0ffef31d45b7da269851 files/mod_php.conf 148
21
MD5 cceddd5c262e0ffef31d45b7da269851 files/mod_php.conf 148
21
MD5 c0f86a4fc233945f1db33bd39abe22ab files/70_mod_php.conf 1065
22
MD5 c0f86a4fc233945f1db33bd39abe22ab files/70_mod_php.conf 1065
22
MD5 63f7765d77e10eeef4b306480cd5d200 files/digest-mod_php-4.3.2 137
23
MD5 63f7765d77e10eeef4b306480cd5d200 files/digest-mod_php-4.3.2 137
Lines 36-41 Link Here
36
MD5 5547bf31e6a425747226d5984cff04e9 files/digest-mod_php-4.3.4-r2 137
37
MD5 5547bf31e6a425747226d5984cff04e9 files/digest-mod_php-4.3.4-r2 137
37
MD5 5547bf31e6a425747226d5984cff04e9 files/digest-mod_php-4.3.4-r3 137
38
MD5 5547bf31e6a425747226d5984cff04e9 files/digest-mod_php-4.3.4-r3 137
38
MD5 b8cfdda8dd4c656e170607b282cb0019 files/mod_php-4.3.4-r3.diff 1717
39
MD5 b8cfdda8dd4c656e170607b282cb0019 files/mod_php-4.3.4-r3.diff 1717
40
MD5 3bf664b414787f8f3c1dcbda5750aef4 files/mod_php-4.3.5.diff
39
MD5 5547bf31e6a425747226d5984cff04e9 files/digest-mod_php-4.3.4-r4 137
41
MD5 5547bf31e6a425747226d5984cff04e9 files/digest-mod_php-4.3.4-r4 137
40
MD5 7515e9b1dc298a0fb1c12d35a58c265d files/mod_php-4.3.4-amd64hack.diff 1028
42
MD5 7515e9b1dc298a0fb1c12d35a58c265d files/mod_php-4.3.4-amd64hack.diff 1028
41
MD5 d08dceef07d7ae4bd6e6dbaad0b86d72 files/digest-mod_php-4.3.5 137
43
MD5 d08dceef07d7ae4bd6e6dbaad0b86d72 files/digest-mod_php-4.3.5 137
(-)mod_php.old/files/digest-mod_php-4.3.5-r1 (+2 lines)
Line 0 Link Here
1
MD5 29e61c125ac6278897c6c219f5d100d1 php-4.3.5.tar.bz2 3947414
2
MD5 912ff94309b762563d0542db5187315f php-4.3.2-fopen-url-secure.patch 416
(-)mod_php.old/mod_php-4.3.5-r1.ebuild (+178 lines)
Line 0 Link Here
1
--- php-4.3.5/sapi/apache/mod_php4.c.old	2004-01-31 21:44:55.000000000 +0000
Line 0 Link Here
1
# Copyright 1999-2004 Gentoo Technologies, Inc.
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /home/cvsroot/gentoo-x86/dev-php/mod_php/mod_php-4.3.5.ebuild,v 1.1 2004/03/29 01:11:16 shawn Exp $
4
5
IUSE="${IUSE} apache2"
6
7
DESCRIPTION="Apache module for PHP"
8
KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~ia64 ~amd64"
9
10
detectapache() {
11
	local domsg=
12
	[ -n "$1" ] && domsg=1
13
	HAVE_APACHE1=
14
	HAVE_APACHE2=
15
	has_version '=net-www/apache-1*' && HAVE_APACHE1=1
16
	has_version '=net-www/apache-2*' && HAVE_APACHE2=1
17
18
	[ -n "${HAVE_APACHE1}" ] && APACHEVER=1
19
	[ -n "${HAVE_APACHE2}" ] && APACHEVER=2
20
	[ -n "${HAVE_APACHE1}" ] && [ -n "${HAVE_APACHE2}" ] && APACHEVER='both'
21
22
	case "${APACHEVER}" in
23
	1) [ -n "${domsg}" ] && einfo 'Apache1 only detected' ;;
24
	2) [ -n "${domsg}" ] && einfo 'Apache2 only detected';;
25
	both)
26
		if [ "`use apache2`" ]; then
27
			[ -n "${domsg}" ] && einfo "Multiple Apache versions detected, using Apache2 (USE=apache2)"
28
			APACHEVER=2
29
		else
30
			[ -n "${domsg}" ] && einfo 'Multiple Apache versions detected, using Apache1 (USE=-apache2)'
31
			APACHEVER=1
32
		fi ;;
33
	*) if [ -n "${domsg}" ]; then
34
			MSG="Unknown Apache version!"; eerror $MSG ; die $MSG
35
	   else
36
			APACHEVER=0
37
	   fi; ;;
38
	esac
39
}
40
41
detectapache
42
43
SLOT="${APACHEVER}"
44
[ "${APACHEVER}" -eq '2' ] && USE_APACHE2='2' || USE_APACHE2=''
45
46
PHPSAPI="apache${APACHEVER}"
47
48
# BIG FAT WARNING!
49
# the php eclass requires the PHPSAPI setting!
50
# In this case the PHPSAPI setting is dependant on the detectapache function
51
# above this point as well!
52
inherit php-sapi eutils
53
54
DEPEND_EXTRA=">=net-www/apache-1.3.26-r2
55
			  apache2? ( >=net-www/apache-2.0.43-r1 )"
56
DEPEND="${DEPEND} ${DEPEND_EXTRA}"
57
RDEPEND="${RDEPEND} ${DEPEND_EXTRA}"
58
59
# Add a 'return 0' as we DON'T want the return code checked
60
pkg_setup() {
61
	use debug && einfo "Installing in SLOT=${SLOT}"
62
	return 0
63
}
64
65
src_unpack() {
66
	multiinstwarn
67
	detectapache domsg
68
	php-sapi_src_unpack
69
	if [ "${ARCH}" == "amd64" ] ; then
70
		epatch ${FILESDIR}/${P}-amd64hack.diff
71
	fi
72
73
	# bug fix for security problem - bug #39952
74
	epatch ${FILESDIR}/mod_php-4.3.5.diff
75
}
76
77
src_compile() {
78
	# Every Apache2 MPM EXCEPT prefork needs Zend Thread Safety
79
	if [ -n "${USE_APACHE2}" ]; then
80
		APACHE2_MPM="`apache2 -l |egrep 'worker|perchild|leader|threadpool|prefork'|cut -d. -f1|sed -e 's/^[[:space:]]*//g;s/[[:space:]]+/ /g;'`"
81
		einfo "Apache2 MPM: ${APACHE2_MPM}"
82
		case "${APACHE2_MPM}" in
83
			*prefork*) ;;
84
			*) myconf="${myconf} --enable-experimental-zts" ; ewarn "Enabling ZTS for Apache2 MPM" ;;
85
		esac;
86
	fi
87
88
	#use apache2 \
89
	myconf="${myconf} --with-apxs${USE_APACHE2}=/usr/sbin/apxs${USE_APACHE2}"
90
91
	php-sapi_src_compile
92
}
93
94
95
src_install() {
96
	PHP_INSTALLTARGETS="install"
97
	php-sapi_src_install 
98
	einfo "Adding extra symlink to php.ini for Apache${USE_APACHE2}"
99
	dodir /etc/apache${USE_APACHE2}/conf/
100
	dodir ${PHPINIDIRECTORY}
101
	dosym ${PHPINIDIRECTORY}/${PHPINIFILENAME} /etc/apache${USE_APACHE2}/conf/${PHPINIFILENAME}
102
103
	einfo "Adding extra symlink to Apache${USE_APACHE2} extramodules for PHP"
104
	dosym /usr/lib/apache${USE_APACHE2}-extramodules ${PHPINIDIRECTORY}/lib
105
	exeinto /usr/lib/apache${USE_APACHE2}-extramodules
106
	einfo "Installing mod_php shared object now"
107
	doexe .libs/libphp4.so
108
109
	if [ -n "${USE_APACHE2}" ] ; then
110
		einfo "Installing a Apache2 config for PHP (70_mod_php.conf)"
111
		insinto /etc/apache2/conf/modules.d
112
		doins ${FILESDIR}/70_mod_php.conf
113
	else
114
		einfo "Installing a Apache config for PHP (mod_php.conf)"
115
		insinto /etc/apache/conf/addon-modules
116
		doins ${FILESDIR}/mod_php.conf
117
		dosym ${PHPINIDIRECTORY}/${PHPINIFILENAME} /etc/apache/conf/addon-modules/${PHPINIFILENAME}
118
	fi
119
}
120
121
apache2msg() {
122
	einfo "Edit /etc/conf.d/apache2 and add \"-D PHP4\" to APACHE2_OPTS"
123
	ewarn "This is a CHANGE from previous behavior, which was \"-D PHP\""
124
	ewarn "This is for the upcoming PHP5 support. The ebuild will attempt"
125
	ewarn "to make this update between PHP and PHP4 automatically"
126
}
127
128
multiinstwarn() {
129
	ewarn "Due to some previous bloopers with PHP and slotting, you may have"
130
	ewarn "multiple instances of mod_php installed. Please look at the autoclean"
131
	ewarn "output at the end of the emerge and unmerge all but relevant"
132
	ewarn "instances."
133
}
134
135
apache2fix() {
136
	if egrep -q -- '-D PHP\>' /etc/conf.d/apache2; then
137
		einfo "Attemping to update /etc/conf.d/apache2 automatically for the PHP/PHP4 change."
138
		local oldfile="/etc/conf.d/apache2.old.`date +%Y%m%d%H%M%S`"
139
		cp /etc/conf.d/apache2 ${oldfile}
140
		sed -re 's,-D PHP\>,-D PHP4,g' ${oldfile}  <${oldfile} >/etc/conf.d/apache2
141
	fi
142
}
143
144
145
pkg_preinst() {
146
	multiinstwarn
147
	[ "${APACHEVER}" -eq '2' ] && apache2fix
148
	php-sapi_pkg_preinst
149
}
150
151
pkg_postinst() {
152
	php-sapi_pkg_postinst
153
	multiinstwarn
154
	einfo "To have Apache run php programs, please do the following:"
155
	if [ -n "${USE_APACHE2}" ]; then
156
		apache2msg
157
	else
158
		einfo "1. Execute the command:"
159
		einfo " \"ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config\""
160
		einfo "2. Edit /etc/conf.d/apache and add \"-D PHP4\" to APACHE_OPTS"
161
		einfo "That will include the php mime types in your configuration"
162
		einfo "automagically and setup Apache to load php when it starts."
163
	fi
164
}
165
166
pkg_config() {
167
	multiinstwarn
168
	if [ -n "${USE_APACHE2}" ]; then
169
		apache2msg
170
	else
171
		${ROOT}/usr/sbin/apacheaddmod \
172
			${ROOT}/etc/apache/conf/apache.conf \
173
			extramodules/libphp4.so mod_php4.c php4_module \
174
			before=perl define=PHP4 addconf=conf/addon-modules/mod_php.conf
175
			:;
176
	fi
177
}

Return to bug 46048