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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jul 17 07:34:08 2013 UTC (9 months ago) by blueness
Branch: MAIN
Version bump

(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key 0xF52D4BBA)

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

  ViewVC Help
Powered by ViewVC 1.1.20