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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Oct 17 16:24:30 2011 UTC (2 years, 10 months ago) by matsuu
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bumped.

(Portage version: 2.1.10.27/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.2.1.ebuild,v 1.2 2011/04/04 12:06:58 scarabeus Exp $
4
5 EAPI=2
6 PYTHON_DEPEND="admin? 2"
7
8 inherit python eutils pam versionator libtool
9
10 DESCRIPTION="An extremely fast and tiny web server."
11 SRC_URI="http://www.cherokee-project.com/download/$(get_version_component_range 1-2)/${PV}/${P}.tar.gz"
12 HOMEPAGE="http://www.cherokee-project.com/"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="ipv6 nls ssl static pam coverpage kernel_linux admin debug geoip ldap mysql ffmpeg fastcgi rrdtool"
18
19 RDEPEND="
20 >=sys-libs/zlib-1.1.4-r1
21 rrdtool? ( net-analyzer/rrdtool )
22 nls? ( sys-devel/gettext )
23 ssl? ( dev-libs/openssl )
24 pam? ( virtual/pam )
25 geoip? ( dev-libs/geoip )
26 ldap? ( net-nds/openldap )
27 mysql? ( virtual/mysql )
28 fastcgi? ( www-servers/spawn-fcgi )
29 ffmpeg? ( virtual/ffmpeg )"
30 DEPEND="${RDEPEND}"
31
32 src_prepare() {
33 python_convert_shebangs -r 2 .
34 }
35
36 src_configure() {
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
63 # This make cherokee 1.2 sad
64 # $(use_enable threads pthread) \
65 econf \
66 ${myconf} \
67 $(use_enable pam) \
68 $(use_enable ipv6) \
69 $(use_enable nls) \
70 $(use_enable kernel_linux epoll) \
71 $(use_with geoip) \
72 $(use_with ldap) \
73 $(use_with mysql) \
74 $(use_with ffmpeg) \
75 --disable-dependency-tracking \
76 --enable-os-string="Gentoo ${os}" \
77 --with-wwwroot=/var/www/localhost/htdocs \
78 --prefix=/usr \
79 --sysconfdir=/etc \
80 --localstatedir=/var \
81 || die "configure failed"
82 }
83
84 src_compile() {
85 emake || die "emake failed"
86 }
87
88 src_install () {
89 emake -j1 DESTDIR="${D}" docdir="/usr/share/doc/${PF}/html" install || die "make install failed"
90
91 dodoc AUTHORS ChangeLog
92
93 use pam && pamd_mimic system-auth cherokee auth account session
94 newinitd "${FILESDIR}/${PN}-initd-1.2.0" ${PN} || die "newinitd failed"
95
96 dodir /usr/share/doc/${PF}/contrib
97 insinto /usr/share/${PF}/contrib
98 doins contrib/07to08.py
99 doins contrib/08to09.py
100 doins contrib/09to010.py
101 doins contrib/011to098.py
102 doins contrib/098to099.py
103 doins contrib/0999to09910.py
104 doins contrib/make-cert.sh
105
106 keepdir /etc/cherokee/mods-enabled /etc/cherokee/sites-enabled /var/www/localhost/htdocs
107
108 use coverpage || rm -rf "${D}"/var/www/localhost/htdocs/{index.html,images}
109 if use admin ; then
110 exeinto /usr/share/cherokee/admin
111 doexe admin/server.py
112 else
113 rm -rf "${D}"/usr/sbin/admin "${D}"/usr/share/cherokee/admin
114 fi
115
116 # Puts logs in /var/log/cherokee/
117 dosed "s:/var/log/cherokee\.:/var/log/cherokee/cherokee\.:g" /etc/cherokee/cherokee.conf
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/${PF}/contrib/"
152 elog "for example:"
153 elog " PYTHONPATH="/usr/share/cherokee/admin/" python \\"
154 elog " /usr/share/${PF}/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