Browse Source

Merge branch 'jn/gitweb-install'

* jn/gitweb-install:
  gitweb: Create install target for gitweb in Makefile
  gitweb: Improve installation instructions in gitweb/INSTALL
maint
Junio C Hamano 15 years ago
parent
commit
14b8512f87
  1. 3
      Makefile
  2. 18
      gitweb/INSTALL
  3. 32
      gitweb/Makefile

3
Makefile

@ -2016,6 +2016,9 @@ endif
done; } && \ done; } && \
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X" ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"


install-gitweb:
$(MAKE) -C gitweb install

install-doc: install-doc:
$(MAKE) -C Documentation install $(MAKE) -C Documentation install



18
gitweb/INSTALL

@ -6,8 +6,8 @@ First you have to generate gitweb.cgi from gitweb.perl using
gitweb.css, git-logo.png and git-favicon.png) to their destination. gitweb.css, git-logo.png and git-favicon.png) to their destination.
For example if git was (or is) installed with /usr prefix, you can do For example if git was (or is) installed with /usr prefix, you can do


$ make prefix=/usr gitweb ;# as yourself $ make prefix=/usr gitweb ;# as yourself
# cp gitweb/git* /var/www/cgi-bin/ ;# as root # make gitwebdir=/var/www/cgi-bin install-gitweb ;# as root


Alternatively you can use autoconf generated ./configure script to Alternatively you can use autoconf generated ./configure script to
set up path to git binaries (via config.mak.autogen), so you can write set up path to git binaries (via config.mak.autogen), so you can write
@ -16,7 +16,8 @@ instead
$ make configure ;# as yourself $ make configure ;# as yourself
$ ./configure --prefix=/usr ;# as yourself $ ./configure --prefix=/usr ;# as yourself
$ make gitweb ;# as yourself $ make gitweb ;# as yourself
# cp gitweb/git* /var/www/cgi-bin/ ;# as root # make gitwebdir=/var/www/cgi-bin \
install-gitweb ;# as root


The above example assumes that your web server is configured to run The above example assumes that your web server is configured to run
[executable] files in /var/www/cgi-bin/ as server scripts (as CGI [executable] files in /var/www/cgi-bin/ as server scripts (as CGI
@ -74,9 +75,10 @@ file for gitweb (in gitweb/README).
Build example Build example
~~~~~~~~~~~~~ ~~~~~~~~~~~~~


- To install gitweb to /var/www/cgi-bin/gitweb/ when git wrapper - To install gitweb to /var/www/cgi-bin/gitweb/, when git wrapper
is installed at /usr/local/bin/git and the repositories (projects) is installed at /usr/local/bin/git, the repositories (projects)
we want to display are under /home/local/scm, you can do we want to display are under /home/local/scm, and you do not use
minifiers, you can do


make GITWEB_PROJECTROOT="/home/local/scm" \ make GITWEB_PROJECTROOT="/home/local/scm" \
GITWEB_JS="/gitweb/gitweb.js" \ GITWEB_JS="/gitweb/gitweb.js" \
@ -86,8 +88,8 @@ Build example
bindir=/usr/local/bin \ bindir=/usr/local/bin \
gitweb gitweb


cp -fv ~/git/gitweb/gitweb.{cgi,js,css} \ cp -fv gitweb/gitweb.{cgi,js,css} \
~/git/gitweb/git-{favicon,logo}.png \ gitweb/git-{favicon,logo}.png \
/var/www/cgi-bin/gitweb/ /var/www/cgi-bin/gitweb/





32
gitweb/Makefile

@ -12,7 +12,10 @@ all::


prefix ?= $(HOME) prefix ?= $(HOME)
bindir ?= $(prefix)/bin bindir ?= $(prefix)/bin
gitwebdir ?= /var/www/cgi-bin

RM ?= rm -f RM ?= rm -f
INSTALL ?= install


# default configuration for gitweb # default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl GITWEB_CONFIG = gitweb_config.perl
@ -49,9 +52,11 @@ SHELL_PATH ?= $(SHELL)
PERL_PATH ?= /usr/bin/perl PERL_PATH ?= /usr/bin/perl


# Shell quote; # Shell quote;
bindir_SQ = $(subst ','\'',$(bindir)) #' bindir_SQ = $(subst ','\'',$(bindir))#'
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) #' gitwebdir_SQ = $(subst ','\'',$(gitwebdir))#'
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) #' SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))#'
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))#'
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))#'


# Quiet generation (unless V=1) # Quiet generation (unless V=1)
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
@ -80,20 +85,30 @@ endif


all:: gitweb.cgi all:: gitweb.cgi


GITWEB_PROGRAMS = gitweb.cgi

ifdef JSMIN ifdef JSMIN
GITWEB_FILES += gitweb.min.js
GITWEB_JS = gitweb.min.js GITWEB_JS = gitweb.min.js
all:: gitweb.min.js all:: gitweb.min.js
gitweb.min.js: gitweb.js GITWEB-BUILD-OPTIONS gitweb.min.js: gitweb.js GITWEB-BUILD-OPTIONS
$(QUIET_GEN)$(JSMIN) <$< >$@ $(QUIET_GEN)$(JSMIN) <$< >$@
else
GITWEB_FILES += gitweb.js
endif endif


ifdef CSSMIN ifdef CSSMIN
GITWEB_FILES += gitweb.min.css
GITWEB_CSS = gitweb.min.css GITWEB_CSS = gitweb.min.css
all:: gitweb.min.css all:: gitweb.min.css
gitweb.min.css: gitweb.css GITWEB-BUILD-OPTIONS gitweb.min.css: gitweb.css GITWEB-BUILD-OPTIONS
$(QUIET_GEN)$(CSSMIN) <$ >$@ $(QUIET_GEN)$(CSSMIN) <$ >$@
else
GITWEB_FILES += gitweb.css
endif endif


GITWEB_FILES += git-logo.png git-favicon.png

GITWEB_REPLACE = \ GITWEB_REPLACE = \
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \ -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
-e 's|++GIT_BINDIR++|$(bindir)|g' \ -e 's|++GIT_BINDIR++|$(bindir)|g' \
@ -127,8 +142,17 @@ gitweb.cgi: gitweb.perl GITWEB-BUILD-OPTIONS
chmod +x $@+ && \ chmod +x $@+ && \
mv $@+ $@ mv $@+ $@


### Installation rules

install: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)'
$(INSTALL) -m 755 $(GITWEB_PROGRAMS) '$(DESTDIR_SQ)$(gitwebdir_SQ)'
$(INSTALL) -m 644 $(GITWEB_FILES) '$(DESTDIR_SQ)$(gitwebdir_SQ)'

### Cleaning rules

clean: clean:
$(RM) gitweb.cgi gitweb.min.js gitweb.min.css GITWEB-BUILD-OPTIONS $(RM) gitweb.cgi gitweb.min.js gitweb.min.css GITWEB-BUILD-OPTIONS


.PHONY: all clean .FORCE-GIT-VERSION-FILE FORCE .PHONY: all clean install .FORCE-GIT-VERSION-FILE FORCE



Loading…
Cancel
Save