On Thu, Jul 11, 2013 at 10:39:21AM +0100, Colin Watson wrote: > On Sun, Apr 01, 2012 at 09:15:52PM +0000, a...@debian.org wrote: > > your package mod-ruby is provding an Apache2 web server module. > > We're upgrading Apache to the new upstream version 2.4 [1] (tracked > > as transition bug #661958). This requires all modules to be rebuilt > > due to ABI changes. > > I spent some time looking at this, and got as far as in the patch I've > attached here for the record. The next thing to look at according to > the resulting build failure would be changes to request.c.
And here's the actual patch ... -- Colin Watson [cjwat...@debian.org]
reverted: --- mod-ruby-1.2.6/debian/httpd.conf-apache1 +++ mod-ruby-1.2.6.orig/debian/httpd.conf-apache1 @@ -1,47 +0,0 @@ -LoadModule ruby_module /usr/lib/apache/1.3/mod_ruby.so - -# If the ruby module is installed, this will be enabled. -<IfModule mod_ruby.c> - # for Apache::RubyRun - RubyRequire apache/ruby-run - - # exec files under /ruby as ruby scripts. - <Location /ruby> - SetHandler ruby-object - RubyHandler Apache::RubyRun.instance - Options +ExecCGI - </Location> - - # exec *.rbx as ruby scripts. - <Files *.rbx> - SetHandler ruby-object - RubyHandler Apache::RubyRun.instance - </Files> - - # # for Apache::ERubyRun - # RubyRequire apache/eruby-run - # - # # handle files under /eruby as eRuby files by eruby. - # <Location /eruby> - # SetHandler ruby-object - # RubyHandler Apache::ERubyRun.instance - # </Location> - # - # # handle *.rhtml as eruby files. - # <Files *.rhtml> - # SetHandler ruby-object - # RubyHandler Apache::ERubyRun.instance - # </Files> - - # # for Apache::ERbRun - # RubyRequire apache/erb-run - # - # # handle files under /erb as eRuby files by ERb. - # <Location /erb> - # SetHandler ruby-object - # RubyHandler Apache::ERbRun.instance - # </Location> - - # # for debug - # RubyRequire auto-reload -</IfModule> diff -u mod-ruby-1.2.6/debian/changelog mod-ruby-1.2.6/debian/changelog --- mod-ruby-1.2.6/debian/changelog +++ mod-ruby-1.2.6/debian/changelog @@ -1,3 +1,11 @@ +mod-ruby (1.2.6-2.1) UNRELEASED; urgency=low + + * Non-maintainer upload. + * Port to Apache 2.4 (closes: #666854). + * Drop some more vestiges of Apache 1 support. + + -- Colin Watson <cjwat...@debian.org> Wed, 10 Jul 2013 23:37:44 +0100 + mod-ruby (1.2.6-2) unstable; urgency=low * Fixes for Ruby 1.8.7. reverted: --- mod-ruby-1.2.6/debian/libapache-mod-ruby.dirs +++ mod-ruby-1.2.6.orig/debian/libapache-mod-ruby.dirs @@ -1 +0,0 @@ -usr/lib/apache/1.3 reverted: --- mod-ruby-1.2.6/debian/libapache2-mod-ruby.prerm +++ mod-ruby-1.2.6.orig/debian/libapache2-mod-ruby.prerm @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -#DEBHELPER# - -if [ "$1" != "remove" -a "$1" != "purge" ]; then - exit 0 -fi; - -if [ -e /etc/apache2/apache2.conf ]; then - a2dismod ruby || true -fi - -exit 0 reverted: --- mod-ruby-1.2.6/debian/libapache-mod-ruby.docs +++ mod-ruby-1.2.6.orig/debian/libapache-mod-ruby.docs @@ -1,3 +0,0 @@ -README.en -README.ja -NOTICE reverted: --- mod-ruby-1.2.6/debian/libapache-mod-ruby.examples +++ mod-ruby-1.2.6.orig/debian/libapache-mod-ruby.examples @@ -1 +0,0 @@ -debian/httpd.conf-apache1 diff -u mod-ruby-1.2.6/debian/control mod-ruby-1.2.6/debian/control --- mod-ruby-1.2.6/debian/control +++ mod-ruby-1.2.6/debian/control @@ -3,7 +3,7 @@ Priority: optional Maintainer: Shugo Maeda <sh...@debian.org> Uploaders: Shugo Maeda <sh...@debian.org>, ARAKI Yasuhiro <a...@debian.org> -Build-Depends: debhelper (>= 4.1.16), apache2-threaded-dev (>= 2.2.3-1) | apache2-prefork-dev (>= 2.2.3-1), ruby1.8, ruby1.8-dev +Build-Depends: debhelper (>= 4.1.16), dh-apache2, apache2-dev (>= 2.2.3-1), ruby1.8, ruby1.8-dev Standards-Version: 3.6.2 Package: libapache-ruby1.8 @@ -21,7 +21,7 @@ Package: libapache2-mod-ruby Architecture: any -Depends: ${shlibs:Depends}, apache2.2-common, libapache-ruby1.8 (= ${source:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libapache-ruby1.8 (= ${source:Version}) Suggests: liberuby (>= 0.9.4) Description: Embedding Ruby in the Apache2 web server mod_ruby embeds the Ruby interpreter into the Apache2 web server, reverted: --- mod-ruby-1.2.6/debian/libapache2-mod-ruby.postinst +++ mod-ruby-1.2.6.orig/debian/libapache2-mod-ruby.postinst @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -#DEBHELPER# - -if [ "$1" != "configure" ]; then - exit 0 -fi - -if [ -e /etc/apache2/apache2.conf ]; then - a2enmod ruby || true -fi - -exit 0 diff -u mod-ruby-1.2.6/debian/rules mod-ruby-1.2.6/debian/rules --- mod-ruby-1.2.6/debian/rules +++ mod-ruby-1.2.6/debian/rules @@ -77,6 +77,7 @@ # dh_installman # dh_undocumented dh_installchangelogs ChangeLog + dh_apache2 dh_strip dh_compress dh_fixperms only in patch2: unchanged: --- mod-ruby-1.2.6.orig/mod_ruby.c +++ mod-ruby-1.2.6/mod_ruby.c @@ -238,6 +238,10 @@ NULL, NULL, APR_HOOK_MIDDLE); } +#ifdef APLOG_USE_MODULE +APLOG_USE_MODULE(ruby); +#endif + module AP_MODULE_DECLARE_DATA ruby_module = { STANDARD20_MODULE_STUFF, @@ -489,15 +493,20 @@ return errmsg; } -void ruby_log_error(const char *file, int line, int level, - const server_rec *s, const char *fmt, ...) +void ruby_log_error(const char *file, int line, +#ifdef APLOG_MODULE_INDEX + int module_index, +#endif + int level, const server_rec *s, const char *fmt, ...) { va_list args; char buf[BUFSIZ]; va_start(args, fmt); vsnprintf(buf, BUFSIZ, fmt, args); -#ifdef APACHE2 +#ifdef APLOG_MODULE_INDEX + ap_log_error(file, line, module_index, level, 0, s, "mod_ruby: %s", buf); +#elif defined(APACHE2) ap_log_error(file, line, level, 0, s, "mod_ruby: %s", buf); #else ap_log_error(file, line, level, s, "mod_ruby: %s", buf); only in patch2: unchanged: --- mod-ruby-1.2.6.orig/apachelib.c +++ mod-ruby-1.2.6/apachelib.c @@ -97,10 +97,22 @@ return rb_eval_string_wrap(StringValuePtr(str), NULL); } +#if AP_MODULE_MAGIC_AT_LEAST(20060905,0) +static VALUE apache_server_banner(VALUE self) +{ + return rb_str_new2(ap_get_server_banner()); +} + +static VALUE apache_server_description(VALUE self) +{ + return rb_str_new2(ap_get_server_description()); +} +#else static VALUE apache_server_version(VALUE self) { return rb_str_new2(ap_get_server_version()); } +#endif #ifdef APACHE2 /* Apache 2.x */ static VALUE apache_add_version_component(VALUE self, VALUE component) @@ -195,7 +207,13 @@ rb_define_global_function("eval_string_wrap", f_eval_string_wrap, 1); rb_mApache = rb_define_module("Apache"); +#if AP_MODULE_MAGIC_AT_LEAST(20060905,0) + rb_define_module_function(rb_mApache, "server_banner", apache_server_banner, 0); + rb_define_module_function(rb_mApache, "server_description", + apache_server_description, 0); +#else rb_define_module_function(rb_mApache, "server_version", apache_server_version, 0); +#endif rb_define_module_function(rb_mApache, "add_version_component", apache_add_version_component, 1); rb_define_module_function(rb_mApache, "server_built", apache_server_built, 0); @@ -371,7 +389,12 @@ rb_define_const(rb_mApache, "OPT_SYM_LINKS", INT2NUM(OPT_SYM_LINKS)); rb_define_const(rb_mApache, "OPT_EXECCGI", INT2NUM(OPT_EXECCGI)); rb_define_const(rb_mApache, "OPT_UNSET", INT2NUM(OPT_UNSET)); +#ifdef OPT_INC_WITH_EXEC + rb_define_const(rb_mApache, "OPT_INC_WITH_EXEC", + INT2NUM(OPT_INC_WITH_EXEC)); +#else rb_define_const(rb_mApache, "OPT_INCNOEXEC", INT2NUM(OPT_INCNOEXEC)); +#endif rb_define_const(rb_mApache, "OPT_SYM_OWNER", INT2NUM(OPT_SYM_OWNER)); rb_define_const(rb_mApache, "OPT_MULTI", INT2NUM(OPT_MULTI)); rb_define_const(rb_mApache, "OPT_ALL", INT2NUM(OPT_ALL)); only in patch2: unchanged: --- mod-ruby-1.2.6.orig/mod_ruby.h +++ mod-ruby-1.2.6/mod_ruby.h @@ -235,8 +235,11 @@ extern array_header *ruby_required_libraries; VALUE rb_protect_funcall(VALUE recv, ID mid, int *state, int argc, ...); -void ruby_log_error(const char *file, int line, int level, - const server_rec *s, const char *fmt, ...); +void ruby_log_error(const char *file, int line, +#ifdef APLOG_MODULE_INDEX + int module_index, +#endif + int level, const server_rec *s, const char *fmt, ...); void ruby_log_error_string(server_rec *s, VALUE errmsg); VALUE ruby_get_error_info(int state); int ruby_running(); only in patch2: unchanged: --- mod-ruby-1.2.6.orig/server.c +++ mod-ruby-1.2.6/server.c @@ -60,7 +60,11 @@ DEFINE_STRING_ATTR_READER(server_hostname, server_rec, server_hostname); DEFINE_UINT_ATTR_READER(server_port, server_rec, port); DEFINE_STRING_ATTR_READER(server_error_fname, server_rec, error_fname); +#if AP_MODULE_MAGIC_AT_LEAST(20100606,0) +DEFINE_INT_ATTR_READER(server_loglevel, server_rec, log.level); +#else DEFINE_INT_ATTR_READER(server_loglevel, server_rec, loglevel); +#endif DEFINE_BOOL_ATTR_READER(server_is_virtual, server_rec, is_virtual); DEFINE_INT_ATTR_READER(server_timeout, server_rec, timeout); DEFINE_INT_ATTR_READER(server_keep_alive_timeout, server_rec, only in patch2: unchanged: --- mod-ruby-1.2.6.orig/connection.c +++ mod-ruby-1.2.6/connection.c @@ -36,7 +36,11 @@ } DEFINE_BOOL_ATTR_READER(connection_aborted, conn_rec, aborted); +#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) +DEFINE_STRING_ATTR_READER(connection_client_ip, conn_rec, client_ip); +#else DEFINE_STRING_ATTR_READER(connection_remote_ip, conn_rec, remote_ip); +#endif DEFINE_STRING_ATTR_READER(connection_remote_host, conn_rec, remote_host); DEFINE_STRING_ATTR_READER(connection_remote_logname, conn_rec, remote_logname); #ifdef APACHE2 @@ -114,7 +118,11 @@ Data_Get_Struct(self, conn_rec, conn); #ifdef APACHE2 +#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) + return INT2NUM(conn->client_addr->port); +#else return INT2NUM(conn->remote_addr->port); +#endif #else #ifdef APACHE6 return INT2NUM(ntohs(((struct sockaddr_in *)&conn->remote_addr)->sin_port)); @@ -130,8 +138,13 @@ rb_undef_method(CLASS_OF(rb_cApacheConnection), "new"); rb_define_method(rb_cApacheConnection, "aborted?", connection_aborted, 0); +#if AP_MODULE_MAGIC_AT_LEAST(20111130,0) + rb_define_method(rb_cApacheConnection, "client_ip", + connection_client_ip, 0); +#else rb_define_method(rb_cApacheConnection, "remote_ip", connection_remote_ip, 0); +#endif rb_define_method(rb_cApacheConnection, "remote_host", connection_remote_host, 0); rb_define_method(rb_cApacheConnection, "remote_port", only in patch2: unchanged: --- mod-ruby-1.2.6.orig/doc/classes.en.rd +++ mod-ruby-1.2.6/doc/classes.en.rd @@ -38,8 +38,16 @@ --- server_built Returns the server built date string. ---- server_version - Returns the server version string. +--- server_banner + Returns the server banner in a form suitable for sending over the + network, with the level of information controlled by the + ((|ServerTokens|)) directive. + +--- server_description + Returns the server description in a form suitable for local displays, + status reports, or logging. This includes the detailed server version + and information about some modules. It is not affected by the + ((|ServerTokens|)) directive. --- unescape_url(str) Decodes a URL-encoded string. @@ -148,7 +156,7 @@ OPT_ALL, OPT_EXECCGI, OPT_INCLUDES, - OPT_INCNOEXEC, + OPT_INC_WITH_EXEC, OPT_INDEXES, OPT_MULTI, OPT_NONE,