/[gentoo-x86]/www-servers/cherokee/cherokee-1.0.2.ebuild
Gentoo

Contents of /www-servers/cherokee/cherokee-1.0.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Jun 16 11:54:54 2010 UTC (5 years ago) by bass
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Fixed python compatibility (thanks xmw)
(Portage version: 2.1.8.3/cvs/Linux i686)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-servers/cherokee/cherokee-1.0.2.ebuild,v 1.1 2010/06/16 07:51:59 bass Exp $
4
5 PYTHON_DEPEND="2"
6
7 inherit python eutils pam versionator libtool
8
9 DESCRIPTION="An extremely fast and tiny web server."
10 SRC_URI="http://www.cherokee-project.com/download/$(get_version_component_range 1-2)/${PV}/${P}.tar.gz"
11 HOMEPAGE="http://www.cherokee-project.com/"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~x86 ~amd64"
16 IUSE="ipv6 nls ssl static pam coverpage threads kernel_linux admin debug geoip ldap mysql ffmpeg fastcgi"
17
18 RDEPEND="
19 >=sys-libs/zlib-1.1.4-r1
20 net-analyzer/rrdtool
21 nls? ( sys-devel/gettext )
22 ssl? ( dev-libs/openssl )
23 pam? ( virtual/pam )
24 admin? ( dev-lang/python )
25 geoip? ( dev-libs/geoip )
26 ldap? ( net-nds/openldap )
27 mysql? ( virtual/mysql )
28 fastcgi? ( www-servers/spawn-fcgi )
29 ffmpeg? ( media-video/ffmpeg )"
30 DEPEND="${RDEPEND}"
31
32 src_prepare() {
33 python_convert_shebangs -r 2 .
34 }
35
36 src_compile() {
37 local myconf
38
39 if use static ; then
40 myconf="${myconf} --enable-static --enable-static-module=all"
41 else
42 myconf="${myconf} --disable-static"
43 fi
44
45 if use debug ; then
46 myconf="${myconf} --enable-trace"
47 fi
48
49 local os="Unknown"
50 case "${CHOST}" in
51 *-freebsd*)
52 os="FreeBSD" ;;
53 *-netbsd*)
54 os="NetBSD" ;;
55 *-openbsd*)
56 os="OpenBSD" ;;
57 *)
58 os="Linux" ;;
59 esac
60
61 # No options to enable or disable ssl since Cherokee 0.11
62 econf \
63 ${myconf} \
64 $(use_enable pam) \
65 $(use_enable ipv6) \
66 $(use_enable nls) \
67 $(use_enable threads pthread) \
68 $(use_enable kernel_linux epoll) \
69 $(use_with geoip) \
70 $(use_with ldap) \
71 $(use_with mysql) \
72 $(use_with ffmpeg) \
73 --disable-dependency-tracking \
74 --enable-os-string="Gentoo ${os}" \
75 --with-wwwroot=/var/www/localhost/htdocs \
76 --prefix=/usr \
77 --sysconfdir=/etc \
78 --localstatedir=/var \
79 || die "configure failed"
80
81 emake -j1 || die "emake failed"
82 }
83
84 src_install () {
85 emake DESTDIR="${D}" docdir="/usr/share/doc/${PF}/html" install || die "make install failed"
86
87 dodoc AUTHORS ChangeLog
88
89 use pam && pamd_mimic system-auth cherokee auth account session
90 newinitd "${FILESDIR}/${PN}-initd-0.99.23" ${PN} || die "newinitd failed"
91
92 dodir /usr/share/doc/${PF}/contrib
93 insinto /usr/share/${PF}/contrib
94 doins contrib/07to08.py
95 doins contrib/08to09.py
96 doins contrib/09to010.py
97 doins contrib/011to098.py
98 doins contrib/098to099.py
99 doins contrib/0999to09910.py
100 doins contrib/make-cert.sh
101
102 keepdir /etc/cherokee/mods-enabled /etc/cherokee/sites-enabled /var/www/localhost/htdocs
103
104 use coverpage || rm -rf "${D}"/var/www/localhost/htdocs/{index.html,images}
105 if use admin ; then
106 exeinto /usr/share/cherokee/admin
107 doexe admin/server.py
108 else
109 rm -rf "${D}"/usr/sbin/admin "${D}"/usr/share/cherokee/admin
110 fi
111
112 # Puts logs in /var/log/cherokee/
113 dosed "s:/var/log/cherokee\.:/var/log/cherokee/cherokee\.:g" /etc/cherokee/cherokee.conf
114
115 # Force shebang to use python2
116 dosed "s:\#\!/usr/bin/env\ python:\#\!/usr/bin/python2:g" /usr/share/cherokee/admin/server.py
117
118
119 }
120
121 pkg_setup() {
122 python_set_active_version 2
123 }
124
125 pkg_postinst() {
126 enewgroup cherokee
127 enewuser cherokee -1 -1 /var/www/localhost cherokee
128 install -o cherokee -g cherokee -m0775 -d "${ROOT}"var/log/cherokee
129
130 # check if user/group was defined if not add it
131 gr="/bin/grep -q"
132 ec="/bin/echo"
133 $gr server\!user /etc/cherokee/cherokee.conf ; rtu=$?
134 $gr server\!group /etc/cherokee/cherokee.conf ; rtg=$?
135
136 [[ "x$rtu" == "x1" ]] && $ec server\!user = cherokee >> /etc/cherokee/cherokee.conf
137 [[ "x$rtg" == "x1" ]] && $ec server\!group = cherokee >> /etc/cherokee/cherokee.conf
138
139 if use admin ; then
140 echo ""
141 elog "Just run 'cherokee-admin' and go to: http://localhost:9090"
142 echo ""
143 else
144 echo ""
145 elog "Try USE=admin if you want an easy way to configure cherokee."
146 echo ""
147 fi
148
149 echo ""
150 elog "Config format can change in different versions. Check converter script in:"
151 elog " /usr/share/cherokee-0.99.15/contrib/"
152 elog "for example:"
153 elog " PYTHONPATH="/usr/share/cherokee/admin/" python \\"
154 elog " /usr/share/cherokee-0.99.15/contrib/0999to09910.py \\"
155 elog " /etc/cherokee/cherokee.conf /etc/cherokee/cherokee.conf-0.99.15"
156
157 }

  ViewVC Help
Powered by ViewVC 1.1.20