/[gentoo-x86]/www-servers/monkeyd/monkeyd-1.2.1.ebuild
Gentoo

Contents of /www-servers/monkeyd/monkeyd-1.2.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Jun 6 21:06:02 2013 UTC (15 months, 2 weeks ago) by blueness
Branch: MAIN
Upstream bump to fix potencial DoS bug in headers parser, bug #472400, CVE-2013-3843

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

1 # Copyright 1999- Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-servers/monkeyd/monkeyd-1.2.0-r1.ebuild,v 1.1 2013/06/05 20:53:14 blueness Exp $
4
5 EAPI="5"
6
7 inherit toolchain-funcs depend.php multilib
8
9 MY_P="${PN/d}-${PV}"
10 DESCRIPTION="A small, fast, and scalable web server"
11 HOMEPAGE="http://www.monkey-project.com/"
12 SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
17
18 # ssl is broken, so we turn it off until fixed
19 IUSE="-debug php minimal uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
20
21 # uclibc is often compiled without backtrace info so we should
22 # force this off. If someone complains, consider relaxing it.
23 # ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
24 REQUIRED_USE="uclibc? ( !debug )"
25
26 RDEPEND="php? ( dev-lang/php )"
27
28 S="${WORKDIR}/${MY_P}"
29
30 WEBROOT="/var/www/localhost"
31
32 pkg_setup() {
33 use php && require_php_cgi
34
35 if use debug; then
36 ewarn
37 ewarn "\033[1;33m**************************************************\033[00m"
38 ewarn "Do not use debug in production!"
39 ewarn "\033[1;33m**************************************************\033[00m"
40 ewarn
41 fi
42 }
43
44 src_prepare() {
45 # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
46 sed -i '/Creating bin\/banana/d' configure || die "No configure file"
47 sed -i '/create_banana_script bindir/d' configure || die "No configure file"
48
49 # Don't explicitly strip files
50 sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
51
52 # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
53 use minimal && {
54 sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
55 sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
56 sed -i '/ln -sf/d' configure || die "No configure file"
57 sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
58 sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
59 }
60
61 # Unquiet build
62 sed -i '/^CC\s/d' configure || die "No configure file"
63 sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
64 sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
65 makes=$(find . -iname Makefile.in)
66 for f in ${makes}; do
67 sed -i '/^CC\s/d' $f || die "No file "$f
68 sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
69 done
70 }
71
72 src_configure() {
73 local myconf=""
74
75 use uclibc && myconf+=" --uclib-mode"
76
77 if use debug; then
78 myconf+=" --debug --trace"
79 else
80 myconf+=" --no-backtrace"
81 fi
82
83 use minimal || myconf+=" --enable-shared"
84
85 local enable_plugins=""
86 local disable_plugins=""
87 for p in ${PLUGINS}; do
88 cp=${p/monkeyd_plugins_/}
89 use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
90 done
91 myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
92
93 # Non-autotools configure
94 ./configure \
95 --prefix=/usr \
96 --bindir=/usr/bin \
97 --datadir=${WEBROOT}/htdocs \
98 --logdir=/var/log/${PN} \
99 --mandir=/usr/share/man \
100 --libdir=/usr/$(get_libdir) \
101 --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
102 --sysconfdir=/etc/${PN} \
103 --platform="generic" \
104 ${myconf} \
105 || die
106 }
107
108 src_compile() {
109 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
110
111 # Don't install the banana script man page
112 rm "${S}"/man/banana.1
113 }
114
115 src_install() {
116 default
117
118 if use php ; then
119 sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
120 sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
121 fi
122
123 sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
124 newinitd "${FILESDIR}"/monkeyd.initd monkeyd
125 newconfd "${FILESDIR}"/monkeyd.confd monkeyd
126
127 #move htdocs to docdir, bug #429632
128 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
129 mv "${D}"${WEBROOT}/htdocs \
130 "${D}"/usr/share/doc/"${PF}"/htdocs.dist
131 mkdir "${D}"${WEBROOT}/htdocs
132
133 keepdir \
134 /var/log/monkeyd \
135 ${WEBROOT}/htdocs
136 }

  ViewVC Help
Powered by ViewVC 1.1.20