GIT_PYTHON_DIR = $(prefix)/share/git-core/python
# DESTDIR=
+# default configuration for gitweb
+GITWEB_SITENAME =
+GITWEB_PROJECTROOT = /pub/git
+GITWEB_LIST =
+GITWEB_HOMETEXT = indextext.html
+GITWEB_CSS = gitweb.css
+
export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR
CC = gcc
export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
### Build rules
-all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk
+all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
all:
$(MAKE) -C templates
cp $< $@+
mv $@+ $@
+gitweb/gitweb.cgi: gitweb/gitweb.perl
+ rm -f $@ $@+
+ sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
+ -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \
+ -e 's|@@GIT_BINDIR@@|$(bindir)|g' \
+ -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \
+ -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \
+ -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \
+ -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \
+ -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \
+ $< >$@+
+ chmod +x $@+
+ mv $@+ $@
+
git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
rm -f $@ $@+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
- $@.sh | sed "s|/usr/bin/git|$(bindir)/git|" > $@+
+ $@.sh > $@+
chmod +x $@+
mv $@+ $@
From the git version 1.4.0 gitweb is bundled with git.
+
+How to configure gitweb for your local system:
+
+You can specify the following configuration variables when building GIT:
+ * GITWEB_SITENAME
+ Shown in the title of all generated pages, defaults to the servers name.
+ * GITWEB_PROJECTROOT
+ The root directory for all projects shown by gitweb.
+ * GITWEB_LIST
+ points to a directory to scan for projects (defaults to project root)
+ or to a file for explicit listing of projects.
+ * GITWEB_HOMETEXT
+ points to an .html file which is included on the gitweb project
+ overview page.
+ * GITWEB_CSS
+ Points to the location where you put gitweb.css on your web server.
+
Any comment/question/concern to:
Kay Sievers <kay.sievers@vrfy.org>
binmode STDOUT, ':utf8';
our $cgi = new CGI;
-our $version = "267";
+our $version = "@@GIT_VERSION@@";
our $my_url = $cgi->url();
our $my_uri = $cgi->url(-absolute => 1);
our $rss_link = "";
# core git executable to use
# this can just be "git" if your webserver has a sensible PATH
-our $GIT = "/usr/bin/git";
+our $GIT = "@@GIT_BINDIR@@/git";
# absolute fs-path which will be prepended to the project path
#our $projectroot = "/pub/scm";
-our $projectroot = "/home/kay/public_html/pub/scm";
+our $projectroot = "@@GITWEB_PROJECTROOT@@";
# version of the core git binary
our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
# name of your site or organization to appear in page titles
# replace this with something more descriptive for clearer bookmarks
-our $site_name = $ENV{'SERVER_NAME'} || "Untitled";
+our $site_name = "@@GITWEB_SITENAME@@" || $ENV{'SERVER_NAME'} || "Untitled";
# html text to include at home page
-our $home_text = "indextext.html";
+our $home_text = "@@GITWEB_HOMETEXT@@";
# URI of default stylesheet
-our $stylesheet = "gitweb.css";
+our $stylesheet = "@@GITWEB_CSS@@";
# source of projects list
-#our $projects_list = $projectroot;
-our $projects_list = "index/index.aux";
+our $projects_list = "@@GITWEB_LIST@@" || "$projectroot";
# default blob_plain mimetype and default charset for text/plain blob
our $default_blob_plain_mimetype = 'text/plain';