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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sun Aug 2 18:40:41 2015 UTC (4 years, 2 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -2 lines
Stable for x86, wrt bug #552420

(Portage version: 2.2.20/cvs/Linux x86_64, RepoMan options: --include-arches="x86", signed Manifest commit with key 7194459F)

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

  ViewVC Help
Powered by ViewVC 1.1.20