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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat May 31 14:53:01 2014 UTC (8 weeks, 3 days ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Switch to python-r1 and fix bug #506780

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

1 # Copyright 1999-2014 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.3 2014/01/08 06:08:37 vapier Exp $
4
5 EAPI="5"
6
7 WANT_AUTOMAKE="1.11"
8
9 PYTHON_COMPAT=( python{2_6,2_7} )
10
11 inherit autotools python-r1 eutils multilib pam systemd user
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 enewgroup cherokee
54 enewuser cherokee -1 -1 /var/www cherokee
55 }
56
57 src_prepare() {
58 python_setup
59 epatch \
60 "${FILESDIR}/${PN}-1.2.99-gentoo.patch" \
61 "${FILESDIR}/${PN}-1.2.103-linux3.patch"
62
63 "${S}/po/admin/generate_POTFILESin.py" > po/admin/POTFILES.in
64 eautoreconf
65 }
66
67 src_configure() {
68 local myconf
69
70 if use admin ; then
71 myconf="${myconf} --enable-admin --with-python=/usr/bin/python"
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 econf \
98 $(use_enable debug trace) \
99 $(use_enable debug backtraces) \
100 $(use_enable ipv6) \
101 $(use_enable kernel_linux epoll) \
102 $(use_enable nls) \
103 $(use_enable pam) \
104 $(use_enable static-libs static) \
105 $(use_with ffmpeg) \
106 $(use_with geoip) \
107 $(use_with ldap) \
108 $(use_with mysql) \
109 $(use_with ssl libssl) \
110 --disable-dependency-tracking \
111 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
112 --enable-os-string="Gentoo ${os}" \
113 --enable-tmpdir="${EPREFIX}/var/tmp" \
114 --localstatedir="${EPREFIX}/var" \
115 --with-wwwroot="${EPREFIX}${WEBROOT}/htdocs" \
116 --with-cgiroot="${EPREFIX}${WEBROOT}/cgi-bin" \
117 --with-wwwuser=cherokee \
118 --with-wwwgroup=cherokee \
119 ${myconf}
120 }
121
122 src_install() {
123 emake DESTDIR="${D}" install
124
125 if ! use static-libs ; then
126 find "${ED}" -name '*.la' -delete || die
127 elif ! use static ; then
128 find "${ED}/usr/$(get_libdir)/cherokee" '(' -name '*.la' -o -name '*.a' ')' -delete || die
129 fi
130
131 dodoc AUTHORS NEWS README.rst
132
133 if use pam ; then
134 pamd_mimic system-auth cherokee auth account session || die
135 fi
136
137 newinitd "${FILESDIR}/${PN}-initd-1.2.99" ${PN}
138 newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN}
139
140 if ! use admin ; then
141 rm -r \
142 "${ED}"/usr/bin/cherokee-admin-launcher \
143 "${ED}"/usr/bin/CTK-run \
144 "${ED}"/usr/sbin/cherokee-admin \
145 "${ED}"/usr/share/cherokee/admin || die
146 fi
147
148 exeinto /usr/share/doc/${PF}/contrib
149 doexe contrib/{bin2buffer.py,make-cert.sh,make-dh_params.sh,tracelor.py}
150
151 #move the htdocs to docdir, bug #429632
152 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
153 mv "${ED}"${WEBROOT}/htdocs \
154 "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
155 mkdir "${ED}"${WEBROOT}/htdocs
156
157 keepdir \
158 "${WEBROOT}"/htdocs \
159 /var/log/cherokee \
160 /var/lib/cherokee/graphs/images
161 fowners cherokee:cherokee \
162 /var/log/cherokee \
163 /var/lib/cherokee/graphs \
164 /var/lib/cherokee/graphs/images
165
166 # logrotate
167 insinto /etc/logrotate.d
168 newins "${FILESDIR}"/${PN}.logrotate-r1 ${PN}
169
170 systemd_dounit "${FILESDIR}"/cherokee.service
171 }
172
173 pkg_postinst() {
174 elog
175 if use admin ; then
176 elog "Just run '/usr/sbin/cherokee-admin' and go to: http://localhost:9090"
177 elog
178 elog "Cherokee currently supports configuration versioning, so from now on,"
179 elog "whenever a change is made to the configuration file format,"
180 elog "Cherokee-Admin will be able to automatically convert yours to the new"
181 elog "release. You simply have to load Cherokee-Admin and it will be converted"
182 elog "once you proceed to saving it."
183 elog
184 elog "There is also a command line utility that you can use to do the exact"
185 elog "same thing. Config format can change in different versions. It is"
186 elog "provided under:"
187 elog " ${EPREFIX}/usr/share/cherokee/admin/upgrade_config.py"
188 else
189 elog "Try USE=admin if you want an easy way to configure cherokee."
190 fi
191 elog
192 elog "emerge www-servers/spawn-fcgi if you use Ruby on Rails with ${PN}."
193 elog
194 }

  ViewVC Help
Powered by ViewVC 1.1.20