diff -Naur mod_spdy.orig/files/mod_spdy-0.9.3.3-2.2_to_2.4.patch mod_spdy/files/mod_spdy-0.9.3.3-2.2_to_2.4.patch --- mod_spdy.orig/files/mod_spdy-0.9.3.3-2.2_to_2.4.patch 1970-01-01 01:00:00.000000000 +0100 +++ mod_spdy/files/mod_spdy-0.9.3.3-2.2_to_2.4.patch 2013-05-28 13:45:00.044225227 +0200 @@ -0,0 +1,283 @@ +source: https://code.google.com/p/mod-spdy/issues/detail?id=64 + +diff -Naur mod_spdy-0.9.3.3.orig/src/build_modssl_with_npn.sh mod_spdy-0.9.3.3/src/build_modssl_with_npn.sh +--- mod_spdy-0.9.3.3.orig/src/build_modssl_with_npn.sh 2013-05-28 01:53:11.000000000 +0200 ++++ mod_spdy-0.9.3.3/src/build_modssl_with_npn.sh 2013-05-28 09:59:28.214555403 +0200 +@@ -94,7 +94,7 @@ + } + + OPENSSL_SRC_TGZ_URL="http://www.openssl.org/source/openssl-1.0.1c.tar.gz" +-APACHE_HTTPD_SRC_TGZ_URL="http://archive.apache.org/dist/httpd/httpd-2.2.22.tar.gz" ++APACHE_HTTPD_SRC_TGZ_URL="http://archive.apache.org/dist/httpd/httpd-2.4.4.tar.gz" + APACHE_HTTPD_MODSSL_NPN_PATCH_PATH="$(dirname $0)/scripts/mod_ssl_with_npn.patch" + + OPENSSL_SRC_TGZ=$(basename $OPENSSL_SRC_TGZ_URL) +@@ -113,7 +113,7 @@ + pushd $BUILDROOT >/dev/null + + download_file $OPENSSL_SRC_TGZ_URL $OPENSSL_SRC_TGZ ae412727c8c15b67880aef7bd2999b2e +-download_file $APACHE_HTTPD_SRC_TGZ_URL $APACHE_HTTPD_SRC_TGZ d77fa5af23df96a8af68ea8114fa6ce1 ++download_file $APACHE_HTTPD_SRC_TGZ_URL $APACHE_HTTPD_SRC_TGZ a2fed766e67c9681e0d9b86768f08286 + + echo "" + +diff -Naur mod_spdy-0.9.3.3.orig/src/mod_spdy/apache/apache_spdy_stream_task_factory.cc mod_spdy-0.9.3.3/src/mod_spdy/apache/apache_spdy_stream_task_factory.cc +--- mod_spdy-0.9.3.3.orig/src/mod_spdy/apache/apache_spdy_stream_task_factory.cc 2013-05-28 01:53:11.000000000 +0200 ++++ mod_spdy-0.9.3.3/src/mod_spdy/apache/apache_spdy_stream_task_factory.cc 2013-05-28 10:04:40.978309849 +0200 +@@ -98,8 +98,8 @@ + slave_connection_->base_server = master_connection->base_server; + slave_connection_->local_addr = master_connection->local_addr; + slave_connection_->local_ip = master_connection->local_ip; +- slave_connection_->remote_addr = master_connection->remote_addr; +- slave_connection_->remote_ip = master_connection->remote_ip; ++ slave_connection_->client_addr = master_connection->client_addr; ++ slave_connection_->client_ip = master_connection->client_ip; + + // We're supposed to pass a socket object to ap_process_connection below, but + // there's no meaningful object to pass for this slave connection, because +diff -Naur mod_spdy-0.9.3.3.orig/src/mod_spdy/apache/log_message_handler.cc mod_spdy-0.9.3.3/src/mod_spdy/apache/log_message_handler.cc +--- mod_spdy-0.9.3.3.orig/src/mod_spdy/apache/log_message_handler.cc 2013-05-28 01:53:11.000000000 +0200 ++++ mod_spdy-0.9.3.3/src/mod_spdy/apache/log_message_handler.cc 2013-05-28 10:06:17.731472991 +0200 +@@ -22,6 +22,7 @@ + // #defined LOG_* as numbers. This conflicts with what we are using those here. + #undef HAVE_SYSLOG + #include "http_log.h" ++APLOG_USE_MODULE(spdy); + + #include "base/debug/debugger.h" + #include "base/debug/stack_trace.h" +diff -Naur mod_spdy-0.9.3.3.orig/src/mod_spdy/mod_spdy.cc mod_spdy-0.9.3.3/src/mod_spdy/mod_spdy.cc +--- mod_spdy-0.9.3.3.orig/src/mod_spdy/mod_spdy.cc 2013-05-28 01:53:11.000000000 +0200 ++++ mod_spdy-0.9.3.3/src/mod_spdy/mod_spdy.cc 2013-05-28 10:07:08.358081848 +0200 +@@ -254,8 +254,8 @@ + for (server_rec* server = server_list; server != NULL; + server = server->next) { + spdy_enabled |= mod_spdy::GetServerConfig(server)->spdy_enabled(); +- if (server->loglevel > max_apache_log_level) { +- max_apache_log_level = server->loglevel; ++ if (server->log.level > max_apache_log_level) { ++ max_apache_log_level = server->log.level; + } + } + +diff -Naur mod_spdy-0.9.3.3.orig/src/scripts/mod_ssl_with_npn.patch mod_spdy-0.9.3.3/src/scripts/mod_ssl_with_npn.patch +--- mod_spdy-0.9.3.3.orig/src/scripts/mod_ssl_with_npn.patch 2013-05-28 01:53:11.000000000 +0200 ++++ mod_spdy-0.9.3.3/src/scripts/mod_ssl_with_npn.patch 2013-05-28 10:09:45.783975937 +0200 +@@ -1,21 +1,60 @@ +-Index: modules/ssl/ssl_private.h +-=================================================================== +---- modules/ssl/ssl_private.h (revision 1367982) +-+++ modules/ssl/ssl_private.h (working copy) +-@@ -603,6 +603,7 @@ +- #ifndef OPENSSL_NO_TLSEXT +- int ssl_callback_ServerNameIndication(SSL *, int *, modssl_ctx_t *); +- #endif +-+int ssl_callback_AdvertiseNextProtos(SSL *ssl, const unsigned char **data, unsigned int *len, void *arg); ++diff -ru modules/ssl/mod_ssl.c modules/ssl/mod_ssl.c ++--- modules/ssl/mod_ssl.c 2012-12-11 10:55:03.000000000 +0100 +++++ modules/ssl/mod_ssl.c 2013-04-18 19:20:51.000000000 +0200 ++@@ -272,6 +272,18 @@ ++ AP_END_CMD ++ }; ++ +++/* Implement 'modssl_run_npn_advertise_protos_hook'. */ +++APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL( +++ modssl, AP, int, npn_advertise_protos_hook, +++ (conn_rec *connection, apr_array_header_t *protos), +++ (connection, protos), OK, DECLINED); +++ +++/* Implement 'modssl_run_npn_proto_negotiated_hook'. */ +++APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL( +++ modssl, AP, int, npn_proto_negotiated_hook, +++ (conn_rec *connection, const char *proto_name, apr_size_t proto_name_len), +++ (connection, proto_name, proto_name_len), OK, DECLINED); +++ ++ /* ++ * the various processing hooks ++ */ ++diff -ru modules/ssl/mod_ssl.h modules/ssl/mod_ssl.h ++--- modules/ssl/mod_ssl.h 2011-09-23 15:38:09.000000000 +0200 +++++ modules/ssl/mod_ssl.h 2013-04-18 19:20:51.000000000 +0200 ++@@ -63,5 +63,26 @@ + +- /** Session Cache Support */ +- void ssl_scache_init(server_rec *, apr_pool_t *); +-Index: modules/ssl/ssl_engine_init.c +-=================================================================== +---- modules/ssl/ssl_engine_init.c (revision 1367982) +-+++ modules/ssl/ssl_engine_init.c (working copy) +-@@ -559,6 +559,11 @@ +- SSL_CTX_set_tmp_dh_callback(ctx, ssl_callback_TmpDH); ++ APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *)); ++ +++/** The npn_advertise_protos optional hook allows other modules to add entries +++ * to the list of protocol names advertised by the server during the Next +++ * Protocol Negotiation (NPN) portion of the SSL handshake. The hook callee is +++ * given the connection and an APR array; it should push one or more char*'s +++ * pointing to null-terminated strings (such as "http/1.1" or "spdy/2") onto +++ * the array and return OK, or do nothing and return DECLINED. */ +++APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_advertise_protos_hook, +++ (conn_rec *connection, apr_array_header_t *protos)); +++ +++/** The npn_proto_negotiated optional hook allows other modules to discover the +++ * name of the protocol that was chosen during the Next Protocol Negotiation +++ * (NPN) portion of the SSL handshake. Note that this may be the empty string +++ * (in which case modules should probably assume HTTP), or it may be a protocol +++ * that was never even advertised by the server. The hook callee is given the +++ * connection, a non-null-terminated string containing the protocol name, and +++ * the length of the string; it should do something appropriate (i.e. insert or +++ * remove filters) and return OK, or do nothing and return DECLINED. */ +++APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_proto_negotiated_hook, +++ (conn_rec *connection, const char *proto_name, +++ apr_size_t proto_name_len)); +++ ++ #endif /* __MOD_SSL_H__ */ ++ /** @} */ ++diff -ru modules/ssl/ssl_engine_init.c modules/ssl/ssl_engine_init.c ++--- modules/ssl/ssl_engine_init.c 2012-12-11 10:55:03.000000000 +0100 +++++ modules/ssl/ssl_engine_init.c 2013-04-18 19:20:51.000000000 +0200 ++@@ -725,6 +725,11 @@ ++ #endif + + SSL_CTX_set_info_callback(ctx, ssl_callback_Info); + + +@@ -26,11 +65,10 @@ + } + + static void ssl_init_ctx_verify(server_rec *s, +-Index: modules/ssl/ssl_engine_io.c +-=================================================================== +---- modules/ssl/ssl_engine_io.c (revision 1367982) +-+++ modules/ssl/ssl_engine_io.c (working copy) +-@@ -338,6 +338,7 @@ ++diff -ru modules/ssl/ssl_engine_io.c modules/ssl/ssl_engine_io.c ++--- modules/ssl/ssl_engine_io.c 2012-09-21 17:10:12.000000000 +0200 +++++ modules/ssl/ssl_engine_io.c 2013-04-18 19:20:51.000000000 +0200 ++@@ -297,6 +297,7 @@ + apr_pool_t *pool; + char buffer[AP_IOBUFSIZE]; + ssl_filter_ctx_t *filter_ctx; +@@ -38,7 +76,7 @@ + } bio_filter_in_ctx_t; + + /* +-@@ -1409,6 +1410,27 @@ ++@@ -1385,6 +1386,27 @@ + APR_BRIGADE_INSERT_TAIL(bb, bucket); + } + +@@ -66,22 +104,21 @@ + return APR_SUCCESS; + } + +-@@ -1753,6 +1775,7 @@ ++@@ -1866,6 +1888,7 @@ + inctx->block = APR_BLOCK_READ; + inctx->pool = c->pool; + inctx->filter_ctx = filter_ctx; + + inctx->npn_finished = 0; + } + +- void ssl_io_filter_init(conn_rec *c, SSL *ssl) +-Index: modules/ssl/ssl_engine_kernel.c +-=================================================================== +---- modules/ssl/ssl_engine_kernel.c (revision 1367982) +-+++ modules/ssl/ssl_engine_kernel.c (working copy) +-@@ -2104,3 +2104,84 @@ +- return 0; ++ /* The request_rec pointer is passed in here only to ensure that the ++diff -ru modules/ssl/ssl_engine_kernel.c modules/ssl/ssl_engine_kernel.c ++--- modules/ssl/ssl_engine_kernel.c 2012-12-11 10:55:03.000000000 +0100 +++++ modules/ssl/ssl_engine_kernel.c 2013-04-18 19:20:51.000000000 +0200 ++@@ -2186,3 +2186,84 @@ + } +- #endif ++ ++ #endif /* OPENSSL_NO_SRP */ + + + +#ifdef HAVE_TLS_NPN + +/* +@@ -163,66 +200,11 @@ + + return SSL_TLSEXT_ERR_OK; + +} + +#endif +-Index: modules/ssl/mod_ssl.c +-=================================================================== +---- modules/ssl/mod_ssl.c (revision 1367982) +-+++ modules/ssl/mod_ssl.c (working copy) +-@@ -220,6 +220,18 @@ +- AP_END_CMD +- }; +- +-+/* Implement 'modssl_run_npn_advertise_protos_hook'. */ +-+APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL( +-+ modssl, AP, int, npn_advertise_protos_hook, +-+ (conn_rec *connection, apr_array_header_t *protos), +-+ (connection, protos), OK, DECLINED); +-+ +-+/* Implement 'modssl_run_npn_proto_negotiated_hook'. */ +-+APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL( +-+ modssl, AP, int, npn_proto_negotiated_hook, +-+ (conn_rec *connection, const char *proto_name, apr_size_t proto_name_len), +-+ (connection, proto_name, proto_name_len), OK, DECLINED); +-+ +- /* +- * the various processing hooks +- */ +-Index: modules/ssl/mod_ssl.h +-=================================================================== +---- modules/ssl/mod_ssl.h (revision 1367982) +-+++ modules/ssl/mod_ssl.h (working copy) +-@@ -60,5 +60,26 @@ +- +- APR_DECLARE_OPTIONAL_FN(apr_array_header_t *, ssl_extlist_by_oid, (request_rec *r, const char *oidstr)); +- +-+/** The npn_advertise_protos optional hook allows other modules to add entries +-+ * to the list of protocol names advertised by the server during the Next +-+ * Protocol Negotiation (NPN) portion of the SSL handshake. The hook callee is +-+ * given the connection and an APR array; it should push one or more char*'s +-+ * pointing to null-terminated strings (such as "http/1.1" or "spdy/2") onto +-+ * the array and return OK, or do nothing and return DECLINED. */ +-+APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_advertise_protos_hook, +-+ (conn_rec *connection, apr_array_header_t *protos)); +-+ +-+/** The npn_proto_negotiated optional hook allows other modules to discover the +-+ * name of the protocol that was chosen during the Next Protocol Negotiation +-+ * (NPN) portion of the SSL handshake. Note that this may be the empty string +-+ * (in which case modules should probably assume HTTP), or it may be a protocol +-+ * that was never even advertised by the server. The hook callee is given the +-+ * connection, a non-null-terminated string containing the protocol name, and +-+ * the length of the string; it should do something appropriate (i.e. insert or +-+ * remove filters) and return OK, or do nothing and return DECLINED. */ +-+APR_DECLARE_EXTERNAL_HOOK(modssl, AP, int, npn_proto_negotiated_hook, +-+ (conn_rec *connection, const char *proto_name, +-+ apr_size_t proto_name_len)); +-+ +- #endif /* __MOD_SSL_H__ */ +- /** @} */ +-Index: modules/ssl/ssl_toolkit_compat.h +-=================================================================== +---- modules/ssl/ssl_toolkit_compat.h (revision 1367982) +-+++ modules/ssl/ssl_toolkit_compat.h (working copy) +-@@ -145,6 +145,11 @@ +- #define HAVE_FIPS ++diff -ru modules/ssl/ssl_private.h modules/ssl/ssl_private.h ++--- modules/ssl/ssl_private.h 2012-12-11 10:55:03.000000000 +0100 +++++ modules/ssl/ssl_private.h 2013-04-18 19:20:51.000000000 +0200 ++@@ -149,6 +149,11 @@ ++ #define OPENSSL_NO_EC + #endif + + +#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_NEXTPROTONEG) \ +@@ -233,3 +215,11 @@ + #ifndef PEM_F_DEF_CALLBACK + #ifdef PEM_F_PEM_DEF_CALLBACK + /** In OpenSSL 0.9.8 PEM_F_DEF_CALLBACK was renamed */ ++@@ -614,6 +619,7 @@ ++ unsigned char aes_key[16]; ++ } modssl_ticket_key_t; ++ #endif +++int ssl_callback_AdvertiseNextProtos(SSL *ssl, const unsigned char **data, unsigned int *len, void *arg); ++ ++ typedef struct SSLSrvConfigRec SSLSrvConfigRec; ++ diff -Naur mod_spdy.orig/files/mod_spdy-0.9.3.3-compile-fix.patch mod_spdy/files/mod_spdy-0.9.3.3-compile-fix.patch --- mod_spdy.orig/files/mod_spdy-0.9.3.3-compile-fix.patch 1970-01-01 01:00:00.000000000 +0100 +++ mod_spdy/files/mod_spdy-0.9.3.3-compile-fix.patch 2013-05-28 10:41:42.949787698 +0200 @@ -0,0 +1,38 @@ +source: https://github.com/pld-linux/apache-mod_spdy/blob/master/log-constants.patch +fix: third_party/chromium/src/base/logging.h:292:19: error: expected unqualified-id before numeric constant + +"fix": +mod_spdy/mod_spdy.cc: In function 'void {anonymous}::ChildInit(apr_pool_t*, server_rec*)': +mod_spdy/mod_spdy.cc:253:31: error: 'LOG_INFO' was not declared in this scope +mod_spdy/mod_spdy.cc:253:31: note: suggested alternative: +In file included from third_party/chromium/src/net/spdy/spdy_protocol.h:13:0, + from third_party/chromium/src/net/spdy/spdy_framer.h:19, + from ./mod_spdy/common/http_to_spdy_converter.h:24, + from ./mod_spdy/apache/filters/http_to_spdy_filter.h:24, + from mod_spdy/mod_spdy.cc:40: +third_party/chromium/src/base/logging.h:290:19: note: 'logging::LOG_INFO' +mod_spdy/mod_spdy.cc:253:45: error: template argument 1 is invalid +mod_spdy/mod_spdy.cc:253:108: error: invalid type in declaration before ';' token +--- src/third_party/chromium/src/base/logging.h 2013-03-04 11:44:06.000000000 +0200 ++++ src/third_party/chromium/src/base/logging.h 2013-03-04 11:44:09.508892187 +0200 +@@ -286,7 +286,9 @@ + const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity + // Note: the log severities are used to index into the array of names, + // see log_severity_names. ++#undef LOG_INFO + const LogSeverity LOG_INFO = 0; ++#undef LOG_WARNING + const LogSeverity LOG_WARNING = 1; + const LogSeverity LOG_ERROR = 2; + const LogSeverity LOG_ERROR_REPORT = 3; +--- src/mod_spdy/mod_spdy.cc 2013-03-04 11:24:35.000000000 +0200 ++++ src/mod_spdy/mod_spdy.cc 2013-03-04 11:47:51.855821877 +0200 +@@ -250,7 +250,7 @@ + // determine the most verbose log level of any server in the list. + bool spdy_enabled = false; + int max_apache_log_level = APLOG_EMERG; // the least verbose log level +- COMPILE_ASSERT(APLOG_INFO > APLOG_ERR, bigger_number_means_more_verbose); ++ //COMPILE_ASSERT(APLOG_INFO > APLOG_ERR, bigger_number_means_more_verbose); + for (server_rec* server = server_list; server != NULL; + server = server->next) { + spdy_enabled |= mod_spdy::GetServerConfig(server)->spdy_enabled(); diff -Naur mod_spdy.orig/files/mod_spdy-0.9.3.3-gyp.patch mod_spdy/files/mod_spdy-0.9.3.3-gyp.patch --- mod_spdy.orig/files/mod_spdy-0.9.3.3-gyp.patch 1970-01-01 01:00:00.000000000 +0100 +++ mod_spdy/files/mod_spdy-0.9.3.3-gyp.patch 2013-05-28 13:49:05.673983254 +0200 @@ -0,0 +1,25 @@ +source: https://github.com/pld-linux/apache-mod_spdy/blob/master/gyp.patch +fix: Exception: Target third_party/apache/aprutil/aprutil.gyp:aprutil#target has an invalid target type 'settings'. Must be one of executable/loadable_module/static_library/shared_library/none. + +--- src/third_party/apache/apr/apr.gyp 2013-03-04 11:24:34.000000000 +0200 ++++ src/third_party/apache/apr/apr.gyp 2013-03-04 11:35:09.610648619 +0200 +@@ -192,7 +192,7 @@ + }, + { + 'target_name': 'apr', +- 'type': 'settings', ++ 'type': 'none', + 'dependencies': [ + 'include', + ], +--- src/third_party/apache/aprutil/aprutil.gyp 2013-03-04 11:24:34.000000000 +0200 ++++ src/third_party/apache/aprutil/aprutil.gyp 2013-03-04 11:36:54.408819317 +0200 +@@ -142,7 +142,7 @@ + }, + { + 'target_name': 'aprutil', +- 'type': 'settings', ++ 'type': 'none', + 'dependencies': [ + 'include', + ], diff -Naur mod_spdy.orig/mod_spdy-0.9.3.3.ebuild mod_spdy/mod_spdy-0.9.3.3.ebuild --- mod_spdy.orig/mod_spdy-0.9.3.3.ebuild 2013-05-28 02:21:25.000000000 +0200 +++ mod_spdy/mod_spdy-0.9.3.3.ebuild 2013-05-28 14:00:05.901603097 +0200 @@ -17,8 +17,8 @@ KEYWORDS="~amd64 ~x86" fi -DESCRIPTION="Apache module for rewriting web pages to reduce latency and bandwidth" -HOMEPAGE="http://code.google.com/p/modpagespeed" +DESCRIPTION="Apache SPDY module" +HOMEPAGE="https://code.google.com/p/mod-spdy" LICENSE="Apache-2.0" SLOT="0" @@ -30,7 +30,7 @@ DEPEND+=" net-misc/rsync" fi -need_apache2_2 +need_apache2_4 e() { echo "$@"; "$@" || die; } @@ -56,6 +56,14 @@ src_prepare() { epatch "${FILESDIR}"/${PN}-0.9.3.3-execinfo.patch + epatch "${FILESDIR}"/${PN}-0.9.3.3-2.2_to_2.4.patch + epatch "${FILESDIR}"/${PN}-0.9.3.3-gyp.patch + epatch "${FILESDIR}"/${PN}-0.9.3.3-compile-fix.patch + + # Make sure the system apr/apr-util and apache2 are used. + find src/third_party/apache/apr{,util}/src/include/ -name '*.[ch]' -delete + find src/third_party/apache/httpd/src/include/ -name '*.[ch]' -delete + # Make sure the system zlib is used. epatch "${FILESDIR}"/${PN}-0.9.3.3-system-zlib.patch find src/third_party/zlib/ -name '*.[ch]' -delete @@ -66,6 +74,10 @@ tc-export_build_env BUILD_AR BUILD_CC BUILD_CXX local myconf=( + -Dsystem_include_path_apr=/usr/include/apr-1 + -Dsystem_include_path_aprutil=/usr/include/apr-1 + -Dsystem_include_path_httpd=/usr/include/apache2 + -Duse_system_apache_dev=1 -Duse_system_zlib=1 -Duse_system_ssl=1 -Dwerror=