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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Apr 8 18:30:55 2015 UTC (4 years ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -2 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 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.104.ebuild,v 1.2 2015/03/07 17:29:35 blueness Exp $
4
5 EAPI="5"
6
7 WANT_AUTOMAKE="1.11"
8
9 PYTHON_COMPAT=( python2_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 HOMEPAGE="http://www.cherokee-project.com/"
16
17 LICENSE="GPL-2"
18 SLOT="0"
19 KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
20 IUSE="admin ffmpeg debug geoip ipv6 kernel_linux ldap mysql nls pam php rrdtool ssl static static-libs"
21
22 COMMON_DEPEND="dev-libs/libpcre
23 >=sys-libs/zlib-1.1.4-r1
24 ffmpeg? ( virtual/ffmpeg )
25 geoip? ( dev-libs/geoip )
26 ldap? ( net-nds/openldap )
27 mysql? ( >=virtual/mysql-5 )
28 nls? ( virtual/libintl )
29 pam? ( virtual/pam )
30 php? ( || (
31 dev-lang/php[fpm]
32 dev-lang/php[cgi]
33 ) )
34 ssl? ( dev-libs/openssl )"
35 DEPEND="${COMMON_DEPEND}
36 nls? ( sys-devel/gettext )"
37 RDEPEND="${COMMON_DEPEND}
38 rrdtool? ( net-analyzer/rrdtool )"
39
40 RESTRICT="test"
41
42 WEBROOT="/var/www/localhost"
43
44 src_unpack() {
45 unpack ${A}
46 mv "webserver-${PV}" "${S}" || die
47 }
48
49 pkg_setup() {
50 enewgroup cherokee
51 enewuser cherokee -1 -1 /var/www cherokee
52 }
53
54 src_prepare() {
55 python_setup
56 epatch \
57 "${FILESDIR}/${PN}-1.2.99-gentoo.patch"
58
59 "${S}/po/admin/generate_POTFILESin.py" > po/admin/POTFILES.in
60 eautoreconf
61 }
62
63 src_configure() {
64 local myconf
65
66 if use admin ; then
67 myconf="${myconf} --enable-admin --with-python=/usr/bin/python"
68 else
69 myconf="${myconf} --disable-admin"
70 fi
71
72 # Uses autodetect because --with-php requires path to php-{fpm,cgi}.
73 if ! use php ; then
74 myconf="${myconf} --without-php"
75 fi
76
77 if use static ; then
78 myconf="${myconf} --enable-static-module=all"
79 fi
80
81 local os="Unknown"
82 case "${CHOST}" in
83 *-freebsd*)
84 os="FreeBSD" ;;
85 *-netbsd*)
86 os="NetBSD" ;;
87 *-openbsd*)
88 os="OpenBSD" ;;
89 *)
90 os="Linux" ;;
91 esac
92
93 econf \
94 $(use_enable debug trace) \
95 $(use_enable debug backtraces) \
96 $(use_enable ipv6) \
97 $(use_enable kernel_linux epoll) \
98 $(use_enable nls) \
99 $(use_enable pam) \
100 $(use_enable static-libs static) \
101 $(use_with ffmpeg) \
102 $(use_with geoip) \
103 $(use_with ldap) \
104 $(use_with mysql) \
105 $(use_with ssl libssl) \
106 --disable-dependency-tracking \
107 --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
108 --enable-os-string="Gentoo ${os}" \
109 --enable-tmpdir="${EPREFIX}/var/tmp" \
110 --localstatedir="${EPREFIX}/var" \
111 --with-wwwroot="${EPREFIX}${WEBROOT}/htdocs" \
112 --with-cgiroot="${EPREFIX}${WEBROOT}/cgi-bin" \
113 --with-wwwuser=cherokee \
114 --with-wwwgroup=cherokee \
115 ${myconf}
116 }
117
118 src_install() {
119 emake DESTDIR="${D}" install
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 NEWS README.rst
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}
134 newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN}
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}
146
147 #move the htdocs to docdir, bug #429632
148 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
149 mv "${ED}"${WEBROOT}/htdocs \
150 "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
151 mkdir "${ED}"${WEBROOT}/htdocs
152
153 keepdir \
154 "${WEBROOT}"/htdocs \
155 /var/log/cherokee \
156 /var/lib/cherokee/graphs/images
157 fowners cherokee:cherokee \
158 /var/log/cherokee \
159 /var/lib/cherokee/graphs \
160 /var/lib/cherokee/graphs/images
161
162 # logrotate
163 insinto /etc/logrotate.d
164 newins "${FILESDIR}"/${PN}.logrotate-r1 ${PN}
165
166 systemd_dounit "${FILESDIR}"/cherokee.service
167 }
168
169 pkg_postinst() {
170 elog
171 if use admin ; then
172 elog "Just run '/usr/sbin/cherokee-admin' and go to: http://localhost:9090"
173 elog
174 elog "Cherokee currently supports configuration versioning, so from now on,"
175 elog "whenever a change is made to the configuration file format,"
176 elog "Cherokee-Admin will be able to automatically convert yours to the new"
177 elog "release. You simply have to load Cherokee-Admin and it will be converted"
178 elog "once you proceed to saving it."
179 elog
180 elog "There is also a command line utility that you can use to do the exact"
181 elog "same thing. Config format can change in different versions. It is"
182 elog "provided under:"
183 elog " ${EPREFIX}/usr/share/cherokee/admin/upgrade_config.py"
184 else
185 elog "Try USE=admin if you want an easy way to configure cherokee."
186 fi
187 elog
188 elog "emerge www-servers/spawn-fcgi if you use Ruby on Rails with ${PN}."
189 elog
190 }

  ViewVC Help
Powered by ViewVC 1.1.20