# HG changeset patch # User Michael Schloh von Bennewitz # Date 1347901276 -7200 # Node ID f805be991d7ffec817a622c8e19fcc02249907d4 # Parent 5a93a7863039a32b5b327d6f734cb2bc7b45e959 Import package vendor original spec for necessary manipulations. diff -r 5a93a7863039 -r f805be991d7f apache/apache.base --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/apache.base Mon Sep 17 19:01:16 2012 +0200 @@ -0,0 +1,347 @@ +## +## apache.base -- Apache Base/Default Configuration +## ______________________________________________________ +## +## PLEASE DO NOT EDIT THIS FILE!! ADJUST CONFIGURATION BY +## OVERRIDING DIRECTIVES IN "apache.conf" INSTEAD, PLEASE! +## ______________________________________________________ +## + +# global server +ServerRoot @l_prefix@ +ServerAdmin root@@l_hostname@.@l_domainname@ +ServerName @l_hostname@.@l_domainname@ +ServerTokens os +User @l_nusr@ +Group @l_ngrp@ + +# runtime files +LockFile @l_prefix@/var/apache/run/apache.lock + + PidFile @l_prefix@/var/apache/run/apache.pid + ScoreBoardFile @l_prefix@/var/apache/run/apache.sb + + + ScriptSock @l_prefix@/var/apache/run/apache.cgisock + + +# server behaviour +Timeout 300 +KeepAlive on +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 + + MinSpareServers 5 + MaxSpareServers 10 + StartServers 5 + MaxClients 150 + MaxRequestsPerChild 0 + + + MinSpareThreads 25 + MaxSpareThreads 75 + ThreadsPerChild 25 + StartServers 2 + ServerLimit 16 + MaxClients 150 + MaxRequestsPerChild 0 + +HostnameLookups off +UseCanonicalName on + +# access logging + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combined_io + + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{SSL_PROTOCOL}x %{SSL_CIPHER}x" combined_ssl + + LogFormat "%h %l %u %t \"%r\" %>s %b" common + LogFormat "%{Referer}i -> %U" referer + LogFormat "%{User-agent}i" agent + CustomLog @l_prefix@/var/apache/log/access.log common env=!ignore_global_access + + +# error logging +LogLevel warn +ErrorLog @l_prefix@/var/apache/log/error.log +ServerSignature on + +# script logging + + ScriptLog @l_prefix@/var/apache/log/script.log + ScriptLogBuffer 1024 + ScriptLogLength 10485760 + + +# secure root directory + + Options FollowSymLinks + AllowOverride None + Order deny,allow + Deny from all + + +# configure global document root +DocumentRoot @l_prefix@/share/apache/htdocs + + Alias /apache-htdocs @l_prefix@/share/apache/htdocs + + + Options Indexes FollowSymLinks MultiViews + AllowOverride none + Order allow,deny + Allow from all + + +# default directories and files + + UserDir public_html + UserDir disabled root + + + DirectoryIndex index.html + + +# local configuration files +AccessFileName .htaccess + + Order allow,deny + Deny from all + Satisfy All + + +# global Icons and CGI directory + + Alias /apache-icons @l_prefix@/share/apache/icons + + Options Indexes MultiViews + AllowOverride None + Order allow,deny + Allow from all + + AliasMatch ^/apache-manual(?:/(?:de|en|es|fr|ja|ko|pt-br|ru))?(/.*)?$ @l_prefix@/share/apache/manual$1 + + Options Indexes + AllowOverride None + Order allow,deny + Allow from all + + SetHandler type-map + + SetEnvIf Request_URI ^/apache-manual/(de|en|es|fr|ja|ko|pt-br|ru)/ prefer-language=$1 + RedirectMatch 301 ^/apache-manual(?:/(de|en|es|fr|ja|ko|pt-br|ru)){2,}(/.*)?$ /apache-manual/$1$2 + LanguagePriority en de es fr ja ko pt-br ru + ForceLanguagePriority Prefer Fallback + + Alias /apache-error @l_prefix@/share/apache/error + + Options IncludesNoExec + AllowOverride None + Order allow,deny + Allow from all + AddOutputFilter Includes html + AddHandler type-map var + LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr + ForceLanguagePriority Prefer Fallback + + ScriptAlias /openpkg-cgi "@l_prefix@/cgi" + + AllowOverride None + Options None + Order allow,deny + Allow from all + + + +# global server status information + + ExtendedStatus on + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + + SetHandler server-info + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + + +# automatic CGI and SSI recognition + + + AddHandler cgi-script .cgi + + + AddType text/html .shtml + AddOutputFilter INCLUDES .shtml + + + +# multi-language error documents +ErrorDocument 400 /apache-error/HTTP_BAD_REQUEST.html.var +ErrorDocument 401 /apache-error/HTTP_UNAUTHORIZED.html.var +ErrorDocument 403 /apache-error/HTTP_FORBIDDEN.html.var +ErrorDocument 404 /apache-error/HTTP_NOT_FOUND.html.var +ErrorDocument 405 /apache-error/HTTP_METHOD_NOT_ALLOWED.html.var +ErrorDocument 408 /apache-error/HTTP_REQUEST_TIME_OUT.html.var +ErrorDocument 410 /apache-error/HTTP_GONE.html.var +ErrorDocument 411 /apache-error/HTTP_LENGTH_REQUIRED.html.var +ErrorDocument 412 /apache-error/HTTP_PRECONDITION_FAILED.html.var +ErrorDocument 413 /apache-error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var +ErrorDocument 414 /apache-error/HTTP_REQUEST_URI_TOO_LARGE.html.var +ErrorDocument 415 /apache-error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var +ErrorDocument 500 /apache-error/HTTP_INTERNAL_SERVER_ERROR.html.var +ErrorDocument 501 /apache-error/HTTP_NOT_IMPLEMENTED.html.var +ErrorDocument 502 /apache-error/HTTP_BAD_GATEWAY.html.var +ErrorDocument 503 /apache-error/HTTP_SERVICE_UNAVAILABLE.html.var +ErrorDocument 506 /apache-error/HTTP_VARIANT_ALSO_VARIES.html.var + +# automatic directory indexing + + IndexOptions FancyIndexing HTMLTable VersionSort + ReadmeName README + HeaderName HEADER + IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t + DefaultIcon /apache-icons/unknown.gif + AddIcon /apache-icons/back.gif .. + AddIcon /apache-icons/dir.gif ^^DIRECTORY^^ + AddIcon /apache-icons/blank.gif ^^BLANKICON^^ + AddIcon /apache-icons/binary.gif .bin .exe + AddIcon /apache-icons/binhex.gif .hqx + AddIcon /apache-icons/tar.gif .tar + AddIcon /apache-icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv + AddIcon /apache-icons/compressed.gif .Z .z .tgz .gz .zip + AddIcon /apache-icons/a.gif .ps .ai .eps + AddIcon /apache-icons/layout.gif .html .shtml .htm .pdf + AddIcon /apache-icons/text.gif .txt + AddIcon /apache-icons/c.gif .c + AddIcon /apache-icons/p.gif .pl .py + AddIcon /apache-icons/f.gif .for + AddIcon /apache-icons/dvi.gif .dvi + AddIcon /apache-icons/uuencoded.gif .uu + AddIcon /apache-icons/script.gif .conf .sh .shar .csh .ksh .tcl + AddIcon /apache-icons/tex.gif .tex + AddIcon /apache-icons/bomb.gif core + AddIconByEncoding (CMP,/apache-icons/compressed.gif) x-compress x-gzip + AddIconByType (TXT,/apache-icons/text.gif) text/* + AddIconByType (IMG,/apache-icons/image2.gif) image/* + AddIconByType (SND,/apache-icons/sound2.gif) audio/* + AddIconByType (VID,/apache-icons/movie.gif) video/* + + +# MIME types and content negotiation +DefaultType text/plain + + TypesConfig @l_prefix@/etc/apache/mime.types + AddType application/x-compress .Z + AddType application/x-gzip .gz .tgz + AddType application/x-tar .tar + AddEncoding x-compress Z + AddEncoding x-gzip gz tgz + AddLanguage da .dk + AddLanguage nl .nl + AddLanguage en .en + AddLanguage et .ee + AddLanguage fr .fr + AddLanguage de .de + AddLanguage el .el + AddLanguage he .he + AddCharset ISO-8859-8 .iso8859-8 + AddLanguage it .it + AddLanguage ja .ja + AddCharset ISO-2022-JP .jis + AddLanguage kr .kr + AddCharset ISO-2022-KR .iso-kr + AddLanguage no .no + AddLanguage pl .po + AddCharset ISO-8859-2 .iso-pl + AddLanguage pt .pt + AddLanguage pt-br .pt-br + AddLanguage ltz .lu + AddLanguage ca .ca + AddLanguage es .es + AddLanguage sv .se + AddLanguage cz .cz + AddLanguage ru .ru + AddLanguage tw .tw + AddCharset Big5 .Big5 .big5 + AddCharset WINDOWS-1251 .cp-1251 + AddCharset CP866 .cp866 + AddCharset ISO-8859-5 .iso-ru + AddCharset KOI8-R .koi8-r + AddCharset UCS-2 .ucs2 + AddCharset UCS-4 .ucs4 + AddCharset UTF-8 .utf8 + + + AddHandler type-map .var + LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW + ForceLanguagePriority Prefer Fallback + + + MIMEMagicFile @l_prefix@/etc/apache/mime.magic + + +# SSL/TLS support + + SSLRandomSeed startup builtin + SSLRandomSeed connect builtin + SSLMutex sem + SSLCADNRequestFile @l_prefix@/etc/x509/public-ca.crt.pem + SSLCACertificateFile @l_prefix@/etc/x509/public-ca.crt.pem + SSLSessionCache shm:@l_prefix@/var/apache/run/apache.ssl_scache(512000) + SSLSessionCacheTimeout 300 + SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL + + SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + AddType application/x-x509-ca-cert .crt + AddType application/x-pkcs7-crl .crl + + +# DAV support + + DavLockDB @l_prefix@/var/apache/run/apache.dav/lock + BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully + BrowserMatch "MS FrontPage" redirect-carefully + BrowserMatch "^WebDrive" redirect-carefully + BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully + BrowserMatch "^gnome-vfs/1.0" redirect-carefully + BrowserMatch "^XML Spy" redirect-carefully + BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully + + +# Cache support + + CacheRoot @l_prefix@/var/apache/run/apache.cache + CacheMaxFileSize 1000000 + CacheMinFileSize 1 + CacheDirLength 2 + CacheDirLevels 3 + + +# Compression support + + DeflateCompressionLevel 1 + DeflateMemLevel 9 + DeflateWindowSize 15 + DeflateBufferSize 8096 + DeflateFilterNote Ratio deflate_ratio + AddOutputFilterByType DEFLATE text/plain text/html text/xml application/javascript application/json text/css + + diff -r 5a93a7863039 -r f805be991d7f apache/apache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/apache.conf Mon Sep 17 19:01:16 2012 +0200 @@ -0,0 +1,72 @@ +## +## apache.conf -- Apache Custom Configuration +## + +# include Apache default/base configuration +Include "@l_prefix@/etc/apache/apache.base" + +# include Apache add-on configurations +# (mainly provided by other packages) +Include "@l_prefix@/etc/apache/apache.d/*.conf" + +Listen 127.0.0.1:80 +NameVirtualHost 127.0.0.1:80 + + +Listen 127.0.0.1:443 + + + + ServerName @l_hostname@.@l_domainname@ + ServerAlias localhost.@l_domainname@ + ServerAdmin root@localhost.@l_domainname@ + ServerSignature on + + DocumentRoot @l_prefix@/share/apache/htdocs + + Options Indexes FollowSymLinks MultiViews + AllowOverride none + Order allow,deny + Allow from all + + + ScriptAlias /cgi-bin @l_prefix@/cgi + + Options Indexes FollowSymLinks MultiViews ExecCGI + AllowOverride None + Order allow,deny + Allow from all + + + + + + ServerName @l_hostname@.@l_domainname@ + ServerAlias localhost.@l_domainname@ + ServerAdmin root@localhost.@l_domainname@ + ServerSignature on + + DocumentRoot @l_prefix@/share/apache/htdocs + + Options Indexes FollowSymLinks MultiViews + AllowOverride none + Order allow,deny + Allow from all + + + ScriptAlias /cgi-bin @l_prefix@/cgi + + Options Indexes FollowSymLinks MultiViews ExecCGI + AllowOverride None + Order allow,deny + Allow from all + + + SSLEngine on + SSLCADNRequestFile @l_prefix@/etc/x509/example-ca.crt.pem + SSLCACertificateFile @l_prefix@/etc/x509/example-ca.crt.pem + SSLCertificateFile @l_prefix@/etc/x509/example-server.crt.pem + SSLCertificateKeyFile @l_prefix@/etc/x509/example-server.key.pem + + + diff -r 5a93a7863039 -r f805be991d7f apache/apache.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/apache.patch Mon Sep 17 19:01:16 2012 +0200 @@ -0,0 +1,338 @@ +Index: build/config_vars.sh.in +--- build/config_vars.sh.in.orig 2008-02-05 00:00:07.000000000 +0100 ++++ build/config_vars.sh.in 2011-05-11 20:35:42.000000000 +0200 +@@ -35,7 +35,7 @@ + APU_CONFIG=@APU_CONFIG@ + fi + +-APR_LIBTOOL="`${APR_CONFIG} --apr-libtool`" ++APR_LIBTOOL="@prefix@/share/apache/build/libtool" + APR_INCLUDEDIR="`${APR_CONFIG} --includedir`" + APU_INCLUDEDIR="`${APU_CONFIG} --includedir`" + +Index: config.layout +--- config.layout.orig 2004-11-21 19:50:36.000000000 +0100 ++++ config.layout 2011-05-11 20:35:42.000000000 +0200 +@@ -50,7 +50,7 @@ + iconsdir: ${datadir}/icons + htdocsdir: ${datadir}/htdocs + manualdir: ${datadir}/manual +- cgidir: ${datadir}/cgi-bin ++ cgidir: ${exec_prefix}/cgi + includedir: ${prefix}/include+ + localstatedir: ${prefix}/var+ + runtimedir: ${localstatedir}/run +Index: configure +--- configure.orig 2011-05-08 08:52:50.000000000 +0200 ++++ configure 2011-05-11 20:35:43.000000000 +0200 +@@ -3605,6 +3605,11 @@ + { (exit 1); exit 1; }; } + fi + ++if test "x${USE_BUNDLED_APR}" != "x" ; then ++ apr_found=reconfig ++ apr_config=srclib/apr/apr-1-config ++fi ++ + if test "$apr_found" = "reconfig"; then + + # save our work to this point; this allows the sub-package to use it +@@ -3965,6 +3970,11 @@ + { (exit 1); exit 1; }; } + fi + ++if test "x${USE_BUNDLED_APR}" != "x" ; then ++ apu_found=reconfig ++ apu_config=srclib/apr-util/apu-1-config ++fi ++ + # Catch some misconfigurations: + case ${apr_found}.${apu_found} in + reconfig.yes) +Index: docs/conf/mime.types +--- docs/conf/mime.types.orig 2011-05-03 22:13:58.000000000 +0200 ++++ docs/conf/mime.types 2011-05-11 20:37:13.000000000 +0200 +@@ -119,6 +119,7 @@ + # application/media_control+xml + application/mediaservercontrol+xml mscml + application/metalink4+xml meta4 ++application/metalink+xml metalink + application/mets+xml mets + # application/mikey + application/mods+xml mods +Index: docs/docroot/index.html +--- docs/docroot/index.html.orig 2004-11-20 21:16:24.000000000 +0100 ++++ docs/docroot/index.html 2011-05-11 20:35:43.000000000 +0200 +@@ -1 +1,7 @@ +-

It works!

+\ No newline at end of file ++ ++ ++

It works!

++ It works! Your OpenPKG based Apache HTTP server was successfully installed and started.
++ You now have to read the documentation and configure it according to your local demands. ++ ++ +Index: modules/generators/mod_autoindex.c +--- modules/generators/mod_autoindex.c.orig 2011-02-10 16:24:20.000000000 +0100 ++++ modules/generators/mod_autoindex.c 2011-05-11 20:35:43.000000000 +0200 +@@ -1574,17 +1574,17 @@ + + ++cols; + } +- ap_rputs("", r); ++ ap_rputs("", r); + emit_link(r, "Name", K_NAME, keyid, direction, + colargs, static_columns); + if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { +- ap_rputs("", r); ++ ap_rputs("", r); + emit_link(r, "Last modified", K_LAST_MOD, keyid, direction, + colargs, static_columns); + ++cols; + } + if (!(autoindex_opts & SUPPRESS_SIZE)) { +- ap_rputs("", r); ++ ap_rputs("", r); + emit_link(r, "Size", K_SIZE, keyid, direction, + colargs, static_columns); + ++cols; +@@ -1678,7 +1678,14 @@ + } + + if (autoindex_opts & TABLE_INDEXING) { +- ap_rputs("", r); ++ char *class; ++ if (strcmp(t2, "Parent Directory") == 0) ++ class = "updir"; ++ else if (ar[x]->isdir) ++ class = "dir"; ++ else ++ class = "file"; ++ ap_rvputs(r, "", NULL); + if (!(autoindex_opts & SUPPRESS_ICON)) { + ap_rputs("", r); + if (autoindex_opts & ICONS_ARE_LINKS) { +@@ -1763,9 +1770,6 @@ + desc_width), NULL); + } + } +- else { +- ap_rputs(" ", r); +- } + } + ap_rputs("\n", r); + } +Index: server/Makefile.in +--- server/Makefile.in.orig 2011-04-14 18:37:58.000000000 +0200 ++++ server/Makefile.in 2011-05-11 20:35:43.000000000 +0200 +@@ -56,7 +56,8 @@ + tmp=export_files_unsorted.txt; \ + rm -f $$tmp && touch $$tmp; \ + for dir in $(EXPORT_DIRS); do \ +- ls $$dir/*.h >> $$tmp; \ ++ abs_dir=`cd $$dir && exec pwd`; \ ++ ls $$abs_dir/*.h >> $$tmp; \ + done; \ + for dir in $(EXPORT_DIRS_APR); do \ + (ls $$dir/ap[ru].h $$dir/ap[ru]_*.h >> $$tmp 2>/dev/null); \ +Index: support/Makefile.in +--- support/Makefile.in.orig 2011-04-16 21:09:47.000000000 +0200 ++++ support/Makefile.in 2011-05-11 20:35:43.000000000 +0200 +@@ -22,12 +22,6 @@ + chmod 755 $(DESTDIR)$(sbindir)/$$i; \ + fi ; \ + done +- @if test -f "$(builddir)/envvars-std"; then \ +- cp -p envvars-std $(DESTDIR)$(sbindir); \ +- if test ! -f $(DESTDIR)$(sbindir)/envvars; then \ +- cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \ +- fi ; \ +- fi + + htpasswd_OBJECTS = htpasswd.lo + htpasswd: $(htpasswd_OBJECTS) +Index: support/apachectl.in +--- support/apachectl.in.orig 2006-07-12 05:38:44.000000000 +0200 ++++ support/apachectl.in 2011-05-11 20:35:43.000000000 +0200 +@@ -43,11 +43,6 @@ + # the path to your httpd binary, including options if necessary + HTTPD='@exp_sbindir@/@progname@' + # +-# pick up any necessary environment variables +-if test -f @exp_sbindir@/envvars; then +- . @exp_sbindir@/envvars +-fi +-# + # a command that outputs a formatted text version of the HTML at the + # url given on the command line. Designed for lynx, however other + # programs may work. +Index: support/apxs.in +--- support/apxs.in.orig 2010-05-10 22:02:56.000000000 +0200 ++++ support/apxs.in 2011-05-11 20:35:43.000000000 +0200 +@@ -80,6 +80,7 @@ + # the "+" metacharacter at the format string to allow a list to be built by + # subsequent occurrences of the same option. + sub Getopts { ++ no warnings 'deprecated'; + my ($argumentative, @ARGV) = @_; + my $errs = 0; + local $_; +@@ -189,9 +190,6 @@ + my $httpd = get_vars("sbindir") . "/" . get_vars("progname"); + $httpd = eval qq("$httpd"); + $httpd = eval qq("$httpd"); +-my $envvars = get_vars("sbindir") . "/envvars"; +-$envvars = eval qq("$envvars"); +-$envvars = eval qq("$envvars"); + + #allow apxs to be run from the source tree, before installation + if ($0 =~ m:support/apxs$:) { +@@ -203,7 +201,7 @@ + exit 1; + } + +-unless (grep /mod_so/, `. $envvars && $httpd -l`) { ++unless (grep /mod_so/, `$httpd -l`) { + error("Sorry, no shared object support for Apache"); + error("available under your platform. Make sure"); + error("the Apache module mod_so is compiled into"); +@@ -337,8 +335,7 @@ + exit(1); + } + +-my $libtool = `$apr_config --apr-libtool`; +-chomp($libtool); ++my $libtool = "$prefix/share/apache/build/libtool"; + + my $apr_includedir = `$apr_config --includes`; + chomp($apr_includedir); +Index: support/htdigest.c +--- support/htdigest.c.orig 2010-09-22 03:35:42.000000000 +0200 ++++ support/htdigest.c 2011-05-11 20:35:43.000000000 +0200 +@@ -119,7 +119,7 @@ + } + + +-static void add_password(const char *user, const char *realm, apr_file_t *f) ++static void add_password(const char *user, const char *realm, const char *pw0, apr_file_t *f) + { + char *pw; + apr_md5_ctx_t context; +@@ -130,6 +130,9 @@ + unsigned int i; + apr_size_t len = sizeof(pwin); + ++ if (pw0 != NULL) ++ pw = pw0; ++ else { + if (apr_password_get("New password: ", pwin, &len) != APR_SUCCESS) { + apr_file_printf(errfile, "password too long"); + cleanup_tempfile_and_exit(5); +@@ -141,6 +144,7 @@ + cleanup_tempfile_and_exit(1); + } + pw = pwin; ++ } + apr_file_printf(f, "%s:%s:", user, realm); + + /* Do MD5 stuff */ +@@ -161,7 +165,7 @@ + + static void usage(void) + { +- apr_file_printf(errfile, "Usage: htdigest [-c] passwordfile realm username\n"); ++ apr_file_printf(errfile, "Usage: htdigest [-c] passwordfile realm username [password]\n"); + apr_file_printf(errfile, "The -c flag creates a new file.\n"); + exit(1); + } +@@ -188,6 +192,8 @@ + char *dirname; + char user[MAX_STRING_LEN]; + char realm[MAX_STRING_LEN]; ++ char *password = NULL; ++ char passwordb[MAX_STRING_LEN]; + char line[3 * MAX_STRING_LEN]; + char l[3 * MAX_STRING_LEN]; + char w[MAX_STRING_LEN]; +@@ -209,9 +215,7 @@ + #endif + + apr_signal(SIGINT, (void (*)(int)) interrupted); +- if (argc == 5) { +- if (strcmp(argv[1], "-c")) +- usage(); ++ if ((argc == 5 || argc == 6) && strcmp(argv[1], "-c") == 0) { + rv = apr_file_open(&f, argv[2], APR_WRITE | APR_CREATE, + APR_OS_DEFAULT, cntxt); + if (rv != APR_SUCCESS) { +@@ -222,15 +226,19 @@ + apr_strerror(rv, errmsg, sizeof errmsg)); + exit(1); + } ++ if (argc == 6) { ++ apr_cpystrn(passwordb, argv[5], sizeof(passwordb)); ++ password = passwordb; ++ } + apr_cpystrn(user, argv[4], sizeof(user)); + apr_cpystrn(realm, argv[3], sizeof(realm)); + apr_file_printf(errfile, "Adding password for %s in realm %s.\n", + user, realm); +- add_password(user, realm, f); ++ add_password(user, realm, password, f); + apr_file_close(f); + exit(0); + } +- else if (argc != 4) ++ else if (argc != 4 && argc != 5) + usage(); + + if (apr_temp_dir_get((const char**)&dirname, cntxt) != APR_SUCCESS) { +@@ -253,6 +261,10 @@ + } + apr_cpystrn(user, argv[3], sizeof(user)); + apr_cpystrn(realm, argv[2], sizeof(realm)); ++ if (argc == 5) { ++ apr_cpystrn(passwordb, argv[4], sizeof(passwordb)); ++ password = passwordb; ++ } + + found = 0; + while (!(get_line(line, sizeof(line), f))) { +@@ -270,13 +282,13 @@ + else { + apr_file_printf(errfile, "Changing password for user %s in realm %s\n", + user, realm); +- add_password(user, realm, tfp); ++ add_password(user, realm, password, tfp); + found = 1; + } + } + if (!found) { + apr_file_printf(errfile, "Adding user %s in realm %s\n", user, realm); +- add_password(user, realm, tfp); ++ add_password(user, realm, password, tfp); + } + apr_file_close(f); + +Index: server/util_pcre.c +--- server/util_pcre.c.orig 2005-11-10 16:20:05.000000000 +0100 ++++ server/util_pcre.c 2012-02-05 21:25:24.000000000 +0100 +@@ -128,6 +128,7 @@ + const char *errorptr; + int erroffset; + int options = 0; ++int nsub = 0; + + if ((cflags & AP_REG_ICASE) != 0) options |= PCRE_CASELESS; + if ((cflags & AP_REG_NEWLINE) != 0) options |= PCRE_MULTILINE; +@@ -137,7 +138,8 @@ + + if (preg->re_pcre == NULL) return AP_REG_INVARG; + +-preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); ++pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT, &nsub); ++preg->re_nsub = (apr_size_t)nsub; + return 0; + } + diff -r 5a93a7863039 -r f805be991d7f apache/apache.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/apache.sh Mon Sep 17 19:01:16 2012 +0200 @@ -0,0 +1,11 @@ +## +## apache.sh -- Apache Shell Environment Script +## + +# +# Run-time paths +# + +export PATH="@l_path@" +export LD_LIBRARY_PATH="@l_ld_library_path@" + diff -r 5a93a7863039 -r f805be991d7f apache/apache.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/apache.spec Mon Sep 17 19:01:16 2012 +0200 @@ -0,0 +1,342 @@ +## +## apache.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2012 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: apache +Summary: Apache HTTP Server +URL: http://httpd.apache.org/ +Vendor: Apache Software Foundation +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: BASE +Group: Web +License: ASF +Version: 2.2.22 +Release: 20120205 + +# package options +%option with_mpm_prefork yes +%option with_mpm_worker no +%option with_mpm_event no +%option with_suexec yes +%option with_suexec_caller %{l_nusr} +%option with_suexec_userdir public_html +%option with_mod_deflate no +%option with_mod_ext_filter no +%option with_mod_substitute no +%option with_mod_ssl no +%option with_mod_dav no +%option with_mod_ldap no +%option with_mod_dbd no +%option with_mod_proxy no +%option with_mod_cache no +%option with_mod_diskcache no +%option with_mod_memcache no +%option with_mod_filecache no +%option with_mod_authn_alias no + +# fixing implicit inter-module dependencies and correlations +%if "%{with_mpm_prefork}" == "yes" +%undefine with_mpm_worker +%undefine with_mpm_event +%endif +%if "%{with_mpm_worker}" == "yes" +%undefine with_mpm_prefork +%undefine with_mpm_event +%endif +%if "%{with_mpm_event}" == "yes" +%undefine with_mpm_prefork +%undefine with_mpm_worker +%endif +%if "%{with_mod_memcache}" == "yes" || "%{with_mod_diskcache}" == "yes" +%undefine with_mod_cache +%define with_mod_cache yes +%endif + +# list of sources +Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 +Source1: rc.apache +Source2: apache.base +Source3: apache.conf +Source4: apache.sh +Patch0: apache.patch + +# build information +BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make +PreReq: OpenPKG, openpkg >= 20100101, perl +BuildPreReq: apr, pcre +PreReq: apr, pcre +%if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes" +BuildPreReq: apr::with_threads = yes +PreReq: apr::with_threads = yes +%endif +%if "%{with_mod_ldap}" == "yes" +BuildPreReq: apr::with_ldap = yes +PreReq: apr::with_ldap = yes +%endif +%if "%{with_mod_ssl}" == "yes" +BuildPreReq: openssl >= 0.9.8 +PreReq: openssl >= 0.9.8 +PreReq: x509 +%endif +%if "%{with_mod_deflate}" == "yes" +BuildPreReq: zlib +PreReq: zlib +%endif + +%description + The Apache Project is a collaborative software development effort + aimed at creating a robust, commercial-grade, featureful, and + freely-available source code implementation of an HTTP (Web) server. + The project is jointly managed by a group of volunteers located + around the world, using the Internet and the Web to communicate, + plan, and develop the server and its related documentation. These + volunteers are known as the Apache Group. In addition, hundreds + of users have contributed ideas, code, and documentation to the + project. + +%track + prog apache = { + version = %{version} + url = http://www.apache.org/dist/httpd/ + regex = httpd-(2\.\d*[02468]\.\d+)\.tar\.(bz2|gz) + } + +%prep + # unpack Apache distribution + %setup -q -n httpd-%{version} + %patch -p0 + %{l_shtool} subst \ + -e 's;(" PLATFORM ");(%{l_openpkg_release -F "OpenPKG/%%t"});g' \ + server/core.c + +%build + # configure package + ( echo "ac_cv_func_uuid_create=no" + ) >config.cache + export CC="%{l_cc}" + export CFLAGS="%{l_cflags -O}" + export CPPFLAGS="%{l_cppflags}" + export LDFLAGS="%{l_ldflags}" + export LIBS="" + case "%{l_platform -t}" in + *-sunos* ) LIBS="$LIBS -lrt" ;; + esac +%if "%{with_mod_ldap}" == "yes" + LIBS="$LIBS -lssl -lcrypto" +%endif + ./configure \ + --cache-file=./config.cache \ + --enable-layout=GNU \ + --prefix=%{l_prefix} \ + --with-program-name=apache \ + --sysconfdir=%{l_prefix}/etc/apache \ + --libexecdir=%{l_prefix}/libexec/apache \ + --includedir=%{l_prefix}/include/apache \ + --datadir=%{l_prefix}/share/apache \ + --localstatedir=%{l_prefix}/var/apache \ + --with-apr=%{l_prefix}/bin/apr-1-config \ + --with-apr-util=%{l_prefix}/bin/apu-1-config \ + --with-pcre=%{l_prefix} \ +%if "%{with_mpm_prefork}" == "yes" + --with-mpm="prefork" \ +%endif +%if "%{with_mpm_worker}" == "yes" + --with-mpm="worker" \ +%endif +%if "%{with_mpm_event}" == "yes" + --with-mpm="event" \ +%endif +%if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes" + --enable-threads \ +%else + --disable-threads \ +%endif +%if "%{with_suexec}" == "yes" + --enable-suexec \ + --with-suexec-bin=%{l_prefix}/sbin/suexec \ + --with-suexec-caller=%{with_suexec_caller} \ + --with-suexec-userdir=%{with_suexec_userdir} \ + --with-suexec-logfile=%{l_prefix}/var/apache/log/suexec.log \ +%endif +%if "%{with_mod_deflate}" == "yes" + --enable-deflate \ + --with-z=%{l_prefix} \ +%endif +%if "%{with_mod_ext_filter}" == "yes" + --enable-ext-filter \ +%endif +%if "%{with_mod_substitute}" == "yes" + --enable-substitute \ +%endif +%if "%{with_mod_ssl}" == "yes" + --enable-ssl \ + --with-ssl=%{l_prefix} \ +%endif +%if "%{with_mod_dav}" == "yes" + --enable-dav \ + --enable-dav-fs \ + --enable-dav-lock \ +%endif +%if "%{with_mod_ldap}" == "yes" + --enable-ldap \ + --enable-authnz-ldap \ +%endif +%if "%{with_mod_dbd}" == "yes" + --enable-dbd \ + --enable-authn-dbd \ +%endif +%if "%{with_mod_proxy}" == "yes" + --enable-proxy \ + --enable-proxy-connect \ + --enable-proxy-http \ + --enable-proxy-ftp \ + --enable-proxy-ajp \ + --enable-proxy-balancer \ +%endif +%if "%{with_mod_cache}" == "yes" + --enable-cache \ +%if "%{with_mod_diskcache}" == "yes" + --enable-disk-cache \ +%endif +%if "%{with_mod_memcache}" == "yes" + --enable-mem-cache \ +%endif +%endif +%if "%{with_mod_filecache}" == "yes" + --enable-file-cache \ +%endif +%if "%{with_mod_authn_alias}" == "yes" + --enable-authn-alias \ +%endif + --enable-filter \ + --enable-reqtimeout \ + --enable-usertrack \ + --enable-expires \ + --enable-so \ + --enable-speling \ + --enable-rewrite \ + --enable-headers \ + --enable-info \ + --enable-mime-magic \ + --enable-vhost-alias \ + --enable-auth-digest \ + --enable-auth-dbm \ + --enable-authz-dbm \ + --enable-authz-owner \ + --enable-unique-id \ + --enable-logio \ + --disable-shared + + # build package + %{l_make} %{l_mflags} + +%install + # install package + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT + + # create additional directories + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \ + $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.dav \ + $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.cache + + # adjust GNU libtool configuration for apxs(1) runtime + %{l_shtool} install -c -m 755 \ + -e 's;^build_libtool_libs=no;build_libtool_libs=yes;' \ + %{l_prefix}/share/apr/build-1/libtool \ + $RPM_BUILD_ROOT%{l_prefix}/share/apache/build/libtool + + # install shell environment script + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + -e 's;@l_path@;%{l_build_path};' \ + -e 's;@l_ld_library_path@;%{l_build_ldlp};' \ + %{SOURCE apache.sh} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ + + # create default configuration + l_hostname=`%{l_shtool} echo -e %h` + l_domainname=`%{l_shtool} echo -e %d | cut -c2-` + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + -e "s;@l_hostname@;$l_hostname;g" \ + -e "s;@l_domainname@;$l_domainname;g" \ + %{SOURCE apache.base} \ + %{SOURCE apache.conf} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ + mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic \ + $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic + + # install run-command script + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + -e 's;@with_mod_filecache@;%{with_mod_filecache};g' \ + %{SOURCE rc.apache} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # strip down installation + find $RPM_BUILD_ROOT%{l_prefix}/share/apache -name "*.orig" -print | xargs rm -f + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/apache_pb* + rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/{extra,original} + rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/apache + rm -f $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true + ( cd $RPM_BUILD_ROOT%{l_prefix}/share/apache/manual + find . -name "*.xml" -print | xargs rm -f + find . -name "*.xml.*" -print | xargs rm -f + find . -name "*.xsl" -print | xargs rm -f + rm -rf style/xsl + rm -rf style/latex + ) || exit $? + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ +%if "%{with_suexec}" == "yes" + '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \ +%endif + '%config %{l_prefix}/etc/apache/*' \ + '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \ + '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.dav' \ + '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.cache' + +%files -f files + +%clean + +%post + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} apache status 2>/dev/null` + [ ".$apache_active" = .yes ] && %{l_rc} apache restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} apache stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/apache/log/* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/apache/run/*/* >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/var/apache/run/* >/dev/null 2>&1 || true + exit 0 + diff -r 5a93a7863039 -r f805be991d7f apache/rc.apache --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/apache/rc.apache Mon Sep 17 19:01:16 2012 +0200 @@ -0,0 +1,101 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.apache -- Run-Commands +## + +%config + apache_enable="$openpkg_rc_def" + apache_flags="" + apache_log_files="@l_prefix@/var/apache/log/access.log" + apache_log_rotsteps="10" + apache_log_rotminsize="10M" + apache_log_rotcomplevel="9" + apache_log_rotprolog="true" + apache_log_rotepilog="true" + apache_err_files="@l_prefix@/var/apache/log/error.log" + apache_err_rotsteps="10" + apache_err_rotminsize="1M" + apache_err_rotcomplevel="9" + apache_err_rotprolog="true" + apache_err_rotepilog="true" + apache_cgi_files="@l_prefix@/var/apache/log/script.log" + apache_cgi_rotsteps="10" + apache_cgi_rotminsize="1M" + apache_cgi_rotcomplevel="9" + apache_cgi_rotprolog="true" + apache_cgi_rotepilog="true" + apache_cachesize="10M" + +%common + apache_pidfile="@l_prefix@/var/apache/run/apache.pid" + apache_cachedir="@l_prefix@/var/apache/run/apache.cache" + apache_signal () { + [ -f $apache_pidfile ] && kill -$1 `cat $apache_pidfile` + } + +%status -u @l_susr@ -o + apache_usable="no" + apache_active="no" + @l_prefix@/sbin/apache -t 2>/dev/null && apache_usable="yes" + rcService apache enable yes && \ + apache_signal 0 && apache_active="yes" + echo "apache_enable=\"$apache_enable\"" + echo "apache_usable=\"$apache_usable\"" + echo "apache_active=\"$apache_active\"" + +%start -u @l_susr@ + rcService apache enable yes || exit 0 + rcService apache active yes && exit 0 + ( cd @l_prefix@/var/apache/run + [ -e @l_prefix@/etc/apache/apache.sh ] && + . @l_prefix@/etc/apache/apache.sh + @l_prefix@/sbin/apache ${apache_flags} + ) || exit $? + +%stop -u @l_susr@ + rcService apache enable yes || exit 0 + rcService apache active no && exit 0 + @l_prefix@/sbin/apache -k stop + sleep 2 + +%restart -u @l_susr@ + rcService apache enable yes || exit 0 + rcService apache active no && exit 0 + rc apache stop start + +%reload -u @l_susr@ + rcService apache enable yes || exit 0 + rcService apache active no && exit 0 + @l_prefix@/sbin/apache -k graceful + +%daily -u @l_susr@ + rcService apache enable yes || exit 0 + rcTmp -i + hintfile=`rcTmp -f -n hint` + shtool rotate -f \ + -n ${apache_log_rotsteps} -s ${apache_log_rotminsize} -d \ + -z ${apache_log_rotcomplevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ + -P "$apache_log_rotprolog" \ + -E "$apache_log_rotepilog; echo 1 >$hintfile" \ + ${apache_log_files} + shtool rotate -f \ + -n ${apache_err_rotsteps} -s ${apache_err_rotminsize} -d \ + -z ${apache_err_rotcomplevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ + -P "$apache_err_rotprolog" \ + -E "$apache_err_rotepilog; echo 1 >$hintfile" \ + ${apache_err_files} + shtool rotate -f \ + -n ${apache_cgi_rotsteps} -s ${apache_cgi_rotminsize} -d \ + -z ${apache_cgi_rotcomplevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ + -P "$apache_cgi_rotprolog" \ + -E "$apache_cgi_rotepilog; echo 1 >$hintfile" \ + ${apache_cgi_files} + if [ ".@with_mod_filecache@" = .yes ]; then + @l_prefix@/sbin/htcacheclean \ + -n -t -l "$apache_cachesize" -p "$apache_cachedir" + fi + if [ -s $hintfile ]; then + @l_prefix@/sbin/apache -k graceful + fi + rcTmp -k +