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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Sep 28 10:56:42 2013 UTC (11 months, 2 weeks ago) by patrick
Branch: MAIN
Changes since 1.1: +3 -3 lines
Whitespace and quoting

(Portage version: 2.2.7/cvs/Linux x86_64, unsigned Manifest commit)

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

  ViewVC Help
Powered by ViewVC 1.1.20