# Nice caching..
ExpiresActive On
- ExpiresDefault "access plus 1 day"
- ExpiresByType image/gif "modification plus 1 year"
- ExpiresByType image/jpeg "modification plus 1 year"
- ExpiresByType image/png "modification plus 1 year"
+ ExpiresDefault "access plus 1 year"
# language stuff
# you need to keep this in sync with lib/Packages/I18N/Locale.pm
ErrorLog /var/log/apache2/%SITE%-error.log
CustomLog /var/log/apache2/%SITE%-access.log combined
- Alias /cgi-bin/ %TOPDIR%/cgi-bin/
+ ScriptAlias /cgi-bin/ %TOPDIR%/cgi-bin/
PerlModule ModPerl::Registry
PerlTaintCheck On
- PerlRequire %TOPDIR%/bin/mod_perl-startup
+# PerlRequire %TOPDIR%/bin/mod_perl-startup
PerlSwitches -T
<Location /cgi-bin/>
- SetHandler perl-script
- PerlInitHandler Apache2::Reload
- PerlHandler ModPerl::Registry
+# SetHandler perl-script
+# PerlInitHandler Apache2::Reload
+# PerlHandler ModPerl::Registry
Options +ExecCGI
- PerlSendHeader On
+# PerlSendHeader On
allow from all
</Location>
RewriteRule ^/robots.txt$ - [L]
# RewriteRule ^/$ http://www.debian.org/distrib/packages
- RewriteRule ^/$ /index.html [L]
+ RewriteRule ^/$ /index [L]
RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
RewriteRule ^/changelog:(.+)$ /changelogs/${changelog-url:$1} [R,L,NE]
RewriteRule ^/src:([^/]+)$ /search?searchon=sourcenames&keywords=$1 [R,L,NE]
RewriteRule ^/file:(.+)$ /search?searchon=contents&keywords=$1 [R,L,NE]
- RewriteCond %{QUERY_STRING} ^$ [OR]
- RewriteCond %{REQUEST_URI} !^/search$
- RewriteCond %{REQUEST_URI} !^/cgi-bin/search_(contents|packages)\.pl$
- RewriteRule ^/([^/]+)$ /search?keywords=$1 [R,L,NE]
-
+
RewriteCond %{QUERY_STRING} =""
RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -f [OR]
RewriteCond %TOPDIR%/www%{REQUEST_FILENAME}.en.html -f [OR]
RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -l
RewriteRule . - [L]
+ RewriteCond %{QUERY_STRING} ^$ [OR]
+ RewriteCond %{REQUEST_URI} !^/search$
+ RewriteCond %{REQUEST_URI} !^/cgi-bin/search_(contents|packages)\.pl$
+ RewriteRule ^/([^/]+)$ /search?keywords=$1 [R,L,NE]
+
RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [L,PT]
# In case we need to disable the site again
use Packages::CGI;
our @ISA = qw( Exporter );
- our @EXPORT = qw( do_index do_allpackages );
+ our @EXPORT = qw( do_homepage do_index do_allpackages );
+
+ sub do_homepage {
+ $_[1]->{suite} = [];
+ return send_file( 'index', @_ );
+ }
sub do_index {
return send_file( 'index', @_ );
my $wwwdir = "$TOPDIR/www";
my $path = "";
$path .= "source/" if $opts->{source};
- $path .= "$opts->{suite}[0]/";
+ $path .= "$opts->{suite}[0]/" if @{$opts->{suite}};
$path .= "$opts->{archive}[0]/" if @{$opts->{archive}} == 1;
$path .= "$opts->{subsection}[0]/" if @{$opts->{subsection}};
$path .= "$opts->{priority}[0]/" if @{$opts->{priority}};
$headers{'-content-length'} = $size;
$headers{'-vary'} = 'negotiate,accept-language';
$headers{'-last-modified'} = strftime("%a, %d %b %Y %T %z", localtime($mtime));
- $headers{'-expires'} = strftime("%a, %d %b %Y %T %z", localtime($mtime+(12*3600)));
+ $headers{'-expires'} = strftime("%a, %d %b %Y %T %z", localtime($mtime+(365*24*3600)));
print header( %headers );
binmode INDEX;
--- /dev/null
- all_suites = [ 'etch', 'etch-m68k', 'etch-volatile', 'etch-backports',
- 'lenny', 'lenny-volatile', 'lenny-backports', 'squeeze', 'sid' ]
- version_numbers = { sarge => '3.1',
- etch => '4.0',
- lenny => '5.0' }
- current_release = 'lenny'
+ [%- PROCESS 'html/head.tmpl'
+ title_tag = g('%s Packages Search', organisation)
+ page_title = g('%s Packages Search', organisation)
+ keywords = g('Packages')
+ -%]
+ [%-
- all_architectures = [ 'alpha', 'arm', 'armel', 'amd64', 'avr32', 'hppa', 'i386',
- 'ia64', 'kfreebsd-amd64', 'kfreebsd-i386', 'mips',
- 'mipsel', 'm68k', 'powerpc', 's390', 'sparc' ]
++ all_suites = [ 'bo', 'hamm', 'slink', 'potato', 'woody', 'sarge' ]
++ version_numbers = { sarge => '3.1',
++ woody => '3.0',
++ potato => '2.2',
++ slink => '2.1',
++ hamm => '2.0',
++ bo => '1.3.1'}
++ current_release = 'sarge'
+ all_sections = [ 'main', 'contrib', 'non-free' ]
++ all_architectures = [ 'alpha', 'arm', 'hppa', 'i386', 'ia64',
++ 'mips', 'mipsel', 'powerpc', 's390', 'sparc' ]
+ -%]
+
+ <p>[% g('This site provides you with information about all the packages available in the <a href="%s">%s</a> Package archive.', project_homepage, organisation) %]</p>
+
+ <p><em>[% g('Please contact <a href="mailto:%s">%s</a> if you encounter any problems!', admin.mail, admin.name) %]</em></p>
+
+ <h2>[% g('Browse through the lists of packages:') %]</h2>
+
+ <ul style="font-size:large">
+ [% FOREACH s IN all_suites %]
+ <li><a href="[% s %]/">[% s %]</a>
+ [% IF version_numbers.$s %]([% version_numbers.$s %])[% END %]</li>
+ [% END %]
+ </ul>
+
+ <p>[% g('There is also a list of <a href="%s/main/newpkg">packages recently added to %s</a>.', all_suites.-1, all_suites.-1) %]</p>
+
+ <p>[% g('Old releases can be found at <a href="%s">%s</a>.', old_releases, old_releases) %]</p>
+
+ <h2>[% g('Search') %]</h2>
+
+ <h3>[% g('Search package directories') %]</h3>
+
+ <form method="GET" action="/search">
+ <label for="kw">[% g('Keyword:') %]</label>
+ <input type="text" size="30" name="keywords" id="kw">
+ <input type="submit" value="[% g('Search') %]"> <input type="reset" value="[% g('Reset') %]">
+ <br>
+ [% g('Search on:') %]
+ <input type="radio" name="searchon" value="names" id="onlynames" checked="checked">
+ <label for="onlynames">[% g('Package names only') %]</label>
+ <input type="radio" name="searchon" value="all" id="descs">
+ <label for="descs">[% g('Descriptions') %]</label>
+ <input type="radio" name="searchon" value="sourcenames" id="src">
+ <label for="src">[% g('Source package names') %]</label>
+ <br>
+ [% g('Only show exact matches:') %]
+ <input type="checkbox" name="exact" value="1">
+ <br>
+ Distribution:
+ <select name="suite">
+ [% FOREACH s IN all_suites %]
+ <option value="[% s %]" [% 'selected="selected"' IF s == current_release %]>[% s %]</option>
+ [% END %]
+ <option value="all">[% g('any') %]</option>
+ </select>
+ [% g('Section:') %]
+ <select name="section">
+ [% FOREACH s IN all_sections %]
+ <option value="[% s %]">[% s %]</option>
+ [% END %]
+ <option value="all" selected="selected">[% g('any') %]</option>
+ </select>
+ </form>
+ <p>[% g('There are shortcuts for some searches available:') %]</p>
+ <ul>
+ <li>[% g('<code>%s<var>name</var></code> for the search on package names.', packages_homepage_abs) %]</li>
+
+ <li>[% g('<code>%ssrc:<var>name</var></code> for the search on source package names.', packages_homepage_abs) %]</li>
+ </ul>
+ <hr>
+
+ <h3><a name="search_contents">[% g('Search the contents of packages') %]</a></h3>
+
+ <p>[% g('This search engine allows you to search the contents of %s distributions for any files (or just parts of file names) that are part of packages. You can also get a full list of files in a given package.', organisation) %]<br>
+ <form method="GET" action="/search">
+ <input type="hidden" name="searchon" value="contents">
+
+ <label for="keyword">[% g('Keyword:') %]</label>
+ <input type="text" size="30" name="keywords" id="keyword">
+
+ <input type="submit" value="[% g('Search') %]">
+ <input type="reset" value="[% g('Reset') %]">
+ <br>
+ [% g('Display:') %]
+ <br>
+ <input type="radio" name="mode" value="exactfilename" id="exactfilename" checked="checked">
+ <label for="exactfilename">[% g('packages that contain files named like this') %]</label>
+ <br>
+ <input type="radio" name="mode" value="" id="suffixpathname">
+ <label for="suffixpathname">[% g('packages that contain files whose names end with the keyword') %]</label>
+ <br>
+ <input type="radio" name="mode" value="filename" id="filename">
+ <label for="filename">[% g('packages that contain files whose names contain the keyword') %]</label>
+ <br>
+ <label for="distro">[% g('Distribution:') %]</label>
+
+ <select name="suite" id="distro">
+ [% FOREACH s IN all_suites %]
+ <option value="[% s %]" [% 'selected="selected"' IF s == current_release %]>[% s %]</option>
+ [% END %]
+ </select>
+ <label for="architecture">[% g('Architecture:') %]</label>
+ <select name="arch" id="architecture">
+ [% FOREACH a IN all_architectures %]
+ <option value="[% a %]">[% a %]</option>
+ [% END %]
+ <option value="any" selected="selected">[% g('any') %]</option>
+ </select>
+ </form>
+
+ [% PROCESS 'html/foot.tmpl' page_name=packages_homepage copyright.years = '1997 - 2009' %]