1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=(python2_7 python3_{3,4,5,6,7})
8 inherit python-single-r1
11 DESCRIPTION="A dynamic web and application server"
12 HOMEPAGE="https://unit.nginx.org"
13 SRC_URI="https://unit.nginx.org/download/${MY_P}.tar.gz -> ${P}.tar.gz"
18 MY_USE="perl python ruby"
19 MY_USE_PHP="php5-6 php7-0 php7-1 php7-2"
20 IUSE="${MY_USE} ${MY_USE_PHP}"
21 REQUIRED_USE="|| ( ${IUSE} ) python? ( ${PYTHON_REQUIRED_USE} )"
23 DEPEND="perl? ( dev-lang/perl:= )
24 php5-6? ( dev-lang/php:5.6[embed] )
25 php7-0? ( dev-lang/php:7.0[embed] )
26 php7-1? ( dev-lang/php:7.1[embed] )
27 php7-2? ( dev-lang/php:7.2[embed] )
28 python? ( ${PYTHON_DEPS} )
29 ruby? ( dev-lang/ruby:= )"
31 S="${WORKDIR}/${MY_P}"
34 use python && python-single-r1_pkg_setup
39 --control=unix:/run/${PN}.sock \
40 --ld-opt="${LDFLAGS}" \
41 --log=/var/log/${PN} \
42 --modules=$(get_libdir)/${PN} \
43 --pid=/run/${PN}.pid \
45 --state=/var/lib/${PN} || die "Core configuration failed"
46 for flag in ${MY_USE} ; do
48 ./configure ${flag} || die "Module configuration failed: ${flag}"
51 for flag in ${MY_USE_PHP} ; do
53 local php_slot="/usr/$(get_libdir)/${flag/-/.}"
56 --config=${php_slot}/bin/php-config \
57 --lib-path=${php_slot}/$(get_libdir) || die "Module configuration failed: ${flag}"
65 keepdir /var/lib/${PN}
66 newinitd "${FILESDIR}/${PN}.initd" ${PN}