From aba9d3a5eb837ffb9829a49bf60f4767dc847c4a Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Tue, 10 Jul 2012 22:45:29 +0200 Subject: [PATCH] upstream nginx-1.3.x --- www-servers/nginx/Manifest | 12 +- www-servers/nginx/nginx-0.9.2.ebuild | 135 ---------- www-servers/nginx/nginx-1.3.1.ebuild | 365 +++++++++++++++++++++++++++ 3 files changed, 374 insertions(+), 138 deletions(-) delete mode 100644 www-servers/nginx/nginx-0.9.2.ebuild create mode 100644 www-servers/nginx/nginx-1.3.1.ebuild diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest index 893c67d..972bb39 100644 --- a/www-servers/nginx/Manifest +++ b/www-servers/nginx/Manifest @@ -3,7 +3,13 @@ AUX nginx-r1 1654 RMD160 80ed3157a6ecbae0b8ccbfa2ebbc4372bb086268 SHA1 472699446 AUX nginx-secure-link-timeout.patch 3103 RMD160 51337d222001fb051d29feaac3f68ab8367357da SHA1 d9f831bc7c378e2c1893a5f9964400a49ecc4f4b SHA256 ff89688109e695c7e3c8dfd39fa7e1310984d790e59bbbf40f29987d3edfd0a5 AUX nginx.conf-r4 878 RMD160 9515d77df5ce3f56e7bb06c7274b0b22b1f5a7c2 SHA1 83e00d5a575057f48a13be7c44926ea578a6c4b7 SHA256 c827c2d28959f14ee7ebb1ba9e88071ff8203228df6b24da9ee94ee4ec669fcc AUX nginx.logrotate 195 RMD160 56a165a6a42355f36f2d125318105708dfb948e1 SHA1 19cfc313d815c57c64df55282ae627c11280a6a6 SHA256 16fcd09e7c62b5693a4eed0924494c9794cd2e86d0e0f4d2d77519b75bf69bb6 -DIST nginx-0.9.2.tar.gz 653841 RMD160 950927a2b416f8bd17e21b99c75aca8d7e447b56 SHA1 8d29f64b3a1b10e9841cde63d3ef78efde4b21ea SHA256 2bddd378996cbcd68ebcbd754b15780b6a15e9e26303c1bd0dcd5a32bf6e32a6 -DIST ngx_http_auth_pam_module-1.1.tar.gz 5193 RMD160 38437a1f5d34f93b22abb9f0a7181be756356d33 SHA1 d04065a512169925dda8bce710e1dc5012cac47b SHA256 ea9da5f106b952729398248cddabbe25f7a5752993e91c9b8252dbc2b03b8ecd -EBUILD nginx-0.9.2.ebuild 4307 RMD160 4f494e92f9c0256b1046bc6285d5f4b29f631a28 SHA1 e8d46f605996f0a05311f440e8850ac5bd07bd3b SHA256 912587cc07e023ce95523604d56c4af120db11168b352072d0c19f479415187a +DIST nginx-1.3.1.tar.gz 721002 RMD160 3a3d90ac77b8d2cad58f81dcfd73f3c13ed1052d SHA1 36a4147799e303a6f19cd8ff9fb52c2fc07a840d SHA256 9b30a6f67f0a9eda7db026e12d4f09656f9254cddbb66ff9c0c01d8963dc1d73 +DIST nginx_http_push_module-0.692.tar.gz 29119 RMD160 9d2be16074cf28115af0f1d8f3646937cda649ad SHA1 72103084cad8f4d3d9a49a6b04cf780e4541605d SHA256 64868708071aa21dbc4c7a07d149dd6ec9108fb7eaf2aad5ad069406151f17fe +DIST nginx_upload_module-2.2.0.tar.gz 25796 RMD160 5734af837be3fe8ec444a7e5e7f6707118594098 SHA1 93d6e83e613a0ce2ed057a434b344fa1b6609b47 SHA256 b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805 +DIST ngx-fancyindex-0.3.1.tar.gz 13148 RMD160 d85ff1de16211c98492f612c06391e9b4150e89d SHA1 5e2c88dbddaa55137804caf632cad3cf708911cb SHA256 49328a175548a456e2e2b78d0be87df7aade60345e07be57f2337c83058da115 +DIST ngx_cache_purge-1.5.tar.gz 7149 RMD160 7b7d351ea91ff3d4161296625a5a4992eee8b7d4 SHA1 f5717a2aee2cc174180627f9bf74a7c2f906047d SHA256 4b9cf48c0cf8f13150dfc329a889c221f6206a44aa9dcf8fa2f347abce55995c +DIST ngx_http_headers_more-0.17rc1.tar.gz 24707 RMD160 1840b4163e72af91155c3bfc6dd1b1efa65fcf22 SHA1 83f7ebe6359e975292f4d9d3037040a5f6ed55c0 SHA256 826b62c13605281f843ad4a612a00b38d71599a673c3112480bff9bdbbcd36cd +DIST ngx_slowfs_cache-1.8.tar.gz 11408 RMD160 3f1457df569d33df81d24205f12451cbfb76e97e SHA1 6e37e81ada462189c40c5abf31a7471a9a74bca2 SHA256 3ab8aa47912a3f7a07cda0a4fbf6d2e870b9c9cbf5477014ac109001cdcb3644 +DIST ngx_upload_progress-0.9.0.tar.gz 17020 RMD160 10ff91748a06afd81abb9fdb203f164ea369463a SHA1 93aadaf6065e1e8afd9f14b9291a66819d3aa4c0 SHA256 3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2 +EBUILD nginx-1.3.1.ebuild 12477 RMD160 bc9f219c3eb6efedb57384564d43dfefb98cb4e1 SHA1 bcbd8826b5ef63ada9db11c3740176b65c616481 SHA256 0327960497918025c8b35b0dc03864f6e6c6fe888dcaba3ef53e9a3b6e7ab487 MISC metadata.xml 711 RMD160 c2426ecf2ca328c1822edcd4fe4e1eb5ba9176c0 SHA1 0b9ea8e217537e7255a9bdd2f5668198c738cf09 SHA256 d3b05c228dd62148c8bc7e46abad586eb9a9f3061ef510e1ed0a4baa77595a99 diff --git a/www-servers/nginx/nginx-0.9.2.ebuild b/www-servers/nginx/nginx-0.9.2.ebuild deleted file mode 100644 index 3bce52d..0000000 --- a/www-servers/nginx/nginx-0.9.2.ebuild +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit eutils ssl-cert toolchain-funcs perl-module - -DESCRIPTION="Robust, small and high performance http and reverse proxy server" - -HOMEPAGE="http://nginx.net/" -SRC_URI="http://sysoev.ru/nginx/${P}.tar.gz - pamauth? - ( http://web.iti.upv.es/~sto/nginx/ngx_http_auth_pam_module-1.1.tar.gz )" -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd" -IUSE="addition aio debug fastcgi flv imap ipv6 pamauth passenger pcre perl pop random-index securelink ssl -status sub vim-syntax webdav zlib" - -DEPEND="dev-lang/perl - dev-libs/openssl - pcre? ( >=dev-libs/libpcre-4.2 ) - zlib? ( sys-libs/zlib ) - perl? ( >=dev-lang/perl-5.8 ) - pamauth? ( sys-libs/pam ) - vim-syntax? ( app-vim/nginx-syntax )" - -pkg_setup() { - ebegin "Creating nginx user and group" - enewgroup ${PN} - enewuser ${PN} -1 -1 -1 ${PN} - eend ${?} -} - -src_unpack() { - unpack ${A} - sed -i 's/ make/ \\$(MAKE)/' "${S}"/auto/lib/perl/make || die -} - -src_compile() { - local myconf - - # threads support is broken atm. - # - # if use threads; then - # einfo - # ewarn "threads support is experimental at the moment" - # ewarn "do not use it on production systems - you've been warned" - # einfo - # myconf="${myconf} --with-threads" - # fi - - use addition && myconf="${myconf} --with-http_addition_module" - # --- works only with kernel > 2.6.22 - use aio && myconf="${myconf} --with-file-aio" - use ipv6 && myconf="${myconf} --with-ipv6" - use fastcgi || myconf="${myconf} --without-http_fastcgi_module" - use fastcgi && myconf="${myconf} --with-http_realip_module" - use flv && myconf="${myconf} --with-http_flv_module" - use zlib || myconf="${myconf} --without-http_gzip_module" - use pcre || { - myconf="${myconf} --without-pcre --without-http_rewrite_module" - } - use debug && myconf="${myconf} --with-debug" - use ssl && myconf="${myconf} --with-http_ssl_module" - use perl && myconf="${myconf} --with-http_perl_module" - use pamauth && myconf="${myconf} --add-module=../ngx_http_auth_pam_module-1.1" - use status && myconf="${myconf} --with-http_stub_status_module" - use webdav && myconf="${myconf} --with-http_dav_module" - use sub && myconf="${myconf} --with-http_sub_module" - use realip && myconf="${myconf} --with-http_realip_module" - use static-gzip && myconf="${myconf} --with-http_gzip_static_module" - use random-index && myconf="${myconf} --with-http_random_index_module" - use securelink && myconf="${myconf} --with-http_secure_link_module" - use passenger && myconf="${myconf} --add-module=`passenger-config --root`/ext/nginx" - - if use smtp || use pop || use imap; then - myconf="${myconf} --with-mail" - use ssl && myconf="${myconf} --with-mail_ssl_module" - fi - use imap || myconf="${myconf} --without-mail_imap_module" - use pop || myconf="${myconf} --without-mail_pop3_module" - use smtp || myconf="${myconf} --without-mail_smtp_module" - - tc-export CC - ./configure \ - --prefix=/usr \ - --with-cc-opt="-I${ROOT}/usr/include" \ - --with-ld-opt="-L${ROOT}/usr/lib" \ - --conf-path=/etc/${PN}/${PN}.conf \ - --http-log-path=/var/log/${PN}/access_log \ - --error-log-path=/var/log/${PN}/error_log \ - --pid-path=/var/run/${PN}.pid \ - --http-client-body-temp-path=/var/tmp/${PN}/client \ - --http-proxy-temp-path=/var/tmp/${PN}/proxy \ - --http-fastcgi-temp-path=/var/tmp/${PN}/fastcgi \ - --with-md5-asm --with-md5=/usr/include \ - --with-sha1-asm --with-sha1=/usr/include \ - ${myconf} || die "configure failed" - - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" || die "failed to compile" -} - -src_install() { - keepdir /var/{log,cache}/${PN} /var/tmp/${PN}/{client,proxy,fastcgi} - - dosbin objs/nginx - newinitd "${FILESDIR}"/nginx-r1 nginx || die - - cp "${FILESDIR}"/nginx.conf-r4 conf/nginx.conf - - dodir /etc/${PN} - insinto /etc/${PN} - doins conf/* - - dodoc CHANGES{,.ru} README - - # logrotate - insinto /etc/logrotate.d - newins "${FILESDIR}"/nginx.logrotate nginx || die - - use perl && { - cd "${S}"/objs/src/http/modules/perl/ - einstall DESTDIR="${D}" INSTALLDIRS=vendor || die "failed to install perl stuff" - fixlocalpod - } -} - -pkg_postinst() { - use ssl && { - if [ ! -f "${ROOT}"/etc/ssl/${PN}/${PN}.key ]; then - install_cert /etc/ssl/${PN}/${PN} - chown ${PN}:${PN} "${ROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem} - fi - } -} diff --git a/www-servers/nginx/nginx-1.3.1.ebuild b/www-servers/nginx/nginx-1.3.1.ebuild new file mode 100644 index 0000000..6adfb17 --- /dev/null +++ b/www-servers/nginx/nginx-1.3.1.ebuild @@ -0,0 +1,365 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.3.1.ebuild,v 1.1 2012/06/06 08:47:00 patrick Exp $ + +EAPI="4" + +# Maintainer notes: +# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite +# - any http-module activates the main http-functionality and overrides USE=-http +# - keep the following requirements in mind before adding external modules: +# * alive upstream +# * sane packaging +# * builds cleanly +# * does not need a patch for nginx core +# - TODO: test the google-perftools module (included in vanilla tarball) + +# prevent perl-module from adding automagic perl DEPENDs +GENTOO_DEPEND_ON_PERL="no" + +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.0" +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" +HTTP_UPLOAD_PROGRESS_MODULE_SHA1="a788dea" +HTTP_UPLOAD_PROGRESS_MODULE_URI="http://github.com/masterzen/nginx-upload-progress-module/tarball/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}" + +# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license) +HTTP_HEADERS_MORE_MODULE_PV="0.17rc1" +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" +HTTP_HEADERS_MORE_MODULE_SHA1="3580526" +HTTP_HEADERS_MORE_MODULE_URI="http://github.com/agentzh/headers-more-nginx-module/tarball/v${HTTP_HEADERS_MORE_MODULE_PV}" + +# http_push (http://pushmodule.slact.net/, MIT license) +HTTP_PUSH_MODULE_PV="0.692" +HTTP_PUSH_MODULE_P="nginx_http_push_module-${HTTP_PUSH_MODULE_PV}" +HTTP_PUSH_MODULE_URI="http://pushmodule.slact.net/downloads/${HTTP_PUSH_MODULE_P}.tar.gz" + +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license) +HTTP_CACHE_PURGE_MODULE_PV="1.5" +HTTP_CACHE_PURGE_MODULE_P="ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" +HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/${HTTP_CACHE_PURGE_MODULE_P}.tar.gz" + +# HTTP Upload module from Valery Kholodkov +# (http://www.grid.net.ru/nginx/upload.en.html, BSD license) +HTTP_UPLOAD_MODULE_PV="2.2.0" +HTTP_UPLOAD_MODULE_P="nginx_upload_module-${HTTP_UPLOAD_MODULE_PV}" +HTTP_UPLOAD_MODULE_URI="http://www.grid.net.ru/nginx/download/${HTTP_UPLOAD_MODULE_P}.tar.gz" + +# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) +HTTP_SLOWFS_CACHE_MODULE_PV="1.8" +HTTP_SLOWFS_CACHE_MODULE_P="ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" +HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz" + +# http_fancyindex_module (http://wiki.nginx.org/NgxFancyIndex, BSD license) +HTTP_FANCYINDEX_MODULE_PV="0.3.1" +HTTP_FANCYINDEX_MODULE_PN="ngx-fancyindex" +# gitorious names the tarbell oddly, hence PNPN +HTTP_FANCYINDEX_MODULE_PNPN="ngx-fancyindex-ngx-fancyindex" +HTTP_FANCYINDEX_MODULE_P="${HTTP_FANCYINDEX_MODULE_PN}-${HTTP_FANCYINDEX_MODULE_PV}" +HTTP_FANCYINDEX_MODULE_URI="http://gitorious.org/${HTTP_FANCYINDEX_MODULE_PN}/${HTTP_FANCYINDEX_MODULE_PN}/archive-tarball/v${HTTP_FANCYINDEX_MODULE_PV}" + +inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user + +DESCRIPTION="Robust, small and high performance http and reverse proxy server" +HOMEPAGE="http://nginx.org" +SRC_URI="http://nginx.org/download/${P}.tar.gz + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) + nginx_modules_http_push? ( ${HTTP_PUSH_MODULE_URI} ) + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} ) + nginx_modules_http_upload? ( ${HTTP_UPLOAD_MODULE_URI} ) + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} ) + nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )" + +LICENSE="as-is BSD BSD-2 GPL-2 MIT" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" + +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi +geo gzip limit_req limit_zone map memcached proxy referer rewrite scgi ssi +split_clients upstream_ip_hash userid uwsgi" +NGINX_MODULES_OPT="addition dav degradation flv geoip gzip_static image_filter +mp4 perl random_index realip secure_link stub_status sub xslt" +NGINX_MODULES_MAIL="imap pop3 smtp" +NGINX_MODULES_3RD=" + http_upload_progress + http_headers_more + http_passenger + http_push + http_cache_purge + http_upload + http_slowfs_cache + http_fancyindex" + +IUSE="aio debug +http +http-cache ipv6 libatomic +pcre pcre-jit selinux ssl vim-syntax" + +for mod in $NGINX_MODULES_STD; do + IUSE="${IUSE} +nginx_modules_http_${mod}" +done + +for mod in $NGINX_MODULES_OPT; do + IUSE="${IUSE} nginx_modules_http_${mod}" +done + +for mod in $NGINX_MODULES_MAIL; do + IUSE="${IUSE} nginx_modules_mail_${mod}" +done + +for mod in $NGINX_MODULES_3RD; do + IUSE="${IUSE} nginx_modules_${mod}" +done + +CDEPEND=" + pcre? ( >=dev-libs/libpcre-4.2 ) + selinux? ( sec-policy/selinux-nginx ) + ssl? ( dev-libs/openssl ) + http-cache? ( userland_GNU? ( dev-libs/openssl ) ) + nginx_modules_http_geo? ( dev-libs/geoip ) + nginx_modules_http_gzip? ( sys-libs/zlib ) + nginx_modules_http_gzip_static? ( sys-libs/zlib ) + nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] ) + nginx_modules_http_perl? ( >=dev-lang/perl-5.8 ) + nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 ) + nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl ) ) + nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )" +RDEPEND="${CDEPEND}" +DEPEND="${CDEPEND} + arm? ( dev-libs/libatomic_ops ) + libatomic? ( dev-libs/libatomic_ops )" +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" +REQUIRED_USE="pcre-jit? ( pcre )" + +pkg_setup() { + if use nginx_modules_http_passenger; then + einfo + einfo "Passenger support has been removed from the nginx ebuild to" + einfo "get rid of file collisions, its broken build system and" + einfo "incompatibilities between passenger 2 and 3." + einfo + einfo "Please switch to passenger-3 standalone or use the" + einfo "unicorn gem which provides a sane nginx-like architecture" + einfo "out of the box." + einfo + einfo "For more information on sane ruby deployments with" + einfo "passenger-3/unicorn go to:" + einfo + einfo "https://rvm.beginrescueend.com" + einfo + die "nginx_modules_http_passenger still in IUSE" + fi + + ebegin "Creating nginx user and group" + enewgroup ${PN} + enewuser ${PN} -1 -1 -1 ${PN} + eend $? + + if use libatomic; then + ewarn "GCC 4.1+ features built-in atomic operations." + ewarn "Using libatomic_ops is only needed if using" + ewarn "a different compiler or a GCC prior to 4.1" + fi + + if [[ -n $NGINX_ADD_MODULES ]]; then + ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" + ewarn "This nginx installation is not supported!" + ewarn "Make sure you can reproduce the bug without those modules" + ewarn "_before_ reporting bugs." + fi + + if use !http; then + ewarn "To actually disable all http-functionality you also have to disable" + ewarn "all nginx http modules." + fi +} + +src_prepare() { + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die + # We have config protection, don't rename etc files + sed -i 's:.default::' auto/install || die + # remove useless files + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die +} + +src_configure() { + local myconf= http_enabled= mail_enabled= + + use aio && myconf+=" --with-file-aio --with-aio_module" + use debug && myconf+=" --with-debug" + use ipv6 && myconf+=" --with-ipv6" + use libatomic && myconf+=" --with-libatomic" + use pcre && myconf+=" --with-pcre" + use pcre-jit && myconf+=" --with-pcre-jit" + + # HTTP modules + for mod in $NGINX_MODULES_STD; do + if use nginx_modules_http_${mod}; then + http_enabled=1 + else + myconf+=" --without-http_${mod}_module" + fi + done + + for mod in $NGINX_MODULES_OPT; do + if use nginx_modules_http_${mod}; then + http_enabled=1 + myconf+=" --with-http_${mod}_module" + fi + done + + if use nginx_modules_http_fastcgi; then + myconf+=" --with-http_realip_module" + fi + + # third-party modules + if use nginx_modules_http_upload_progress; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/masterzen-nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_SHA1}" + fi + + if use nginx_modules_http_headers_more; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/agentzh-headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_SHA1}" + fi + + if use nginx_modules_http_push; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/${HTTP_PUSH_MODULE_P}" + fi + + if use nginx_modules_http_cache_purge; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/${HTTP_CACHE_PURGE_MODULE_P}" + fi + + if use nginx_modules_http_upload; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/${HTTP_UPLOAD_MODULE_P}" + fi + + if use nginx_modules_http_slowfs_cache; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/${HTTP_SLOWFS_CACHE_MODULE_P}" + fi + + if use nginx_modules_http_fancyindex; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/${HTTP_FANCYINDEX_MODULE_PNPN}" + fi + + if use http || use http-cache; then + http_enabled=1 + fi + + if [ $http_enabled ]; then + use http-cache || myconf+=" --without-http-cache" + use ssl && myconf+=" --with-http_ssl_module" + else + myconf+=" --without-http --without-http-cache" + fi + + # MAIL modules + for mod in $NGINX_MODULES_MAIL; do + if use nginx_modules_mail_${mod}; then + mail_enabled=1 + else + myconf+=" --without-mail_${mod}_module" + fi + done + + if [ $mail_enabled ]; then + myconf+=" --with-mail" + use ssl && myconf+=" --with-mail_ssl_module" + fi + + # custom modules + for mod in $NGINX_ADD_MODULES; do + myconf+=" --add-module=${mod}" + done + + # https://bugs.gentoo.org/286772 + export LANG=C LC_ALL=C + tc-export CC + + if ! use prefix; then + myconf+=" --user=${PN} --group=${PN}" + fi + + ./configure \ + --prefix="${EPREFIX}"/usr \ + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ + --pid-path="${EPREFIX}"/var/run/${PN}.pid \ + --lock-path="${EPREFIX}"/var/lock/nginx.lock \ + --with-cc-opt="-I${EROOT}usr/include" \ + --with-ld-opt="-L${EROOT}usr/lib" \ + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ + --http-client-body-temp-path="${EPREFIX}"/var/tmp/${PN}/client \ + --http-proxy-temp-path="${EPREFIX}"/var/tmp/${PN}/proxy \ + --http-fastcgi-temp-path="${EPREFIX}"/var/tmp/${PN}/fastcgi \ + --http-scgi-temp-path="${EPREFIX}"/var/tmp/${PN}/scgi \ + --http-uwsgi-temp-path="${EPREFIX}"/var/tmp/${PN}/uwsgi \ + ${myconf} || die "configure failed" +} + +src_compile() { + # https://bugs.gentoo.org/286772 + export LANG=C LC_ALL=C + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" +} + +src_install() { + emake DESTDIR="${D}" install + cp "${FILESDIR}"/nginx.conf "${ED}"/etc/nginx/nginx.conf || die + newinitd "${FILESDIR}"/nginx.initd nginx + doman man/nginx.8 + dodoc CHANGES* README + + # Keepdir because these are hardcoded above + keepdir /var/log/${PN} /var/tmp/${PN}/{client,proxy,fastcgi,scgi,uwsgi} + keepdir /var/www/localhost/htdocs + mv "${ED}"/usr/html "${ED}"/var/www/localhost/htdocs || die + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/nginx.logrotate nginx + + if use nginx_modules_http_perl; then + cd "${S}"/objs/src/http/modules/perl/ + einstall DESTDIR="${D}" INSTALLDIRS=vendor + fixlocalpod + fi + + if use nginx_modules_http_push; then + docinto ${HTTP_PUSH_MODULE_P} + dodoc "${WORKDIR}"/${HTTP_PUSH_MODULE_P}/{changelog.txt,protocol.txt,README} + fi + + if use nginx_modules_http_cache_purge; then + docinto ${HTTP_CACHE_PURGE_MODULE_P} + dodoc "${WORKDIR}"/${HTTP_CACHE_PURGE_MODULE_P}/{CHANGES,README.md,TODO.md} + fi + + if use nginx_modules_http_upload; then + docinto ${HTTP_UPLOAD_MODULE_P} + dodoc "${WORKDIR}"/${HTTP_UPLOAD_MODULE_P}/{Changelog,README} + fi + + if use nginx_modules_http_slowfs_cache; then + docinto ${HTTP_SLOWFS_CACHE_MODULE_P} + dodoc "${WORKDIR}"/${HTTP_SLOWFS_CACHE_MODULE_P}/{CHANGES,README.md} + fi + + if use nginx_modules_http_fancyindex; then + docinto ${HTTP_FANCYINDEX_MODULE_P} + dodoc "${WORKDIR}"/${HTTP_FANCYINDEX_MODULE_PNPN}/README.rst + fi +} + +pkg_postinst() { + if use ssl; then + if [ ! -f "${EROOT}"/etc/ssl/${PN}/${PN}.key ]; then + install_cert /etc/ssl/${PN}/${PN} + use prefix || chown ${PN}:${PN} "${EROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem} + fi + fi +}