diff options
| -rw-r--r-- | Makefile | 18 | ||||
| -rw-r--r-- | README | 34 |
2 files changed, 37 insertions, 15 deletions
| @@ -1,9 +1,10 @@ | |||
| 1 | CGIT_VERSION = 0.1 | 1 | CGIT_VERSION = 0.1 |
| 2 | 2 | ||
| 3 | INSTALL_DIR = /var/www/htdocs/cgit | 3 | prefix = /var/www/htdocs/cgit |
| 4 | CACHE_ROOT = /var/cache/cgit | 4 | gitsrc = ../git |
| 5 | 5 | ||
| 6 | EXTLIBS = ../git/libgit.a ../git/xdiff/lib.a -lz -lcrypto | 6 | CACHE_ROOT = /var/cache/cgit |
| 7 | EXTLIBS = $(gitsrc)/libgit.a $(gitsrc)/xdiff/lib.a -lz -lcrypto | ||
| 7 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ | 8 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ |
| 8 | ui-summary.o ui-log.o ui-view.c ui-tree.c ui-commit.c ui-diff.o | 9 | ui-summary.o ui-log.o ui-view.c ui-tree.c ui-commit.c ui-diff.o |
| 9 | 10 | ||
| @@ -16,10 +17,11 @@ endif | |||
| 16 | all: cgit | 17 | all: cgit |
| 17 | 18 | ||
| 18 | install: all clean-cache | 19 | install: all clean-cache |
| 19 | install cgit $(INSTALL_DIR)/cgit.cgi | 20 | mkdir -p $(prefix) |
| 20 | install cgit.css $(INSTALL_DIR)/cgit.css | 21 | install cgit $(prefix)/cgit.cgi |
| 22 | install cgit.css $(prefix)/cgit.css | ||
| 21 | 23 | ||
| 22 | cgit: cgit.c cgit.h git.h $(OBJECTS) | 24 | cgit: cgit.c cgit.h git.h $(OBJECTS) $(gitsrc)/libgit.a |
| 23 | $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \ | 25 | $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \ |
| 24 | $(OBJECTS) $(EXTLIBS) | 26 | $(OBJECTS) $(EXTLIBS) |
| 25 | 27 | ||
| @@ -27,6 +29,10 @@ $(OBJECTS): cgit.h git.h | |||
| 27 | 29 | ||
| 28 | ui-diff.o: xdiff.h | 30 | ui-diff.o: xdiff.h |
| 29 | 31 | ||
| 32 | $(gitsrc)/libgit.a: | ||
| 33 | $(MAKE) -C $(gitsrc) | ||
| 34 | |||
| 35 | |||
| 30 | .PHONY: clean | 36 | .PHONY: clean |
| 31 | clean: | 37 | clean: |
| 32 | rm -f cgit *.o | 38 | rm -f cgit *.o |
| @@ -8,20 +8,36 @@ builtin cache to decrease server io-pressure. | |||
| 8 | 8 | ||
| 9 | Installation | 9 | Installation |
| 10 | 10 | ||
| 11 | $ $EDITOR Makefile | 11 | $ make gitsrc=<path> |
| 12 | $ make | 12 | $ su |
| 13 | $ sudo make install | 13 | $ make prefix=<path> install |
| 14 | 14 | ||
| 15 | Note: cgit requires the git and xdiff libraries. Currently, the makefile | 15 | |
| 16 | expects these files to be found in '../git/libgit.a' and '../git/xdiff/lib.a', | 16 | Default value for gitsrc is "../git", and this directory should contain the |
| 17 | where they will be if you have built git from source in a parallell directory. | 17 | git sources. |
| 18 | |||
| 19 | Default value for prefix is "/var/www/htdocs/cgit". This directory will | ||
| 20 | contain "cgit.cgi" and "cgit.css" after 'make install'. | ||
| 21 | |||
| 22 | After installation, httpd.conf probably must be updated with a Directory- | ||
| 23 | section for cgit, possibly something like this: | ||
| 24 | |||
| 25 | <Directory "/var/www/htdocs/cgit/"> | ||
| 26 | AllowOverride None | ||
| 27 | Options ExecCGI | ||
| 28 | Order allow,deny | ||
| 29 | Allow from all | ||
| 30 | </Directory> | ||
| 18 | 31 | ||
| 19 | 32 | ||
| 20 | Runtime configuration | 33 | Runtime configuration |
| 21 | 34 | ||
| 22 | The file /etc/cgitrc is read by cgit before handling a request. A template | 35 | The file /etc/cgitrc is read by cgit before handling a request. In addition |
| 23 | cgitrc is shipped with the sources, and all parameters and default values | 36 | to runtime parameters, this file also contains a list of the repositories |
| 24 | can be found in this file. | 37 | displayed by cgit. |
| 38 | |||
| 39 | A template cgitrc is shipped with the sources, and all parameters and default | ||
| 40 | values are documented in this file. | ||
| 25 | 41 | ||
| 26 | 42 | ||
| 27 | The cache | 43 | The cache |
