2022-06-28 12:16:00 +02:00
|
|
|
ifndef MAK_DIR_GITWEB
|
|
|
|
$(error do not run gitweb/Makefile stand-alone anymore. The "gitweb" and \
|
|
|
|
"install-gitweb" targets now live in the top-level Makefile)
|
|
|
|
endif
|
2022-06-28 12:15:58 +02:00
|
|
|
|
2010-01-30 23:30:40 +01:00
|
|
|
# Define JSMIN to point to JavaScript minifier that functions as
|
2010-05-28 08:25:49 +02:00
|
|
|
# a filter to have static/gitweb.js minified.
|
2010-01-30 23:30:40 +01:00
|
|
|
#
|
2010-04-03 02:35:05 +02:00
|
|
|
# Define CSSMIN to point to a CSS minifier in order to generate a minified
|
2010-05-28 08:25:49 +02:00
|
|
|
# version of static/gitweb.css
|
2010-04-03 02:35:05 +02:00
|
|
|
#
|
2010-01-30 23:30:40 +01:00
|
|
|
|
|
|
|
# default configuration for gitweb
|
|
|
|
GITWEB_CONFIG = gitweb_config.perl
|
|
|
|
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
|
2011-07-25 00:29:18 +02:00
|
|
|
GITWEB_CONFIG_COMMON = /etc/gitweb-common.conf
|
2010-01-30 23:30:40 +01:00
|
|
|
GITWEB_HOME_LINK_STR = projects
|
|
|
|
GITWEB_SITENAME =
|
|
|
|
GITWEB_PROJECTROOT = /pub/git
|
|
|
|
GITWEB_PROJECT_MAXDEPTH = 2007
|
|
|
|
GITWEB_EXPORT_OK =
|
|
|
|
GITWEB_STRICT_EXPORT =
|
|
|
|
GITWEB_BASE_URL =
|
|
|
|
GITWEB_LIST =
|
|
|
|
GITWEB_HOMETEXT = indextext.html
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_CSS_IN = static/gitweb.css
|
|
|
|
GITWEB_CSS = $(GITWEB_CSS_IN)
|
2010-05-28 08:25:49 +02:00
|
|
|
GITWEB_LOGO = static/git-logo.png
|
|
|
|
GITWEB_FAVICON = static/git-favicon.png
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_JS_IN = static/gitweb.js
|
|
|
|
GITWEB_JS = $(GITWEB_JS_IN)
|
2011-10-21 09:09:29 +02:00
|
|
|
GITWEB_SITE_HTML_HEAD_STRING =
|
2010-01-30 23:30:40 +01:00
|
|
|
GITWEB_SITE_HEADER =
|
|
|
|
GITWEB_SITE_FOOTER =
|
2010-09-21 09:25:19 +02:00
|
|
|
HIGHLIGHT_BIN = highlight
|
2010-01-30 23:30:40 +01:00
|
|
|
|
2022-06-28 12:15:56 +02:00
|
|
|
# What targets we'll add to 'all' for "make gitweb"
|
|
|
|
GITWEB_ALL =
|
|
|
|
GITWEB_ALL += gitweb.cgi
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_ALL += $(GITWEB_JS)
|
2022-06-28 12:15:56 +02:00
|
|
|
|
2022-06-28 12:16:00 +02:00
|
|
|
MAK_DIR_GITWEB_ALL = $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_ALL))
|
2010-01-30 23:30:40 +01:00
|
|
|
|
2010-05-01 22:36:15 +02:00
|
|
|
GITWEB_PROGRAMS = gitweb.cgi
|
|
|
|
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_JS_MIN = static/gitweb.min.js
|
2010-01-30 23:30:40 +01:00
|
|
|
ifdef JSMIN
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_JS = $(GITWEB_JS_MIN)
|
2022-06-28 12:16:00 +02:00
|
|
|
GITWEB_ALL += $(MAK_DIR_GITWEB)$(GITWEB_JS_MIN)
|
2022-06-28 12:15:58 +02:00
|
|
|
$(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
|
|
|
|
$(MAK_DIR_GITWEB)$(GITWEB_JS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_JS_IN)
|
2010-04-15 14:57:18 +02:00
|
|
|
$(QUIET_GEN)$(JSMIN) <$< >$@
|
2010-04-03 02:35:05 +02:00
|
|
|
endif
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_FILES += $(GITWEB_JS)
|
2010-04-15 14:57:18 +02:00
|
|
|
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_CSS_MIN = static/gitweb.min.css
|
2010-04-03 02:35:05 +02:00
|
|
|
ifdef CSSMIN
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_CSS = $(GITWEB_CSS_MIN)
|
2022-06-28 12:16:00 +02:00
|
|
|
GITWEB_ALL += $(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN)
|
2022-06-28 12:15:58 +02:00
|
|
|
$(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
|
|
|
|
$(MAK_DIR_GITWEB)$(GITWEB_CSS_MIN): $(MAK_DIR_GITWEB)$(GITWEB_CSS_IN)
|
2010-06-18 23:01:25 +02:00
|
|
|
$(QUIET_GEN)$(CSSMIN) <$< >$@
|
2010-04-03 02:35:05 +02:00
|
|
|
endif
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_FILES += $(GITWEB_CSS)
|
2010-01-30 23:30:40 +01:00
|
|
|
|
2010-05-28 08:25:49 +02:00
|
|
|
GITWEB_FILES += static/git-logo.png static/git-favicon.png
|
2010-05-01 22:36:15 +02:00
|
|
|
|
2011-04-28 21:04:01 +02:00
|
|
|
# JavaScript files that are composed (concatenated) to form gitweb.js
|
|
|
|
#
|
|
|
|
# js/lib/common-lib.js should be always first, then js/lib/*.js,
|
|
|
|
# then the rest of files; js/gitweb.js should be last (if it exists)
|
2022-06-28 12:15:57 +02:00
|
|
|
GITWEB_JSLIB_FILES =
|
2011-04-28 21:04:01 +02:00
|
|
|
GITWEB_JSLIB_FILES += static/js/lib/common-lib.js
|
2011-04-28 21:04:04 +02:00
|
|
|
GITWEB_JSLIB_FILES += static/js/lib/datetime.js
|
2011-04-28 21:04:05 +02:00
|
|
|
GITWEB_JSLIB_FILES += static/js/lib/cookies.js
|
2011-04-28 21:04:01 +02:00
|
|
|
GITWEB_JSLIB_FILES += static/js/javascript-detection.js
|
gitweb: JavaScript ability to adjust time based on timezone
This patch is based on Kevin Cernekee's <cernekee@gmail.com>
patch series entitled "gitweb: introduce localtime feature". While
Kevin's patch changed the server side output so that the timezone
was output from gitweb itself, this has a number of drawbacks, in
particular with respect to gitweb-caching.
This patch takes the same basic goal, display the appropriate times in
a given common timezone, and implements it in JavaScript. This
requires adding / using a new class, "datetime", to be able to find
elements to be adjusted from JavaScript. Appropriate dates are
wrapped in a span with this class.
Timezone to be used can be retrieved from "gitweb_tz" cookie, though
currently there is no way to set / manipulate this cookie from gitweb;
this is left for later commit.
Valid timezones, currently, are: "utc", "local" (which means that
timezone is taken from browser), and "+/-ZZZZ" numeric timezone as in
RFC-2822. Default timezone is "local" (currently not configurable,
left for later commit).
Fallback (should JavaScript not be enabled) is to treat dates as they
have been and display them, only, in UTC.
Pages affected:
* 'summary' view, "last change" field (commit time from latest change)
* 'log' view, author time
* 'commit' and 'commitdiff' views, author/committer time
* 'tag' view, tagger time
Based-on-code-from: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-28 21:04:09 +02:00
|
|
|
GITWEB_JSLIB_FILES += static/js/adjust-timezone.js
|
2011-04-28 21:04:01 +02:00
|
|
|
GITWEB_JSLIB_FILES += static/js/blame_incremental.js
|
|
|
|
|
|
|
|
|
2010-04-15 14:57:18 +02:00
|
|
|
GITWEB_REPLACE = \
|
|
|
|
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
|
|
|
|
-e 's|++GIT_BINDIR++|$(bindir)|g' \
|
|
|
|
-e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
|
|
|
|
-e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
|
2011-07-25 00:29:18 +02:00
|
|
|
-e 's|++GITWEB_CONFIG_COMMON++|$(GITWEB_CONFIG_COMMON)|g' \
|
2010-04-15 14:57:18 +02:00
|
|
|
-e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
|
|
|
|
-e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
|
|
|
|
-e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
|
|
|
|
-e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
|
|
|
|
-e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
|
|
|
|
-e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
|
|
|
|
-e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
|
|
|
|
-e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
|
|
|
|
-e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
|
|
|
|
-e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
|
|
|
|
-e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
|
|
|
|
-e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
|
|
|
|
-e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
|
2011-10-21 09:09:29 +02:00
|
|
|
-e 's|++GITWEB_SITE_HTML_HEAD_STRING++|$(GITWEB_SITE_HTML_HEAD_STRING)|g' \
|
2010-04-15 14:57:18 +02:00
|
|
|
-e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
|
2010-09-21 09:25:19 +02:00
|
|
|
-e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
|
|
|
|
-e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g'
|
2010-04-15 14:57:18 +02:00
|
|
|
|
2022-06-28 12:15:55 +02:00
|
|
|
.PHONY: FORCE
|
2022-06-28 12:15:58 +02:00
|
|
|
$(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS: FORCE
|
2010-04-15 14:57:18 +02:00
|
|
|
@rm -f $@+
|
|
|
|
@echo "x" '$(PERL_PATH_SQ)' $(GITWEB_REPLACE) "$(JSMIN)|$(CSSMIN)" >$@+
|
|
|
|
@cmp -s $@+ $@ && rm -f $@+ || mv -f $@+ $@
|
|
|
|
|
2022-06-28 12:15:58 +02:00
|
|
|
$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)GITWEB-BUILD-OPTIONS
|
|
|
|
$(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl
|
2010-01-30 23:30:40 +01:00
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
|
|
|
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
|
2010-04-15 14:57:18 +02:00
|
|
|
$(GITWEB_REPLACE) $< >$@+ && \
|
2010-01-30 23:30:40 +01:00
|
|
|
chmod +x $@+ && \
|
|
|
|
mv $@+ $@
|
|
|
|
|
2022-06-28 12:15:58 +02:00
|
|
|
$(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))
|
2011-04-28 21:04:01 +02:00
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
|
|
|
cat $^ >$@+ && \
|
|
|
|
mv $@+ $@
|
|
|
|
|
2010-05-01 22:36:15 +02:00
|
|
|
### Installation rules
|
|
|
|
|
2022-06-28 12:16:00 +02:00
|
|
|
.PHONY: install-gitweb
|
|
|
|
install-gitweb: $(MAK_DIR_GITWEB_ALL)
|
2010-05-01 22:36:15 +02:00
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)'
|
2022-06-28 12:16:00 +02:00
|
|
|
$(INSTALL) -m 755 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_PROGRAMS)) '$(DESTDIR_SQ)$(gitwebdir_SQ)'
|
2010-05-28 08:25:49 +02:00
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
|
2022-06-28 12:15:58 +02:00
|
|
|
$(INSTALL) -m 644 $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_FILES)) \
|
|
|
|
'$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'
|
2022-06-28 12:16:02 +02:00
|
|
|
ifndef NO_GITWEB
|
2022-06-28 12:16:00 +02:00
|
|
|
ifndef NO_PERL
|
|
|
|
install: install-gitweb
|
|
|
|
endif
|
2022-06-28 12:16:02 +02:00
|
|
|
endif
|
2010-05-01 22:36:15 +02:00
|
|
|
|
|
|
|
### Cleaning rules
|
|
|
|
|
2022-06-28 12:16:00 +02:00
|
|
|
.PHONY: gitweb-clean
|
|
|
|
gitweb-clean:
|
2022-06-28 12:15:58 +02:00
|
|
|
$(RM) $(addprefix $(MAK_DIR_GITWEB),gitweb.cgi $(GITWEB_JS_IN) \
|
2022-06-28 12:15:57 +02:00
|
|
|
$(GITWEB_JS_MIN) $(GITWEB_CSS_MIN) \
|
2022-06-28 12:15:58 +02:00
|
|
|
GITWEB-BUILD-OPTIONS)
|
2022-06-28 12:16:00 +02:00
|
|
|
clean: gitweb-clean
|