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

Contents of /www-servers/monkeyd/monkeyd-1.2.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jun 6 21:06:02 2013 UTC (6 years, 4 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
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 eutils
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 # Fixes security issue, bug #472400, CVE-2013-3843
46 epatch "${FILESDIR}"/${PN}-fix-DoS-headers-parser.patch
47
48 # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
49 sed -i '/Creating bin\/banana/d' configure || die "No configure file"
50 sed -i '/create_banana_script bindir/d' configure || die "No configure file"
51
52 # Don't explicitly strip files
53 sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
54
55 # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
56 use minimal && {
57 sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
58 sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
59 sed -i '/ln -sf/d' configure || die "No configure file"
60 sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
61 sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
62 }
63
64 # Unquiet build
65 sed -i '/^CC\s/d' configure || die "No configure file"
66 sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
67 sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
68 makes=$(find . -iname Makefile.in)
69 for f in ${makes}; do
70 sed -i '/^CC\s/d' $f || die "No file "$f
71 sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
72 done
73 }
74
75 src_configure() {
76 local myconf=""
77
78 use uclibc && myconf+=" --uclib-mode"
79
80 if use debug; then
81 myconf+=" --debug --trace"
82 else
83 myconf+=" --no-backtrace"
84 fi
85
86 use minimal || myconf+=" --enable-shared"
87
88 local enable_plugins=""
89 local disable_plugins=""
90 for p in ${PLUGINS}; do
91 cp=${p/monkeyd_plugins_/}
92 use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
93 done
94 myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
95
96 # Non-autotools configure
97 ./configure \
98 --prefix=/usr \
99 --bindir=/usr/bin \
100 --datadir=${WEBROOT}/htdocs \
101 --logdir=/var/log/${PN} \
102 --mandir=/usr/share/man \
103 --libdir=/usr/$(get_libdir) \
104 --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
105 --sysconfdir=/etc/${PN} \
106 --platform="generic" \
107 ${myconf} \
108 || die
109 }
110
111 src_compile() {
112 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
113
114 # Don't install the banana script man page
115 rm "${S}"/man/banana.1
116 }
117
118 src_install() {
119 default
120
121 if use php ; then
122 sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
123 sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
124 fi
125
126 sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
127 newinitd "${FILESDIR}"/monkeyd.initd monkeyd
128 newconfd "${FILESDIR}"/monkeyd.confd monkeyd
129
130 #move htdocs to docdir, bug #429632
131 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
132 mv "${D}"${WEBROOT}/htdocs \
133 "${D}"/usr/share/doc/"${PF}"/htdocs.dist
134 mkdir "${D}"${WEBROOT}/htdocs
135
136 keepdir \
137 /var/log/monkeyd \
138 ${WEBROOT}/htdocs
139 }

  ViewVC Help
Powered by ViewVC 1.1.20