From 0c15f6446f04a17e89ad16a26438bacfe1f09f6f Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Mon, 21 Nov 2011 09:58:55 +0400 Subject: [PATCH] Fix nginx depends. --- www-servers/nginx/Manifest | 5 +- www-servers/nginx/files/cgiwrap-fcgi.init | 2 +- www-servers/nginx/files/nginx.init-r2 | 2 +- www-servers/nginx/nginx-1.1.2-r14.ebuild | 360 ++++++++++++++++++++++ 4 files changed, 365 insertions(+), 4 deletions(-) create mode 100644 www-servers/nginx/nginx-1.1.2-r14.ebuild diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest index ae3c14e84..71cf33809 100644 --- a/www-servers/nginx/Manifest +++ b/www-servers/nginx/Manifest @@ -1,7 +1,7 @@ -AUX cgiwrap-fcgi.init 659 RMD160 8740bcc05a0911a58dc470e6b455d8a452d31584 SHA1 853d8bdb044c4cddd7fa86f4700fa5a8fb297477 SHA256 e2e508255b764679b7c564bf42d2da6d56428387fbb91fa123d0a7815dd7e3fb +AUX cgiwrap-fcgi.init 650 RMD160 d9c26ce056365b3b4c06925fd9364d715c67597f SHA1 dc1ab047d4208e413a4b69daa484e9cf72d8c142 SHA256 4009e6b7fce583aa8ac263053a91ada2814d657b9c955b61afa9a754b5fb3e66 AUX cgiwrap-fcgi.pl 3384 RMD160 3b656ee64cb0f63a2033482fec5ecb3425cea943 SHA1 4ef7e281b01360a8e7d6531795c0eb65fd5c0bb7 SHA256 837d4a59bc8e76848e0b2b3120833dc494bc6f297e33e75089ebd35a35977d7d AUX nginx.conf-r4 1358 RMD160 a948df249a16be86c114d587cfa5ee570d84a356 SHA1 e9db0447a1beb326a0858cf8189328229d1d3edf SHA256 6ff6c9301ea2a4d74a335b9119d7f9dba87d4e83793cf22d837d49f061763096 -AUX nginx.init-r2 1827 RMD160 2ece9278fd4a3ca948106e024c2607fca02e2599 SHA1 76af70e8fcad8b298851382d18160d11dc3e2cca SHA256 89801c2e0ea3480380dedfbc84b0cc993ab6b93768886246a22e650ba0a61798 +AUX nginx.init-r2 1840 RMD160 d965cb4a8c81cc67f14e8e31cb9cfd94e155653b SHA1 c6f32463cd82b41484934b3d63bdaf6185d56020 SHA256 4348c36301afcf885c739415ea7f65d948d641f654ca94532b67e41c4453f3fe AUX nginx.logrotate 364 RMD160 9fdfd2ea2f49b8dba20a030d893e34779bb32364 SHA1 4ab07992fa5c64f753e3643e1b51fcab4dec6ccf SHA256 9e3e090dfd10861d5f9b279e19113ce8d05caf9f33d488f6aabf9f19ac0cf925 AUX passenger-CFLAGS-headers.patch 3685 RMD160 7d5fff162baa926e85e58f54dab57ca42223d253 SHA1 c20db105461dc25ddc5faa90611d56226396027f SHA256 8268e78780322acc6af90b03a1f3d1ff60d073dcdc90086ec17b14696ad3b1f5 DIST nginx-1.1.2.tar.gz 674101 RMD160 54a1554a894cdd7e041da2a5cbf0876ee6092e88 SHA1 a8214bff7452c39c44f91853c104879b67849809 SHA256 cc64476ae800c45d2ba810274387139e5d8cbb8c1e45e8701416eea2a377151b @@ -14,5 +14,6 @@ DIST ngx_upload_progress-0.8.2.tar.gz 16559 RMD160 3aadb9bf9b15b3810d1acb466d331 DIST passenger-3.0.8.tar.gz 2362561 RMD160 1264b76a3440492b3d435050007611735a627c72 SHA1 265d1dcb66a29b944fa475f7d6831ce16ac37e2e SHA256 ccef21dc97b54de17c1d44644b2bc67b7732a860ff67206a4c557727311a8349 EBUILD nginx-1.1.2-r11.ebuild 11583 RMD160 2a665bc67d49f085baafeb6cb9f2a5a2d6e2e01d SHA1 4953dbe3dbac29022cdb61a0df1cdd51f490fcb5 SHA256 0a8aa9f49bc1b3a63f7b4d1c2b3b26bec8223d447516cc25b4d12abc6eb64c12 EBUILD nginx-1.1.2-r12.ebuild 11583 RMD160 2a665bc67d49f085baafeb6cb9f2a5a2d6e2e01d SHA1 4953dbe3dbac29022cdb61a0df1cdd51f490fcb5 SHA256 0a8aa9f49bc1b3a63f7b4d1c2b3b26bec8223d447516cc25b4d12abc6eb64c12 +EBUILD nginx-1.1.2-r14.ebuild 11583 RMD160 2a665bc67d49f085baafeb6cb9f2a5a2d6e2e01d SHA1 4953dbe3dbac29022cdb61a0df1cdd51f490fcb5 SHA256 0a8aa9f49bc1b3a63f7b4d1c2b3b26bec8223d447516cc25b4d12abc6eb64c12 MISC ChangeLog 48066 RMD160 4345372e01882914b5139dec2725ea79d6e0cc81 SHA1 4c4b381ec65c74ea1a3666617e62a353f634a2f8 SHA256 f0646085338da695c2f6e2e59403fe676c1ba297eb3dc455a09844b6c78411bb MISC metadata.xml 2402 RMD160 fee632a79ad08ef0fe36cd73d718a81348d71370 SHA1 12b7d3eac7a8e9f99dbe2b64bc288aa5e3f4608c SHA256 f133dca88780f2716797c5d2fc309466013d35b3dccf752ab27fb4ee399c6e47 diff --git a/www-servers/nginx/files/cgiwrap-fcgi.init b/www-servers/nginx/files/cgiwrap-fcgi.init index b449496a5..878117a45 100755 --- a/www-servers/nginx/files/cgiwrap-fcgi.init +++ b/www-servers/nginx/files/cgiwrap-fcgi.init @@ -4,7 +4,7 @@ # $Header: $ depend() { - need nginx + : } start() { diff --git a/www-servers/nginx/files/nginx.init-r2 b/www-servers/nginx/files/nginx.init-r2 index 466dfb3c2..21d41d4ac 100644 --- a/www-servers/nginx/files/nginx.init-r2 +++ b/www-servers/nginx/files/nginx.init-r2 @@ -7,7 +7,7 @@ opts="${opts} upgrade reload configtest" depend() { need net - use dns logger netmount + use dns logger netmount cgiwrap-fcgi } start() { diff --git a/www-servers/nginx/nginx-1.1.2-r14.ebuild b/www-servers/nginx/nginx-1.1.2-r14.ebuild new file mode 100644 index 000000000..cbd570887 --- /dev/null +++ b/www-servers/nginx/nginx-1.1.2-r14.ebuild @@ -0,0 +1,360 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.1.2.ebuild,v 1.2 2011/09/09 16:44:14 hollow Exp $ + +EAPI="4" +USE_RUBY="ruby18" + +# 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.8.2" +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" +HTTP_UPLOAD_PROGRESS_MODULE_SHA1="8b55a34" +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.15" +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" +HTTP_HEADERS_MORE_MODULE_SHA1="137855d" +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.3" +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.6" +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_PASSENGER_MODULE_PV="3.0.8" +HTTP_PASSENGER_MODULE_P="passenger-${HTTP_PASSENGER_MODULE_PV}" +HTTP_PASSENGER_MODULE_URI="mirror://rubyforge/passenger/${HTTP_PASSENGER_MODULE_P}.tar.gz" + +inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic ruby-ng + +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_passenger? ( ${HTTP_PASSENGER_MODULE_URI} ) + nginx_modules_http_upload? ( ${HTTP_UPLOAD_MODULE_URI} ) + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} )" + +LICENSE="as-is BSD BSD-2 GPL-2 MIT" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd" + +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 +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" + +IUSE="aio debug +http +http-cache ipv6 libatomic +pcre 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 ) + 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 + dev-perl/FCGI + dev-perl/FCGI-ProcManager ) + 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 ) + nginx_modules_http_passenger? ( + $(ruby_implementation_depend ruby18) + =www-apache/${HTTP_PASSENGER_MODULE_P} + >=dev-ruby/rubygems-0.9.0 + >=dev-ruby/rake-0.8.1 + >=dev-ruby/fastthread-1.0.1 + >=dev-ruby/rack-1.0.0 + )" +RDEPEND="${CDEPEND}" +DEPEND="${CDEPEND} + arm? ( dev-libs/libatomic_ops ) + libatomic? ( dev-libs/libatomic_ops )" +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" + +ALLWORKDIR="${WORKDIR}/all" +S="${ALLWORKDIR}/${P}" + +pkg_setup() { + 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 + if use nginx_modules_http_passenger; then + ruby-ng_pkg_setup + use debug && append-flags -DPASSENGER_DEBUG + fi +} + +src_prepare() { + sed -i 's/ make/ \\$(MAKE)/' "${S}"/auto/lib/perl/make + + if use nginx_modules_http_passenger; then + cd "${ALLWORKDIR}/${HTTP_PASSENGER_MODULE_P}" + pwd + epatch "${FILESDIR}/passenger-CFLAGS-headers.patch" + fi +} + +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" + + # 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=${ALLWORKDIR}/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=${ALLWORKDIR}/agentzh-headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_SHA1}" + fi + + if use nginx_modules_http_push; then + http_enabled=1 + myconf+=" --add-module=${ALLWORKDIR}/${HTTP_PUSH_MODULE_P}" + fi + + if use nginx_modules_http_cache_purge; then + http_enabled=1 + myconf+=" --add-module=${ALLWORKDIR}/${HTTP_CACHE_PURGE_MODULE_P}" + fi + + if use nginx_modules_http_upload; then + http_enabled=1 + myconf+=" --add-module=${ALLWORKDIR}/${HTTP_UPLOAD_MODULE_P}" + fi + + if use nginx_modules_http_slowfs_cache; then + http_enabled=1 + myconf+=" --add-module=${ALLWORKDIR}/${HTTP_SLOWFS_CACHE_MODULE_P}" + fi + + if use nginx_modules_http_passenger; then + http_enabled=1 + myconf="${myconf} --add-module=${ALLWORKDIR}/${HTTP_PASSENGER_MODULE_P}/ext/nginx" + 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 + + ./configure \ + --prefix=/usr \ + --sbin-path=/usr/sbin/nginx \ + --conf-path=/etc/${PN}/${PN}.conf \ + --error-log-path=/var/log/${PN}/error_log \ + --pid-path=/var/run/${PN}.pid \ + --lock-path=/var/lock/nginx.lock \ + --user=${PN} --group=${PN} \ + --with-cc-opt="-I${ROOT}usr/include" \ + --with-ld-opt="-L${ROOT}usr/lib" \ + --http-log-path=/var/log/${PN}/access_log \ + --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 \ + --http-scgi-temp-path=/var/tmp/${PN}/scgi \ + --http-uwsgi-temp-path=/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}" || die "emake failed" +} + +src_install() { + keepdir /var/log/${PN} /var/tmp/${PN}/{client,proxy,fastcgi,scgi,uwsgi} + keepdir /var/www/localhost/htdocs + + dosbin objs/nginx + newinitd "${FILESDIR}"/nginx.init-r2 nginx + + cp "${FILESDIR}"/nginx.conf-r4 conf/nginx.conf + rm conf/win-utf conf/koi-win conf/koi-utf + + dodir /etc/${PN} + insinto /etc/${PN} + doins conf/* + + doman man/nginx.8 + dodoc CHANGES* README + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/nginx.logrotate nginx + + if use nginx_modules_http_perl; then + # perl wrapper + dobin "${FILESDIR}/cgiwrap-fcgi.pl" + newinitd "${FILESDIR}/cgiwrap-fcgi.init" cgiwrap-fcgi + cd "objs/src/http/modules/perl/" + einstall DESTDIR="${D}" INSTALLDIRS=vendor || die "failed to install perl stuff" + fixlocalpod + fi + + if use nginx_modules_http_push; then + docinto ${HTTP_PUSH_MODULE_P} + dodoc "${ALLWORKDIR}"/${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 "${ALLWORKDIR}"/${HTTP_CACHE_PURGE_MODULE_P}/{CHANGES,README} + fi + + if use nginx_modules_http_upload; then + docinto ${HTTP_UPLOAD_MODULE_P} + dodoc "${ALLWORKDIR}"/${HTTP_UPLOAD_MODULE_P}/{Changelog,README} + fi + + if use nginx_modules_http_slowfs_cache; then + docinto ${HTTP_SLOWFS_CACHE_MODULE_P} + dodoc "${ALLWORKDIR}"/${HTTP_SLOWFS_CACHE_MODULE_P}/{CHANGES,README} + fi +} + +pkg_postinst() { + if use ssl; then + 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 + fi +}