/[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.1 - (show annotations) (download)
Wed Aug 8 12:28:37 2012 UTC (2 years, 4 months ago) by blueness
Branch: MAIN
Move distributed htdocs to doc dir, bug #429632

(Portage version: 2.1.10.65/cvs/Linux x86_64)

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-r1.ebuild,v 1.3 2012/07/15 17:59:08 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
56 python_convert_shebangs -r 2 .
57 }
58
59 src_configure() {
60 local myconf
61
62 if use admin ; then
63 myconf="${myconf} --enable-admin --with-python=$(PYTHON -2)"
64 else
65 myconf="${myconf} --disable-admin --without-python"
66 fi
67
68 # Uses autodetect because --with-php requires path to php-{fpm,cgi}.
69 if ! use php ; then
70 myconf="${myconf} --without-php"
71 fi
72
73 if use static ; then
74 myconf="${myconf} --enable-static-module=all"
75 fi
76
77 local os="Unknown"
78 case "${CHOST}" in
79 *-freebsd*)
80 os="FreeBSD" ;;
81 *-netbsd*)
82 os="NetBSD" ;;
83 *-openbsd*)
84 os="OpenBSD" ;;
85 *)
86 os="Linux" ;;
87 esac
88
89 # This make cherokee 1.2 sad
90 # $(use_enable threads pthread) \
91 econf \
92 $(use_enable debug trace) \
93 $(use_enable debug backtraces) \
94 $(use_enable ipv6) \
95 $(use_enable kernel_linux epoll) \
96 $(use_enable nls) \
97 $(use_enable pam) \
98 $(use_enable static-libs static) \
99 $(use_with ffmpeg) \
100 $(use_with geoip) \
101 $(use_with ldap) \
102 $(use_with mysql) \
103 $(use_with ssl libssl) \
104 --disable-dependency-tracking \
105 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
106 --enable-os-string="Gentoo ${os}" \
107 --enable-tmpdir="${EPREFIX}/var/tmp" \
108 --localstatedir="${EPREFIX}/var" \
109 --with-wwwroot="${EPREFIX}${WEBROOT}/htdocs" \
110 --with-cgiroot="${EPREFIX}${WEBROOT}/cgi-bin" \
111 --with-wwwuser=cherokee \
112 --with-wwwgroup=cherokee \
113 ${myconf}
114 }
115
116 src_install() {
117 emake DESTDIR="${D}" install
118
119 if ! use static-libs ; then
120 find "${ED}" -name '*.la' -delete || die
121 elif ! use static ; then
122 find "${ED}/usr/$(get_libdir)/cherokee" '(' -name '*.la' -o -name '*.a' ')' -delete || die
123 fi
124
125 dodoc AUTHORS ChangeLog README
126
127 if use pam ; then
128 pamd_mimic system-auth cherokee auth account session || die
129 fi
130
131 newinitd "${FILESDIR}/${PN}-initd-1.2.99" ${PN}
132 newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN}
133
134 if ! use admin ; then
135 rm -r \
136 "${ED}"/usr/bin/cherokee-admin-launcher \
137 "${ED}"/usr/bin/CTK-run \
138 "${ED}"/usr/sbin/cherokee-admin \
139 "${ED}"/usr/share/cherokee/admin || die
140 fi
141
142 exeinto /usr/share/doc/${PF}/contrib
143 doexe contrib/{bin2buffer.py,make-cert.sh,make-dh_params.sh,tracelor.py}
144
145 #move the htdocs to docdir, bug #429632
146 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
147 mv "${ED}"${WEBROOT}/htdocs \
148 "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
149 mkdir "${ED}"${WEBROOT}/htdocs
150
151 keepdir \
152 "${WEBROOT}"/htdocs \
153 /var/log/cherokee \
154 /var/lib/cherokee/graphs/images
155 fowners cherokee:cherokee \
156 /var/log/cherokee \
157 /var/lib/cherokee/graphs \
158 /var/lib/cherokee/graphs/images
159
160 # logrotate
161 insinto /etc/logrotate.d
162 newins "${FILESDIR}"/${PN}.logrotate-r1 ${PN}
163 }
164
165 pkg_postinst() {
166 elog
167 if use admin ; then
168 python_mod_optimize "${EPREFIX}/usr/share/cherokee/admin/"
169 elog "Just run '/usr/sbin/cherokee-admin' and go to: http://localhost:9090"
170 elog
171 elog "Cherokee currently supports configuration versioning, so from now on,"
172 elog "whenever a change is made to the configuration file format,"
173 elog "Cherokee-Admin will be able to automatically convert yours to the new"
174 elog "release. You simply have to load Cherokee-Admin and it will be converted"
175 elog "once you proceed to saving it."
176 elog
177 elog "There is also a command line utility that you can use to do the exact"
178 elog "same thing. Config format can change in different versions. It is"
179 elog "provided under:"
180 elog " ${EPREFIX}/usr/share/cherokee/admin/upgrade_config.py"
181 else
182 elog "Try USE=admin if you want an easy way to configure cherokee."
183 fi
184 elog
185 elog "emerge www-servers/spawn-fcgi if you use Ruby on Rails with ${PN}."
186 elog
187 }
188
189 pkg_postrm() {
190 if use admin ; then
191 python_mod_cleanup "${EPREFIX}/usr/share/cherokee/admin/"
192 fi
193 }

  ViewVC Help
Powered by ViewVC 1.1.20