summaryrefslogtreecommitdiff
blob: 880f9bafe86e123e4822772371e60657f9a1fcde (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
65
66
67
68
69
70
71
72
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-php/turck-mmcache/turck-mmcache-2.3.19.ebuild,v 1.2 2003/07/19 07:52:51 stuart Exp $

DESCRIPTION="Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. Also it uses some optimizations to speed up execution of PHP scripts. Turck MMCache typically reduces server load and increases the speed of your PHP code by 1-10 times."
SRC_URI="mirror://sourceforge/turck-mmcache/${P}.tar.gz"
HOMEPAGE="http://turck-mmcache.sourceforge.net/"

IUSE=""
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86"

PHP_EXT_NAME="mmcache"
PHP_EXT_ZENDEXT="yes"

inherit php-ext

src_compile() {
	myconf="--enable-mmcache=shared"
	php-ext_src_compile
}

src_install() {
	
	php-ext_src_install

	# create Cache dir if it does not exist
	#
	# settings should ensure that cached files are secure,
	# *but* this may break php-cli
	#
	# please file a bug in http://bugs.gentoo.org if this happens
	# for you

	if [ ! -d /var/cache/mmcache ] 
	then
  		mkdir /var/cache/mmcache
	fi
	chown root.root /var/cache/mmcache
	chmod 1777 /var/cache/mmcache

    insinto /usr/share/${PN}
	doins encoder.php mmcache.php mmcache.gif
	
	dodoc CREDITS LICENSE README TODO EXPERIMENTAL
}

pkg_postinst () {
	php-ext_pkg_postinst

	php-ext_addtoinifiles "mmcache.shm_size" '"16"'
	php-ext_addtoinifiles "mmcache.cache_dir" '"/var/cache/mmcache"'
	php-ext_addtoinifiles "mmcache.enable" '"1"'
	php-ext_addtoinifiles "mmcache.optimizer" '"1"'
	php-ext_addtoinifiles "mmcache.check_mtime" '"1"'
	php-ext_addtoinifiles "mmcache.debug" '"0"'
	php-ext_addtoinifiles "mmcache.filter" '""'
	php-ext_addtoinifiles "mmcache.shm_max" '"0"'
	php-ext_addtoinifiles "mmcache.shm_ttl" '"0"'
	php-ext_addtoinifiles "mmcache.shm_prune_period" '"0"'

	einfo "You need to restart apache to activate MMCache"
	einfo
	einfo 'A web interface is available to manage the turck cache.'
	einfo 'Copy /usr/share/turck-mmcache/mmcache.php to somewhere'
	einfo 'where your web server can see it.'
	einfo
	einfo 'A PHP script encoder is available to encode your PHP scripts.'
	einfo 'The encoder is available as /usr/share/turck-mmcache/encoder.php'
	einfo 'The encoded file format is not yet considered stable'
}