tag 497809 + patch thanks Le Tue, Oct 13, 2009 at 06:00:09PM +0000, Gerrit Pape a écrit : > On Wed, Mar 11, 2009 at 02:35:04PM +0900, Charles Plessy wrote: > > Dear Gerrit, > > > > I can prepare a patch to your package if you are interested, optionally with > > Hi Charles, that would be nice, thanks. You can get the Debian package > sources through > git clone http://smarden.org/git/git.git/ > commit to the debian-sid branch, use format-patch and send the patch to > this report.
Dear Gerrit, here is the patch. Have a nice day, -- Charles Plessy Tsurumi, Kanagawa, Japan
>From d0c4c933c99c85606e40cd434bddd1c44f1aeb75 Mon Sep 17 00:00:00 2001 From: Charles Plessy <[email protected]> Date: Mon, 25 Jan 2010 20:50:36 +0900 Subject: [PATCH] Make gitweb work out of the box with Apache (Closes: #497809). --- debian/gitweb.README.Debian | 4 ++++ debian/gitweb.apache2.conf | 6 ++++++ debian/gitweb.conf | 6 +++--- debian/gitweb.postinst | 24 ++++++++++++++++++++++++ debian/rules | 3 +++ 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 debian/gitweb.apache2.conf create mode 100644 debian/gitweb.postinst diff --git a/debian/gitweb.README.Debian b/debian/gitweb.README.Debian index 797fe09..82203ba 100644 --- a/debian/gitweb.README.Debian +++ b/debian/gitweb.README.Debian @@ -8,6 +8,10 @@ to the corresponding subdirectories in the repositories are just fine, e.g.: ln -s ~pape/git/foo/.git /var/cache/git/foo.git +On systems with an Apache webserver, gitweb is automatically made available at +http://localhost/gitweb. You can desactivate it by commenting out the first +line of /etc/apache2/conf.d/gitweb. + For more details about setting up gitweb for a git.example.org server, and on how to make the git-core tools such as git-clone work through http, see /usr/share/doc/git-core/README.Debian. diff --git a/debian/gitweb.apache2.conf b/debian/gitweb.apache2.conf new file mode 100644 index 0000000..e8eb07a --- /dev/null +++ b/debian/gitweb.apache2.conf @@ -0,0 +1,6 @@ +Alias /gitweb /usr/share/gitweb + +<Directory /usr/share/gitweb> + Options FollowSymLinks +ExecCGI + AddHandler cgi-script .cgi +</Directory> diff --git a/debian/gitweb.conf b/debian/gitweb.conf index b673301..8e2fb51 100644 --- a/debian/gitweb.conf +++ b/debian/gitweb.conf @@ -14,10 +14,10 @@ $home_text = "indextext.html"; $projects_list = $projectroot; # stylesheet to use -$stylesheet = "/gitweb.css"; +$stylesheet = "/gitweb/gitweb.css"; # logo to use -$logo = "/git-logo.png"; +$logo = "/gitweb/git-logo.png"; # the 'favicon' -$favicon = "/git-favicon.png"; +$favicon = "/gitweb/git-favicon.png"; diff --git a/debian/gitweb.postinst b/debian/gitweb.postinst new file mode 100644 index 0000000..b51381b --- /dev/null +++ b/debian/gitweb.postinst @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +case "$1" in + configure) + if [ -x /etc/init.d/apache2 ] + then + if which /usr/sbin/invoke-rc.d >/dev/null 2>&1 + then + invoke-rc.d apache2 reload || true + else + /etc/init.d/apache2 reload || true + fi + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac diff --git a/debian/rules b/debian/rules index ba6421e..79bd444 100755 --- a/debian/rules +++ b/debian/rules @@ -199,12 +199,15 @@ install-indep: build-arch-stamp build-indep-stamp install -d -m0755 '$(GIT)'web/usr/lib/cgi-bin install -m0755 gitweb/gitweb.cgi '$(GIT)'web/usr/lib/cgi-bin/gitweb.cgi install -d -m0755 '$(GIT)'web/usr/share/gitweb + ln -s /usr/lib/cgi-bin/gitweb.cgi '$(GIT)'web/usr/share/gitweb/index.cgi install -m0644 gitweb/gitweb.css '$(GIT)'web/usr/share/gitweb/gitweb.css install -m0644 gitweb/git-favicon.png \ '$(GIT)'web/usr/share/gitweb/git-favicon.png install -m0644 gitweb/git-logo.png '$(GIT)'web/usr/share/gitweb/git-logo.png install -d -m0755 '$(GIT)'web/etc install -m0644 debian/gitweb.conf '$(GIT)'web/etc/gitweb.conf + install -d -m0755 '$(GIT)'web/etc/apache2/conf.d + install -m0644 debian/gitweb.apache2.conf '$(GIT)'web/etc/apache2/conf.d/gitweb install -d -m0755 '$(GIT)'web/var/cache/git/ # upstream changelog test -r changelog || ln -s debian/changelog.upstream changelog -- 1.6.6

