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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Jul 23 15:49:54 2014 UTC (5 years, 3 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove older unstable versions

(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/monkeyd/monkeyd-1.5.1.ebuild,v 1.1 2014/06/11 11:53:24 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 jemalloc php minimal musl 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 DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
27 RDEPEND="php? ( dev-lang/php )"
28
29 S="${WORKDIR}/${MY_P}"
30
31 WEBROOT="/var/www/localhost"
32
33 pkg_setup() {
34 use php && require_php_cgi
35
36 if use debug; then
37 ewarn
38 ewarn "\033[1;33m**************************************************\033[00m"
39 ewarn "Do not use debug in production!"
40 ewarn "\033[1;33m**************************************************\033[00m"
41 ewarn
42 fi
43 }
44
45 src_prepare() {
46 # Unconditionally get rid of the bundled jemalloc
47 rm -rf "${S}"/deps
48 epatch "${FILESDIR}"/${PN}-1.5.0-use-system-jemalloc.patch
49 epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
50
51 # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
52 sed -i '/Creating bin\/banana/d' configure || die "No configure file"
53 sed -i '/create_banana_script bindir/d' configure || die "No configure file"
54
55 # Don't explicitly strip files
56 sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
57
58 # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
59 use minimal && {
60 sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
61 sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
62 sed -i '/ln -sf/d' configure || die "No configure file"
63 sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
64 sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
65 }
66
67 # Unquiet build
68 sed -i '/^CC\s/d' configure || die "No configure file"
69 sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
70 sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
71 makes=$(find . -iname Makefile.in)
72 for f in ${makes}; do
73 sed -i '/^CC\s/d' $f || die "No file "$f
74 sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
75 done
76 }
77
78 src_configure() {
79 local myconf=""
80
81 use uclibc && myconf+=" --uclib-mode"
82 use musl && myconf+=" --musl-mode"
83
84 use minimal || myconf+=" --enable-shared"
85 use jemalloc || myconf+=" --malloc-libc"
86
87 if use debug; then
88 myconf+=" --debug --trace"
89 else
90 myconf+=" --no-backtrace"
91 fi
92
93 local enable_plugins=""
94 local disable_plugins=""
95 for p in ${PLUGINS}; do
96 cp=${p/monkeyd_plugins_/}
97 use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
98 done
99 myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
100
101 # Non-autotools configure
102 ./configure \
103 --prefix=/usr \
104 --bindir=/usr/bin \
105 --datadir=${WEBROOT}/htdocs \
106 --logdir=/var/log/${PN} \
107 --mandir=/usr/share/man \
108 --libdir=/usr/$(get_libdir) \
109 --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
110 --sysconfdir=/etc/${PN} \
111 --platform="generic" \
112 ${myconf} \
113 || die
114 }
115
116 src_compile() {
117 emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
118
119 # Don't install the banana script man page
120 rm "${S}"/man/banana.1
121 }
122
123 src_install() {
124 default
125
126 if use php ; then
127 sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
128 sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
129 fi
130
131 sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
132 newinitd "${FILESDIR}"/monkeyd.initd monkeyd
133 newconfd "${FILESDIR}"/monkeyd.confd monkeyd
134
135 #move htdocs to docdir, bug #429632
136 docompress -x /usr/share/doc/"${PF}"/htdocs.dist
137 mv "${D}"${WEBROOT}/htdocs \
138 "${D}"/usr/share/doc/"${PF}"/htdocs.dist
139 mkdir "${D}"${WEBROOT}/htdocs
140
141 keepdir \
142 /var/log/monkeyd \
143 ${WEBROOT}/htdocs
144 }

  ViewVC Help
Powered by ViewVC 1.1.20