summaryrefslogtreecommitdiff
blob: df44a77395dc947fcbc9dd72ed2f43e44d4fc48a (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-zope/zope/zope-2.5.1.ebuild,v 1.5 2003/12/14 23:36:33 spider Exp $

S=${WORKDIR}/Zope-${PV}-src
DESCRIPTION="Zope is web application platform used for building high-performance, dynamic web sites."
SRC_URI="http://www.zope.org/Products/Zope/${PV}/Zope-${PV}-src.tgz
	http://www.zope.org/Products/ZEO/ZEO-1.0.tgz"
HOMEPAGE="http://www.zope.org"

DEPEND="virtual/glibc
	=dev-lang/python-2.1.3*"
SLOT="0"
LICENSE="as-is"
KEYWORDS="x86 ppc sparc "

src_unpack() {

	unpack Zope-${PV}-src.tgz

	if [ "`use zeo`" ]; then
		cd ${S}/lib/python
		unpack ZEO-1.0.tgz
		mv ZEO-1.0/ZEO ${S}/lib/python
		rm -rf ZEO-1.0
	fi
}

src_compile() {
	python2.1 w_pcgi.py || die
}

src_install () {

	ZDIR=/usr/share/zope
	ZVAR=/var/lib/zope


	dodir ${ZDIR}/var
	insinto ${ZDIR}
	doins w_pcgi.py wo_pcgi.py

	dodir ${ZDIR}/lib
	cp -a lib/* ${D}${ZDIR}/lib/
	cp -a ZServer utilities ${D}${ZDIR}
	rm ${D}${ZDIR}/ZServer/*.txt
	exeinto ${ZDIR}/pcgi
	doexe pcgi/pcgi-wrapper pcgi/pcgi_publisher.py

	dodir ${ZDIR}/inst
	cp -a inst/* ${D}${ZDIR}/inst

	dodir ${ZDIR}/pcgi
	cp -a pcgi/* ${D}${ZDIR}/pcgi

	cd ${S}
	fperms a+x ${ZDIR}/lib/python/zdaemon.py
	fperms a+x	${ZDIR}/lib/python/StructuredText/StructuredText.py
	fperms a+x	${ZDIR}/lib/python/ZPublisher/Client.py

	dodir ${ZVAR}
	insinto ${ZVAR}
	doins z2.py
	insinto ${ZVAR}/var
	insopts -m644
	doins var/Data.fs.in
	dodir ${ZVAR}/Extensions
	dodir ${ZVAR}/import
	dodir ${ZVAR}/Products

	if [ "`use zeo`" ]; then
		insinto ${ZVAR}
		doins ${FILESDIR}/zctl.py  ${FILESDIR}/zope  ${FILESDIR}/zope.conf ${FILESDIR}/custom_zodb.py
	fi

	exeinto ${ZDIR}
	doexe zpasswd.py Zope.cgi

	cd ${D}${ZDIR}
	sed -e "s:${WORKDIR}:${ZDIR}:g" Zope.cgi > Zope.cgi.tmp
	mv Zope.cgi.tmp Zope.cgi
	sed -e "s:${WORKDIR}:${ZVAR}:g" stop > stop.tmp
	mv stop.tmp stop

	dodir /etc/init.d
	exeinto /etc/init.d
	newexe ${FILESDIR}/zope.rc6 zope
	chown nobody:users ${D}/${ZVAR}/var/*
}

pkg_postinst() {
	if [ ! -f ${ROOT}/var/lib/zope/var/Data.fs ]
	then
		echo "Installing Data.fs from template..."
		cd ${ROOT}/var/lib/zope/var
		cp Data.fs.in Data.fs
		echo
		echo "Fixing permissions..."
		chown nobody:nogroup -R ${ROOT}/var/lib/zope/var
		chmod 600 ${ROOT}/var/lib/zope/var/Data.fs
		echo
	fi
	if [ ! -f ${ROOT}/var/lib/zope/access ]
	then
		echo "You must run"
		echo
		echo /usr/share/zope/zpasswd.py /var/lib/zope/inituser
		if [ "`use zeo`" ]; then
			echo and edit /var/lib/zope/zope.conf
		fi

		echo
		echo before you can start zope
	fi
}