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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Fri Sep 16 11:57:03 2011 UTC (3 years ago) by matsuu
Branch: MAIN
Version bumped. Added cherokee.logrotate. Fixed graceful and reload in init.d, bug #348929. Clean up.

(Portage version: 2.1.10.15/cvs/Linux x86_64)

1 matsuu 1.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.98.ebuild,v 1.1 2011/08/26 11:58:08 matsuu Exp $
4    
5     EAPI="3"
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 ~x86"
18     IUSE="admin coverpage 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     pkg_setup() {
41     python_pkg_setup
42    
43     python_set_active_version 2
44    
45     enewgroup cherokee
46     enewuser cherokee -1 -1 /var/www cherokee
47     }
48    
49     src_prepare() {
50     epatch \
51     "${FILESDIR}/${P}-gentoo.patch" \
52     "${FILESDIR}/${PN}-1.2.98-linux3.patch"
53    
54     python_convert_shebangs -r 2 .
55     }
56    
57     src_configure() {
58     local myconf
59    
60     if use admin ; then
61     myconf="${myconf} --enable-admin --with-python=$(PYTHON -2)"
62     else
63     myconf="${myconf} --disable-admin --without-python"
64     fi
65    
66     # Uses autodetect because --with-php requires path to php-{fpm,cgi}.
67     if ! use php ; then
68     myconf="${myconf} --without-php"
69     fi
70    
71     if use static ; then
72     myconf="${myconf} --enable-static-module=all"
73     fi
74    
75     local os="Unknown"
76     case "${CHOST}" in
77     *-freebsd*)
78     os="FreeBSD" ;;
79     *-netbsd*)
80     os="NetBSD" ;;
81     *-openbsd*)
82     os="OpenBSD" ;;
83     *)
84     os="Linux" ;;
85     esac
86    
87     # This make cherokee 1.2 sad
88     # $(use_enable threads pthread) \
89     econf \
90     $(use_enable debug trace) \
91     $(use_enable debug backtraces) \
92     $(use_enable ipv6) \
93     $(use_enable kernel_linux epoll) \
94     $(use_enable nls) \
95     $(use_enable pam) \
96     $(use_enable static-libs static) \
97     $(use_with ffmpeg) \
98     $(use_with geoip) \
99     $(use_with ldap) \
100     $(use_with mysql) \
101     $(use_with ssl libssl) \
102     --disable-dependency-tracking \
103     --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
104     --enable-os-string="Gentoo ${os}" \
105     --enable-tmpdir="${EPREFIX}/var/tmp" \
106     --localstatedir="${EPREFIX}/var" \
107     --with-wwwroot="${EPREFIX}/var/www/localhost/htdocs" \
108     --with-cgiroot="${EPREFIX}/var/www/localhost/cgi-bin" \
109     --with-wwwuser=cherokee \
110     --with-wwwgroup=cherokee \
111     ${myconf} || die "configure failed"
112     }
113    
114     src_test() {
115     emake test || die
116     }
117    
118     src_install() {
119     emake DESTDIR="${D}" install || die "make install failed"
120    
121     if ! use static-libs ; then
122     find "${ED}" -name '*.la' -delete || die
123     elif ! use static ; then
124     find "${ED}/usr/$(get_libdir)/cherokee" '(' -name '*.la' -o -name '*.a' ')' -delete || die
125     fi
126    
127     dodoc AUTHORS ChangeLog README || die
128    
129     if use pam ; then
130     pamd_mimic system-auth cherokee auth account session || die
131     fi
132    
133     newinitd "${FILESDIR}/${PN}-initd-1.2.99" ${PN} || die "newinitd ${PN} failed"
134     newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN} || die "newconfd ${PN} failed"
135    
136     if ! use admin ; then
137     rm -r \
138     "${ED}"/usr/bin/cherokee-admin-launcher \
139     "${ED}"/usr/bin/CTK-run \
140     "${ED}"/usr/sbin/cherokee-admin \
141     "${ED}"/usr/share/cherokee/admin || die
142     fi
143    
144     exeinto /usr/share/doc/${PF}/contrib
145     doexe contrib/{bin2buffer.py,make-cert.sh,make-dh_params.sh,tracelor.py} || die
146    
147     keepdir \
148     /var/www/localhost/htdocs \
149     /var/log/cherokee \
150     /var/lib/cherokee/graphs/images || die
151     fowners cherokee:cherokee \
152     /var/log/cherokee \
153     /var/lib/cherokee/graphs \
154     /var/lib/cherokee/graphs/images || die
155    
156     # logrotate
157     insinto /etc/logrotate.d
158     newins "${FILESDIR}"/${PN}.logrotate ${PN} || die
159    
160     if ! use coverpage ; then
161     rm -r "${ED}"/var/www/localhost/htdocs/* || die
162     fi
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