summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8515392)
raw | patch | inline | side by side (parent: 8515392)
author | Jakub Narebski <jnareb@gmail.com> | |
Sat, 1 May 2010 20:36:15 +0000 (22:36 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 1 May 2010 22:42:19 +0000 (15:42 -0700) |
Installing gitweb is now as easy as
# make gitwebdir=/var/www/cgi-bin gitweb-install ;# as root
The gitweb/INSTALL file was updated accordingly, to make use of this
new target.
Fix shell quoting, i.e. setting bindir_SQ etc., in gitweb/Makefile.
Those variables were not used previously.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
# make gitwebdir=/var/www/cgi-bin gitweb-install ;# as root
The gitweb/INSTALL file was updated accordingly, to make use of this
new target.
Fix shell quoting, i.e. setting bindir_SQ etc., in gitweb/Makefile.
Those variables were not used previously.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | patch | blob | history | |
gitweb/INSTALL | patch | blob | history | |
gitweb/Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index 910f4713ef1491278500573bab2d00ee1925abb8..dab5a14e41dac4d9299a90259675d8a73c9eeea6 100644 (file)
--- a/Makefile
+++ b/Makefile
done; } && \
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
+install-gitweb:
+ $(MAKE) -C gitweb install
+
install-doc:
$(MAKE) -C Documentation install
diff --git a/gitweb/INSTALL b/gitweb/INSTALL
index 208e4a8f05fae23b387e4f75efdeee6285902fab..d484d76b753ef3d4ca0d75725e44f3c58ab2b482 100644 (file)
--- a/gitweb/INSTALL
+++ b/gitweb/INSTALL
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
- $ make prefix=/usr gitweb ;# as yourself
- # cp gitweb/*.cgi gitweb/*.css \
- gitweb/*.js gitweb/*.png \
- /var/www/cgi-bin/ ;# as root
+ $ make prefix=/usr gitweb ;# as yourself
+ # make gitwebdir=/var/www/cgi-bin install-gitweb ;# as root
Alternatively you can use autoconf generated ./configure script to
set up path to git binaries (via config.mak.autogen), so you can write
$ make configure ;# as yourself
$ ./configure --prefix=/usr ;# as yourself
$ make gitweb ;# as yourself
- # cp gitweb/*.cgi gitweb/*.css \
- gitweb/*.js gitweb/*.png \
- /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
[executable] files in /var/www/cgi-bin/ as server scripts (as CGI
diff --git a/gitweb/Makefile b/gitweb/Makefile
index f2e1d92fbb965893b14adf2e9acb904bab953812..935d2d2e0775234fc99a29fd5b7610978a00099f 100644 (file)
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
prefix ?= $(HOME)
bindir ?= $(prefix)/bin
+gitwebdir ?= /var/www/cgi-bin
+
RM ?= rm -f
+INSTALL ?= install
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
PERL_PATH ?= /usr/bin/perl
# Shell quote;
-bindir_SQ = $(subst ','\'',$(bindir)) #'
-SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) #'
-PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) #'
+bindir_SQ = $(subst ','\'',$(bindir))#'
+gitwebdir_SQ = $(subst ','\'',$(gitwebdir))#'
+SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))#'
+PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))#'
+DESTDIR_SQ = $(subst ','\'',$(DESTDIR))#'
# Quiet generation (unless V=1)
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
all:: gitweb.cgi
+GITWEB_PROGRAMS = gitweb.cgi
+
ifdef JSMIN
+GITWEB_FILES += gitweb.min.js
GITWEB_JS = gitweb.min.js
all:: gitweb.min.js
gitweb.min.js: gitweb.js GITWEB-BUILD-OPTIONS
$(QUIET_GEN)$(JSMIN) <$< >$@
+else
+GITWEB_FILES += gitweb.js
endif
ifdef CSSMIN
+GITWEB_FILES += gitweb.min.css
GITWEB_CSS = gitweb.min.css
all:: gitweb.min.css
gitweb.min.css: gitweb.css GITWEB-BUILD-OPTIONS
$(QUIET_GEN)$(CSSMIN) <$ >$@
+else
+GITWEB_FILES += gitweb.css
endif
+GITWEB_FILES += git-logo.png git-favicon.png
+
GITWEB_REPLACE = \
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
-e 's|++GIT_BINDIR++|$(bindir)|g' \
chmod +x $@+ && \
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:
$(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