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

Contents of /www-servers/cherokee/cherokee-1.2.101-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Nov 25 17:24:03 2012 UTC (16 months, 3 weeks ago) by lu_zero
Branch: MAIN
Changes since 1.1: +3 -2 lines
Add libav-9 support

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 1191738E)

1 # Copyright 1999-2012 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.101-r2.ebuild,v 1.1 2012/08/08 12:28:37 blueness Exp $
4
5 EAPI=4
6 PYTHON_DEPEND="admin? 2"
7 PYTHON_USE_WITH="threads"
8
9 inherit eutils multilib pam python versionator
10
11 DESCRIPTION="An extremely fast and tiny web server."
12 SRC_URI="http://www.cherokee-project.com/download/$(get_version_component_range 1-2)/${PV}/${P}.tar.gz"
13 HOMEPAGE="http://www.cherokee-project.com/"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
18 IUSE="admin ffmpeg debug geoip ipv6 kernel_linux ldap mysql nls pam php rrdtool ssl static static-libs"
19
20 COMMON_DEPEND="dev-libs/libpcre
21 >=sys-libs/zlib-1.1.4-r1
22 ffmpeg? ( virtual/ffmpeg )
23 geoip? ( dev-libs/geoip )
24 ldap? ( net-nds/openldap )
25 mysql? ( >=virtual/mysql-5 )
26 nls? ( virtual/libintl )
27 pam? ( virtual/pam )
28 php? ( || (
29 dev-lang/php[fpm]
30 dev-lang/php[cgi]
31 ) )
32 ssl? ( dev-libs/openssl )"
33 DEPEND="${COMMON_DEPEND}
34 nls? ( sys-devel/gettext )"
35 RDEPEND="${COMMON_DEPEND}
36 rrdtool? ( net-analyzer/rrdtool )"
37
38 RESTRICT="test"
39
40 WEBROOT="/var/www/localhost"
41
42 pkg_setup() {
43 python_pkg_setup
44
45 python_set_active_version 2
46
47 enewgroup cherokee
48 enewuser cherokee -1 -1 /var/www cherokee
49 }
50
51 src_prepare() {
52 epatch \
53 "${FILESDIR}/${PN}-1.2.99-gentoo.patch" \
54 "${FILESDIR}/${PN}-1.2.98-linux3.patch" \
55 "${FILESDIR}/${P}-libav-9.patch"
56
57 python_convert_shebangs -r 2 .
58 }
59
60 src_configure() {
61 local myconf
62
63 if use admin ; then
64 myconf="${myconf} --enable-admin --with-python=$(PYTHON -2)"
65 else
66 myconf="${myconf} --disable-admin --without-python"
67 fi
68
69 # Uses autodetect because --with-php requires path to php-{fpm,cgi}.
70 if ! use php ; then
71 myconf="${myconf} --without-php"
72 fi
73
74 if use static ; then
75 myconf="${myconf} --enable-static-module=all"
76 fi
77
78 local os="Unknown"
79 case "${CHOST}" in
80 *-freebsd*)
81 os="FreeBSD" ;;
82 *-netbsd*)
83 os="NetBSD" ;;
84 *-openbsd*)
85 os="OpenBSD" ;;
86 *)
87 os="Linux" ;;
88 esac
89
90 # This make cherokee 1.2 sad
91 # $(use_enable threads pthread) \
92 econf \
93 $(use_enable debug trace) \
94 $(use_enable debug backtraces) \
95 $(use_enable ipv6) \
96 $(use_enable kernel_linux epoll) \
97 $(use_enable nls) \
98 $(use_enable pam) \
99 $(use_enable static-libs static) \
100 $(use_with ffmpeg) \
101 $(use_with geoip) \
102 $(use_with ldap) \
103 $(use_with mysql) \
104 $(use_with ssl libssl) \
105 --disable-dependency-tracking \
106 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
107 --enable-os-string="Gentoo ${os}" \
108 --enable-tmpdir="${EPREFIX}/var/tmp" \
109 --localstatedir="${EPREFIX}/var" \
110 --with-wwwroot="${EPREFIX}${WEBROOT}/htdocs" \
111 --with-cgiroot="${EPREFIX}${WEBROOT}/cgi-bin" \
112 --with-wwwuser=cherokee \
113 --with-wwwgroup=cherokee \
114 ${myconf}
115 }
116
117 src_install() {
118 emake DESTDIR="${D}" install
119
120 if ! use static-libs ; then
121 find "${ED}" -name '*.la' -delete || die
122 elif ! use static ; then
123 find "${ED}/usr/$(get_libdir)/cherokee" '(' -name '*.la' -o -name '*.a' ')' -delete || die
124 fi
125
126 dodoc AUTHORS ChangeLog README
127
128 if use pam ; then
129 pamd_mimic system-auth cherokee auth account session || die
130 fi
131
132 newinitd "${FILESDIR}/${PN}-initd-1.2.99" ${PN}
133 newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN}
134
135 if ! use admin ; then
136 rm -r \
137 "${ED}"/usr/bin/cherokee-admin-launcher \
138 "${ED}"/usr/bin/CTK-run \
139 "${ED}"/usr/sbin/cherokee-admin \
140 "${ED}"/usr/share/cherokee/admin || die
141 fi
142
143 exeinto /usr/share/doc/${PF}/contrib
144 doexe contrib/{bin2buffer.py,make-cert.sh,make-dh_params.sh,tracelor.py}
145
146 #move the htdocs to docdir, bug #429632
147 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
148 mv "${ED}"${WEBROOT}/htdocs \
149 "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
150 mkdir "${ED}"${WEBROOT}/htdocs
151
152 keepdir \
153 "${WEBROOT}"/htdocs \
154 /var/log/cherokee \
155 /var/lib/cherokee/graphs/images
156 fowners cherokee:cherokee \
157 /var/log/cherokee \
158 /var/lib/cherokee/graphs \
159 /var/lib/cherokee/graphs/images
160
161 # logrotate
162 insinto /etc/logrotate.d
163 newins "${FILESDIR}"/${PN}.logrotate-r1 ${PN}
164 }
165
166 pkg_postinst() {
167 elog
168 if use admin ; then
169 python_mod_optimize "${EPREFIX}/usr/share/cherokee/admin/"
170 elog "Just run '/usr/sbin/cherokee-admin' and go to: http://localhost:9090"
171 elog
172 elog "Cherokee currently supports configuration versioning, so from now on,"
173 elog "whenever a change is made to the configuration file format,"
174 elog "Cherokee-Admin will be able to automatically convert yours to the new"
175 elog "release. You simply have to load Cherokee-Admin and it will be converted"
176 elog "once you proceed to saving it."
177 elog
178 elog "There is also a command line utility that you can use to do the exact"
179 elog "same thing. Config format can change in different versions. It is"
180 elog "provided under:"
181 elog " ${EPREFIX}/usr/share/cherokee/admin/upgrade_config.py"
182 else
183 elog "Try USE=admin if you want an easy way to configure cherokee."
184 fi
185 elog
186 elog "emerge www-servers/spawn-fcgi if you use Ruby on Rails with ${PN}."
187 elog
188 }
189
190 pkg_postrm() {
191 if use admin ; then
192 python_mod_cleanup "${EPREFIX}/usr/share/cherokee/admin/"
193 fi
194 }

  ViewVC Help
Powered by ViewVC 1.1.20