summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /www-servers/monkeyd
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'www-servers/monkeyd')
-rw-r--r--www-servers/monkeyd/Manifest3
-rw-r--r--www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch17
-rw-r--r--www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch157
-rw-r--r--www-servers/monkeyd/files/monkeyd.confd6
-rw-r--r--www-servers/monkeyd/files/monkeyd.initd26
-rw-r--r--www-servers/monkeyd/metadata.xml13
-rw-r--r--www-servers/monkeyd/monkeyd-1.5.3.ebuild144
-rw-r--r--www-servers/monkeyd/monkeyd-1.5.5.ebuild144
-rw-r--r--www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild147
9 files changed, 657 insertions, 0 deletions
diff --git a/www-servers/monkeyd/Manifest b/www-servers/monkeyd/Manifest
new file mode 100644
index 000000000000..acca2cbcbcda
--- /dev/null
+++ b/www-servers/monkeyd/Manifest
@@ -0,0 +1,3 @@
+DIST monkey-1.5.3.tar.gz 892478 SHA256 0ac300e04f052818bc26b7da0183c3c5cd13be8090aaabd3505838587be8c0ec SHA512 6a55ba580bfde3c11329e94055d287e341990e4db4cb5ab12e40b8bab57b4b51fd57cd33fc5aa9d864127f235888f818593be26fe93daa34ca3c40fa8936465f WHIRLPOOL 4038bd2f0b39f6068ab69dc98dec4d5b29feca388c18361f57b653db86c38469d69072ae803ddd565e57350163247072334835216a13d014956a27b91c8a42b6
+DIST monkey-1.5.5.tar.gz 898602 SHA256 5a0554fdb4d8746f5eb665f305bd120c8f2bef3e7fea2a43be6b472461b45b05 SHA512 faf86a36a91c8b1e47f3a2ea7f19aee98eada6f3348ff64f160fc388c268a146d49ad9434043731cf928fca6708db40fa5e1daedc41d4b8cce671f98d590b920 WHIRLPOOL 26b44624f77b72bbd31da6be5855429199a0fc9ab163548f1d0f21a34b84a1f0325241ed7ad5ecbb28c9e9f899458b5d8c15f9f91e27b73a53023c2e3152947d
+DIST monkey-1.5.6.tar.gz 902636 SHA256 7c3d845306aa74ee6effd7ab6169d16ac4e6450e564954d0d0baa2d1e9be1a22 SHA512 4c7c627cb047252252b22da5fba179a21fb5b8dc6280b96307af52757ad049d24b0daaaea51dca4f0429af5e6499c239f6b62a03654cc9e7ad98ae8f5149b64c WHIRLPOOL aba1a928023fc67224f254182eb9707c6594c7092d9ff98ecfa297c91d5c61f79235e7467192b5d46ac114ae67a3cee98e06704721348a40ee825755ab39d9a1
diff --git a/www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch b/www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch
new file mode 100644
index 000000000000..9e88bc999dee
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch
@@ -0,0 +1,17 @@
+diff -Naur monkey-1.5.0.orig/plugins/auth/tools/Makefile.in monkey-1.5.0/plugins/auth/tools/Makefile.in
+--- monkey-1.5.0.orig/plugins/auth/tools/Makefile.in 2014-05-25 19:12:44.000000000 -0400
++++ monkey-1.5.0/plugins/auth/tools/Makefile.in 2014-05-26 13:15:29.347727637 -0400
+@@ -3,10 +3,11 @@
+
+ CC = @echo " CC $(_PATH)/$@"; $CC
+ CC_QUIET= @echo -n; $CC
+-CFLAGS = -I../../../src/include -I../ $CFLAGS
++CPPFLAGS = -I../../../src/include -I../
++CFLAGS = $CFLAGS
+ LDFLAGS = $LDFLAGS
+ SOURCES = ../sha1.c ../base64.c mk_passwd.c
+ OBJECTS = $(SOURCES:../.c=%.o)
+
+ ../../../bin/mk_passwd: $(OBJECTS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -ldl
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ -ldl
diff --git a/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch b/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch
new file mode 100644
index 000000000000..a4934a4e21c1
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch
@@ -0,0 +1,157 @@
+diff -Naur monkey-1.5.2.orig/configure monkey-1.5.2/configure
+--- monkey-1.5.2.orig/configure 2014-07-19 23:27:13.000000000 -0400
++++ monkey-1.5.2/configure 2014-07-26 10:07:08.808171546 -0400
+@@ -193,7 +193,7 @@
+
+ echo "+ Creating src/Makefile"
+ create_makefile2 mod_libs mod_obj make_script platform \
+- malloc_libc malloc_jemalloc
++ malloc_libc
+
+ echo "+ Creating plugins/Make.common"
+ create_plugins_make_common bindir
+@@ -210,33 +210,12 @@
+
+ echo -e "+ Creating Makefile"
+ if [ "$dir" = 0 ]; then
+- create_makefile1 bindir malloc_jemalloc
++ create_makefile1 bindir
+ else
+ create_makefile1_install prefix bindir mandir sysconfdir \
+- datadir logdir malloc_jemalloc
++ datadir logdir
+ fi
+
+- # if the memory allocator is jemalloc, lets start configuring the dependency
+- if [ $malloc_jemalloc -eq 1 ]; then
+- echo
+- echo -e "\033[1m=== Configuring Memory Allocator ===\033[0m"
+- cd deps/jemalloc
+- ./configure $JEMALLOC_OPTS \
+- --with-jemalloc-prefix=je_ \
+- --enable-cc-silence \
+- CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " \
+- LDFLAGS="" > jemalloc.config 2>&1
+- if [ $? -eq 0 ]; then
+- echo "+ Jemalloc configured"
+- else
+- cat jemalloc.config
+- echo
+- echo "check more details with: $ cat deps/jemalloc/config.log"
+- exit 1
+- fi
+- cd ../../
+- fi
+-
+ echo
+ echo -e "\033[1m=== Monkey Configuration ===\033[0m"
+ echo -e "Platform\t= $platform"
+@@ -316,12 +295,6 @@
+ # Create Makefile
+ create_makefile1()
+ {
+- if [ $malloc_jemalloc -eq 1 ]; then
+- $deps="deps/jemalloc"
+- else
+- $deps=""
+- fi
+-
+ cat > Makefile << EOF
+ # Monkey HTTP Daemon: Makefile
+ # ============================
+@@ -459,13 +432,6 @@
+
+ create_makefile1_install()
+ {
+- # memory allocator
+- if [ $malloc_jemalloc -eq 1 ]; then
+- all_deps="$all_deps jemalloc"
+- else
+- deps=""
+- fi
+-
+ # remove old data
+ rm -rf plugins.conf plugins.list
+ touch plugins.conf
+@@ -523,10 +489,6 @@
+ @\$(MAKE) -s -C plugins all
+ @echo " DONE"
+
+-jemalloc:
+- @echo " CC jemalloc [all]"
+- @\$(MAKE) -s -C deps/jemalloc
+-
+ clean:
+ @(cd src; \$(MAKE) clean)
+ @(cd plugins; \$(MAKE) clean)
+@@ -605,9 +567,7 @@
+ fi
+
+ if [ $malloc_jemalloc -eq 1 ]; then
+- extra="../deps/jemalloc/lib/libjemalloc.a"
+- extraso="-Wl,--whole-archive ../deps/jemalloc/lib/libjemalloc_pic.a -Wl,--no-whole-archive"
+- libs="$libs -lm"
++ libs="$libs -ljemalloc"
+ fi
+
+ cat > src/Makefile<<EOF
+diff -Naur monkey-1.5.2.orig/src/include/mk_memory.h monkey-1.5.2/src/include/mk_memory.h
+--- monkey-1.5.2.orig/src/include/mk_memory.h 2014-07-19 23:27:13.000000000 -0400
++++ monkey-1.5.2/src/include/mk_memory.h 2014-07-26 10:08:06.427168785 -0400
+@@ -23,7 +23,7 @@
+ #include <stdio.h>
+
+ #ifdef MALLOC_JEMALLOC
+-#include "../../deps/jemalloc/include/jemalloc/jemalloc.h"
++#include <jemalloc/jemalloc.h>
+ #endif
+
+ #include "mk_macros.h"
+@@ -43,11 +43,7 @@
+ static inline ALLOCSZ_ATTR(1)
+ void *mk_mem_malloc(const size_t size)
+ {
+-#ifdef MALLOC_JEMALLOC
+- void *aux = je_malloc(size);
+-#else
+ void *aux = malloc(size);
+-#endif
+
+ if (mk_unlikely(!aux && size)) {
+ perror("malloc");
+@@ -60,11 +56,7 @@
+ static inline ALLOCSZ_ATTR(1)
+ void *mk_mem_malloc_z(const size_t size)
+ {
+-#ifdef MALLOC_JEMALLOC
+- void *buf = je_calloc(1, size);
+-#else
+ void *buf = calloc(1, size);
+-#endif
+
+ if (mk_unlikely(!buf)) {
+ return NULL;
+@@ -76,11 +68,7 @@
+ static inline ALLOCSZ_ATTR(2)
+ void *mk_mem_realloc(void *ptr, const size_t size)
+ {
+-#ifdef MALLOC_JEMALLOC
+- void *aux = je_realloc(ptr, size);
+-#else
+ void *aux = realloc(ptr, size);
+-#endif
+
+ if (mk_unlikely(!aux && size)) {
+ perror("realloc");
+@@ -92,11 +80,7 @@
+
+ static inline void mk_mem_free(void *ptr)
+ {
+-#ifdef MALLOC_JEMALLOC
+- je_free(ptr);
+-#else
+ free(ptr);
+-#endif
+ }
+
+ void mk_mem_free(void *ptr);
diff --git a/www-servers/monkeyd/files/monkeyd.confd b/www-servers/monkeyd/files/monkeyd.confd
new file mode 100644
index 000000000000..fe725e80b9c1
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd.confd
@@ -0,0 +1,6 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Add any additional command line arguments here
+MONKEY_ARGS=""
diff --git a/www-servers/monkeyd/files/monkeyd.initd b/www-servers/monkeyd/files/monkeyd.initd
new file mode 100644
index 000000000000..452cc934faa3
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON="/usr/bin/monkey"
+CONFFILE="/etc/monkeyd/monkey.conf"
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting monkeyd"
+ start-stop-daemon --start --exec "${DAEMON}" -- "-D" "${MONKEY_ARGS}" >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping monkeyd"
+ local PORT=$(awk '/^ *Port/ { print $2 }' "${CONFFILE}")
+ local PIDFILE=$(awk '/^ *PidFile/ { print $2 }' "${CONFFILE}")
+ PIDFILE="${PIDFILE}"."${PORT}"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/monkeyd/metadata.xml b/www-servers/monkeyd/metadata.xml
new file mode 100644
index 000000000000..f81ac37e2e76
--- /dev/null
+++ b/www-servers/monkeyd/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable lots of debugging info</flag>
+ <flag name="jemalloc">Use dev-libs/jemalloc for allocations</flag>
+ <flag name="minimal">Do not install shared lib and include files</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/monkeyd/monkeyd-1.5.3.ebuild b/www-servers/monkeyd/monkeyd-1.5.3.ebuild
new file mode 100644
index 000000000000..dc0aeca62acd
--- /dev/null
+++ b/www-servers/monkeyd/monkeyd-1.5.3.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs depend.php multilib
+
+MY_P="${PN/d}-${PV}"
+DESCRIPTION="A small, fast, and scalable web server"
+HOMEPAGE="http://www.monkey-project.com/"
+SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+
+# ssl is broken, so we turn it off until fixed
+IUSE="-debug jemalloc php minimal elibc_musl elibc_uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
+
+# uclibc is often compiled without backtrace info so we should
+# force this off. If someone complains, consider relaxing it.
+# ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
+REQUIRED_USE="elibc_uclibc? ( !debug )"
+
+DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
+RDEPEND="php? ( dev-lang/php )"
+
+S="${WORKDIR}/${MY_P}"
+
+WEBROOT="/var/www/localhost"
+
+pkg_setup() {
+ use php && require_php_cgi
+
+ if use debug; then
+ ewarn
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn "Do not use debug in production!"
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Unconditionally get rid of the bundled jemalloc
+ rm -rf "${S}"/deps
+ epatch "${FILESDIR}"/${PN}-1.5.2-use-system-jemalloc.patch
+ epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
+
+ # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
+ sed -i '/Creating bin\/banana/d' configure || die "No configure file"
+ sed -i '/create_banana_script bindir/d' configure || die "No configure file"
+
+ # Don't explicitly strip files
+ sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
+
+ # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
+ use minimal && {
+ sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/ln -sf/d' configure || die "No configure file"
+ sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ }
+
+ # Unquiet build
+ sed -i '/^CC\s/d' configure || die "No configure file"
+ sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
+ sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
+ makes=$(find . -iname Makefile.in)
+ for f in ${makes}; do
+ sed -i '/^CC\s/d' $f || die "No file "$f
+ sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
+ done
+}
+
+src_configure() {
+ local myconf=""
+
+ use elibc_uclibc && myconf+=" --uclib-mode"
+ use elibc_musl && myconf+=" --musl-mode"
+
+ use minimal || myconf+=" --enable-shared"
+ use jemalloc || myconf+=" --malloc-libc"
+
+ if use debug; then
+ myconf+=" --debug --trace"
+ else
+ myconf+=" --no-backtrace"
+ fi
+
+ local enable_plugins=""
+ local disable_plugins=""
+ for p in ${PLUGINS}; do
+ cp=${p/monkeyd_plugins_/}
+ use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
+ done
+ myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
+
+ # Non-autotools configure
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=${WEBROOT}/htdocs \
+ --logdir=/var/log/${PN} \
+ --mandir=/usr/share/man \
+ --libdir=/usr/$(get_libdir) \
+ --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
+ --sysconfdir=/etc/${PN} \
+ --platform="generic" \
+ ${myconf} \
+ || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+
+ # Don't install the banana script man page
+ rm "${S}"/man/banana.1
+}
+
+src_install() {
+ default
+
+ if use php ; then
+ sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
+ sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
+ fi
+
+ sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
+ newinitd "${FILESDIR}"/monkeyd.initd monkeyd
+ newconfd "${FILESDIR}"/monkeyd.confd monkeyd
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${D}"${WEBROOT}/htdocs \
+ "${D}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${D}"${WEBROOT}/htdocs
+
+ keepdir \
+ /var/log/monkeyd \
+ ${WEBROOT}/htdocs
+}
diff --git a/www-servers/monkeyd/monkeyd-1.5.5.ebuild b/www-servers/monkeyd/monkeyd-1.5.5.ebuild
new file mode 100644
index 000000000000..5c05f5f217bd
--- /dev/null
+++ b/www-servers/monkeyd/monkeyd-1.5.5.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs depend.php multilib
+
+MY_P="${PN/d}-${PV}"
+DESCRIPTION="A small, fast, and scalable web server"
+HOMEPAGE="http://www.monkey-project.com/"
+SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+
+# ssl is broken, so we turn it off until fixed
+IUSE="-debug jemalloc php minimal elibc_musl elibc_uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
+
+# uclibc is often compiled without backtrace info so we should
+# force this off. If someone complains, consider relaxing it.
+# ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
+REQUIRED_USE="elibc_uclibc? ( !debug )"
+
+DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
+RDEPEND="php? ( dev-lang/php )"
+
+S="${WORKDIR}/${MY_P}"
+
+WEBROOT="/var/www/localhost"
+
+pkg_setup() {
+ use php && require_php_cgi
+
+ if use debug; then
+ ewarn
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn "Do not use debug in production!"
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Unconditionally get rid of the bundled jemalloc
+ rm -rf "${S}"/deps
+ epatch "${FILESDIR}"/${PN}-1.5.2-use-system-jemalloc.patch
+ epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
+
+ # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
+ sed -i '/Creating bin\/banana/d' configure || die "No configure file"
+ sed -i '/create_banana_script bindir/d' configure || die "No configure file"
+
+ # Don't explicitly strip files
+ sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
+
+ # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
+ use minimal && {
+ sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/ln -sf/d' configure || die "No configure file"
+ sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ }
+
+ # Unquiet build
+ sed -i '/^CC\s/d' configure || die "No configure file"
+ sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
+ sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
+ makes=$(find . -iname Makefile.in)
+ for f in ${makes}; do
+ sed -i '/^CC\s/d' $f || die "No file "$f
+ sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
+ done
+}
+
+src_configure() {
+ local myconf=""
+
+ use elibc_uclibc && myconf+=" --uclib-mode"
+ use elibc_musl && myconf+=" --musl-mode"
+
+ use minimal || myconf+=" --enable-shared"
+ use jemalloc || myconf+=" --malloc-libc"
+
+ if use debug; then
+ myconf+=" --debug --trace"
+ else
+ myconf+=" --no-backtrace"
+ fi
+
+ local enable_plugins=""
+ local disable_plugins=""
+ for p in ${PLUGINS}; do
+ cp=${p/monkeyd_plugins_/}
+ use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
+ done
+ myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
+
+ # Non-autotools configure
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=${WEBROOT}/htdocs \
+ --logdir=/var/log/${PN} \
+ --mandir=/usr/share/man \
+ --libdir=/usr/$(get_libdir) \
+ --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
+ --sysconfdir=/etc/${PN} \
+ --platform="generic" \
+ ${myconf} \
+ || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+
+ # Don't install the banana script man page
+ rm "${S}"/man/banana.1
+}
+
+src_install() {
+ default
+
+ if use php ; then
+ sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
+ sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
+ fi
+
+ sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
+ newinitd "${FILESDIR}"/monkeyd.initd monkeyd
+ newconfd "${FILESDIR}"/monkeyd.confd monkeyd
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${D}"${WEBROOT}/htdocs \
+ "${D}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${D}"${WEBROOT}/htdocs
+
+ keepdir \
+ /var/log/monkeyd \
+ ${WEBROOT}/htdocs
+}
diff --git a/www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild b/www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild
new file mode 100644
index 000000000000..8bf5b8363c18
--- /dev/null
+++ b/www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs depend.php multilib
+
+MY_P="${PN/d}-${PV}"
+DESCRIPTION="A small, fast, and scalable web server"
+HOMEPAGE="http://www.monkey-project.com/"
+SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+
+# ssl is broken, so we turn it off until fixed
+IUSE="-debug jemalloc php minimal elibc_musl elibc_uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
+
+# uclibc is often compiled without backtrace info so we should
+# force this off. If someone complains, consider relaxing it.
+# ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
+REQUIRED_USE="
+ elibc_uclibc? ( !debug )
+ cgi? ( php )"
+
+DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
+RDEPEND="
+ php? ( dev-lang/php )
+ cgi? ( dev-lang/php[cgi] )"
+
+S="${WORKDIR}/${MY_P}"
+
+WEBROOT="/var/www/localhost"
+
+pkg_setup() {
+ if use debug; then
+ ewarn
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn "Do not use debug in production!"
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Unconditionally get rid of the bundled jemalloc
+ rm -rf "${S}"/deps
+ epatch "${FILESDIR}"/${PN}-1.5.2-use-system-jemalloc.patch
+ epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
+
+ # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
+ sed -i '/Creating bin\/banana/d' configure || die "No configure file"
+ sed -i '/create_banana_script bindir/d' configure || die "No configure file"
+
+ # Don't explicitly strip files
+ sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
+
+ # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
+ use minimal && {
+ sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/ln -sf/d' configure || die "No configure file"
+ sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ }
+
+ # Unquiet build
+ sed -i '/^CC\s/d' configure || die "No configure file"
+ sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
+ sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
+ makes=$(find . -iname Makefile.in)
+ for f in ${makes}; do
+ sed -i '/^CC\s/d' $f || die "No file "$f
+ sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
+ done
+}
+
+src_configure() {
+ local myconf=""
+
+ use elibc_uclibc && myconf+=" --uclib-mode"
+ use elibc_musl && myconf+=" --musl-mode"
+
+ use minimal || myconf+=" --enable-shared"
+ use jemalloc || myconf+=" --malloc-libc"
+
+ if use debug; then
+ myconf+=" --debug --trace"
+ else
+ myconf+=" --no-backtrace"
+ fi
+
+ local enable_plugins=""
+ local disable_plugins=""
+ for p in ${PLUGINS}; do
+ cp=${p/monkeyd_plugins_/}
+ use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
+ done
+ myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
+
+ # Non-autotools configure
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=${WEBROOT}/htdocs \
+ --logdir=/var/log/${PN} \
+ --mandir=/usr/share/man \
+ --libdir=/usr/$(get_libdir) \
+ --pidfile=/run/monkey.pid \
+ --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
+ --sysconfdir=/etc/${PN} \
+ --platform="generic" \
+ ${myconf} \
+ || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+
+ # Don't install the banana script man page
+ rm "${S}"/man/banana.1
+}
+
+src_install() {
+ default
+
+ if use php ; then
+ sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
+ sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
+ fi
+
+ sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
+ newinitd "${FILESDIR}"/monkeyd.initd monkeyd
+ newconfd "${FILESDIR}"/monkeyd.confd monkeyd
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${D}"${WEBROOT}/htdocs \
+ "${D}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${D}"${WEBROOT}/htdocs
+
+ keepdir \
+ /var/log/monkeyd \
+ ${WEBROOT}/htdocs
+}