From c3958843c9589f2b7bfc3443196e24489c0754b3 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Fri, 25 Nov 2011 18:55:37 +0100 Subject: [PATCH] www-apache/mod_pagespeed: add initial ebuild from bugs.g.o (Portage version: 2.2.0_alpha76-r1/git/Linux x86_64, unsigned Manifest commit) --- www-apache/mod_pagespeed/ChangeLog | 10 ++ www-apache/mod_pagespeed/Manifest | 4 + .../mod_pagespeed/files/80_mod_pagespeed.conf | 157 ++++++++++++++++++ www-apache/mod_pagespeed/metadata.xml | 7 + .../mod_pagespeed/mod_pagespeed-9999.ebuild | 65 ++++++++ 5 files changed, 243 insertions(+) create mode 100644 www-apache/mod_pagespeed/ChangeLog create mode 100644 www-apache/mod_pagespeed/Manifest create mode 100644 www-apache/mod_pagespeed/files/80_mod_pagespeed.conf create mode 100644 www-apache/mod_pagespeed/metadata.xml create mode 100644 www-apache/mod_pagespeed/mod_pagespeed-9999.ebuild diff --git a/www-apache/mod_pagespeed/ChangeLog b/www-apache/mod_pagespeed/ChangeLog new file mode 100644 index 00000000..7aa70476 --- /dev/null +++ b/www-apache/mod_pagespeed/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for www-apache/mod_pagespeed +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*mod_pagespeed-9999 (25 Nov 2011) + + 25 Nov 2011; Mario Fetka + +files/80_mod_pagespeed.conf, +mod_pagespeed-9999.ebuild, +metadata.xml: + add initial ebuild from bugs.g.o + diff --git a/www-apache/mod_pagespeed/Manifest b/www-apache/mod_pagespeed/Manifest new file mode 100644 index 00000000..e4c44fab --- /dev/null +++ b/www-apache/mod_pagespeed/Manifest @@ -0,0 +1,4 @@ +AUX 80_mod_pagespeed.conf 6918 RMD160 825d542d000d724bf761de5590cc5a9a4c5f37fa SHA1 d3e1ae9c13bd167c83a8d1e1e9d8977743ac400a SHA256 aa737f2454f93c3e593aac16167b1ddc88113d3bade742f901a0861398b5129d +EBUILD mod_pagespeed-9999.ebuild 1842 RMD160 6b0c61dd58557ff1f7fafc39f6fdba90a9b945b0 SHA1 2f21907964c79382ed4caa4a542cf4683faa9d5b SHA256 d96027582a01a6c06085d9a28d9f375a37bbcd4616f9ba617640ec37c4cc7946 +MISC ChangeLog 322 RMD160 f1ca005c46f681fdb511050e80732dd3b8f13458 SHA1 46b1547df2842a0db808cf0737264f755202ac48 SHA256 9052b84c3cb6198a45d37bfef5a607c0f35a837ede2fba6db7444683d5000eea +MISC metadata.xml 205 RMD160 f85e91d792c694cb3e45fac26295dba0e6e43786 SHA1 3f13c3b49579342e2308323aa3dda2f43dd94c23 SHA256 9fdfc9c91107d94feb8416adc2cec7734fa27084bff83ea859938b3216e028bc diff --git a/www-apache/mod_pagespeed/files/80_mod_pagespeed.conf b/www-apache/mod_pagespeed/files/80_mod_pagespeed.conf new file mode 100644 index 00000000..bfea4fc4 --- /dev/null +++ b/www-apache/mod_pagespeed/files/80_mod_pagespeed.conf @@ -0,0 +1,157 @@ + +LoadModule pagespeed_module modules/mod_pagespeed.so + +# Only attempt to load mod_deflate if it hasn't been loaded already. + + LoadModule deflate_module modules/mod_deflate.so + + + + # Turn on mod_pagespeed. To completely disable mod_pagespeed, you + # can set this to "off". + ModPagespeed on + + # Direct Apache to send all HTML output to the mod_pagespeed + # output handler. + AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html + + # The ModPagespeedFileCachePath and + # ModPagespeedGeneratedFilePrefix directories must exist and be + # writable by the apache user (as specified by the User + # directive). +# Here the vanilla conf. I cannot understand the @@NAME@@ syntax!!! +# ModPagespeedFileCachePath "@@MODPAGESPEED_CACHE_ROOT@@/cache/" +# ModPagespeedGeneratedFilePrefix "@@MODPAGESPEED_CACHE_ROOT@@/files/" + ModPagespeedFileCachePath "/var/cache/mod_pagespeed/cache/" + ModPagespeedGeneratedFilePrefix "/var/cache/mod_pagespeed/files/" + + # Override the mod_pagespeed 'rewrite level'. The default level + # "CoreFilters" uses a set of rewrite filters that are generally + # safe for most web pages. Most sites should not need to change + # this value and can instead fine-tune the configuration using the + # ModPagespeedDisableFilters and ModPagespeedEnableFilters + # directives, below. Valid values for ModPagespeedRewriteLevel are + # PassThrough, CoreFilters and TestingCoreFilters. + # + # ModPagespeedRewriteLevel PassThrough + + # Explicitly disables specific filters. This is useful in + # conjuction with ModPagespeedRewriteLevel. For instance, if one + # of the filters in the CoreFilters needs to be disabled for a + # site, that filter can be added to + # ModPagespeedDisableFilters. This directive contains a + # comma-separated list of filter names, and can be repeated. + # + # ModPagespeedDisableFilters rewrite_images + + # Explicitly enables specific filters. This is useful in + # conjuction with ModPagespeedRewriteLevel. For instance, filters + # not included in the CoreFilters may be enabled using this + # directive. This directive contains a comma-separated list of + # filter names, and can be repeated. + # + # ModPagespeedEnableFilters rewrite_javascript,rewrite_css + # ModPagespeedEnableFilters collapse_whitespace,elide_attributes + +# ===================================================================== +# Test +# Uncomment the following lines to reproduce the example at: +# http://code.google.com/intl/en-US/speed/page-speed/docs/filter-css-rewrite.html + ModPagespeedEnableFilters rewrite_css +# ===================================================================== + + # ModPagespeedDomain + # authorizes rewriting of JS, CSS, and Image files found in this + # domain. By default only resources with the same origin as the + # HTML file are rewritten. For example: + # + # ModPagespeedDomain cdn.myhost.com + # + # This will allow resources found on http://cdn.myhost.com to be + # rewritten in addition to those in the same domain as the HTML. + # + # Wildcards (* and ?) are allowed in the domain specification. Be + # careful when using them as if you rewrite domains that do not + # send you traffic, then the site receiving the traffic will not + # know how to serve the rewritten content. + + # Other defaults (cache sizes and thresholds): + # + # ModPagespeedFileCacheSizeKb 102400 + # ModPagespeedFileCacheCleanIntervalMs 3600000 + # ModPagespeedLRUCacheKbPerProcess 1024 + # ModPagespeedLRUCacheByteLimit 16384 + # ModPagespeedCssInlineMaxBytes 2048 + # ModPagespeedImgInlineMaxBytes 2048 + # ModPagespeedJsInlineMaxBytes 2048 + # ModPagespeedCssOutlineMinBytes 3000 + # ModPagespeedJsOutlineMinBytes 3000 + + # Bound the number of images that can be rewritten at any one time; this + # avoids overloading the CPU. Set this to 0 to remove the bound. + # + # ModPagespeedImgMaxRewritesAtOnce 8 + + # When Apache is set up as a browser proxy, mod_pagespeed can record + # web-sites as they are requested, so that an image of the web is built up + # in the directory of the proxy administrator's choosing. When ReadOnly is + # on, only files already present in the SlurpDirectory are served by the + # proxy. + # + # ModPagespeedSlurpDirectory ... + # ModPagespeedSlurpReadOnly on + + # The maximum URL size is generally limited to about 2k characters + # due to IE: See http://support.microsoft.com/kb/208427/EN-US. + # Apache servers by default impose a further limitation of about + # 250 characters per URL segment (text between slashes). + # mod_pagespeed circumvents this limitation, but if you employ + # proxy servers in your path you may need to re-impose it by + # overriding the setting here. The default setting is 1024 + # characters. + # + # ModPagespeedMaxSegmentLength 250 + + # Uncomment this if you want to prevent mod_pagespeed from combining files + # (e.g. CSS files) across paths + # + # ModPagespeedCombineAcrossPaths off + + + # Enables server-side instrumentation and statistics. If this rewriter is + # enabled, then each rewritten HTML page will have instrumentation javacript + # added that sends latency beacons to /mod_pagespeed_beacon. These + # statistics can be accessed at /mod_pagespeed_statistics. You must also + # enable the mod_pagespeed_statistics and mod_pagespeed_beacon handlers + # below. + # + # ModPagespeedEnableFilters add_instrumentation + + # This handles the client-side instrumentation callbacks which are injected + # by the add_instrumentation filter. + # You can use a different location by adding the ModPagespeedBeaconUrl + # directive; see the documentation on add_instrumentation. + + SetHandler mod_pagespeed_beacon + + + # Uncomment the following line if you want to disable statistics entirely. + # + # ModPagespeedStatistics off + + # This page lets you view statistics about the mod_pagespeed module. + + Order allow,deny + # You may insert other "Allow from" lines to add hosts you want to + # allow to look at generated statistics. Another possibility is + # to comment out the "Order" and "Allow" options from the config + # file, to allow any client that can reach your server to examine + # statistics. This might be appropriate in an experimental setup or + # if the Apache server is protected by a reverse proxy that will + # filter URLs in some fashion. + Allow from localhost + SetHandler mod_pagespeed_statistics + + + + diff --git a/www-apache/mod_pagespeed/metadata.xml b/www-apache/mod_pagespeed/metadata.xml new file mode 100644 index 00000000..0830b325 --- /dev/null +++ b/www-apache/mod_pagespeed/metadata.xml @@ -0,0 +1,7 @@ + + + + + mario.fetka@gmail.com + + diff --git a/www-apache/mod_pagespeed/mod_pagespeed-9999.ebuild b/www-apache/mod_pagespeed/mod_pagespeed-9999.ebuild new file mode 100644 index 00000000..e6fef509 --- /dev/null +++ b/www-apache/mod_pagespeed/mod_pagespeed-9999.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" + +inherit apache-module eutils subversion + +DESCRIPTION="Apache module for rewriting web pages to reduce latency and bandwidth" +HOMEPAGE="http://code.google.com/p/modpagespeed" + +ESVN_REPO_URI="http://modpagespeed.googlecode.com/svn/trunk/src" +EGCLIENT_REPO_URI="http://src.chromium.org/svn/trunk/tools/depot_tools" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm" +IUSE="" + +DEPEND="dev-vcs/subversion" +RDEPEND="www-servers/apache" + +APACHE2_MOD_FILE="${S}/out/Release/${PN}.so" +APACHE2_MOD_CONF="80_${PN//-/_}" +APACHE2_MOD_DEFINE="PAGESPEED" + +need_apache2_2 + +src_unpack() { + # all the dirty job in WORKDIR + cd "${WORKDIR}" + + # fetch depot_tools + einfo "fetch depot_tools -->" + svn co "${EGCLIENT_REPO_URI}" + EGCLIENT="${WORKDIR}"/depot_tools/gclient + + # manually fetch sources in distfiles + if [[ ! -f .gclient ]]; then + einfo "gclient config -->" + ${EGCLIENT} config ${ESVN_REPO_URI} || die "gclient: error creating config" + fi + + # run gclient synchronization + einfo "gclient sync -->" + einfo " repository: ${ESVN_REPO_URI}" + ${EGCLIENT} sync --force || die "gclient: unable to sync" + + # move the sources to the working dir + rsync -rlpgo --exclude=".svn" --exclude=".glient*" src/ "${S}" + einfo " working copy: ${S}" +} + +src_compile() { + emake BUILDTYPE=Release V=1 || die "emake failed" +} + +src_install() { + mv -f out/Release/libmod_pagespeed.so out/Release/${PN}.so + apache-module_src_install + + keepdir /var/cache/mod_pagespeed /var/cache/mod_pagespeed/files /var/cache/mod_pagespeed/cache + fowners apache:apache /var/cache/mod_pagespeed /var/cache/mod_pagespeed/files /var/cache/mod_pagespeed/cache + fperms 0770 /var/cache/mod_pagespeed /var/cache/mod_pagespeed/files /var/cache/mod_pagespeed/cache +}