Browse Source

Add revision number to package version for svn/git checkouts

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2467 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.23
Stefan Bühler 13 years ago
parent
commit
638ee6cad9
  1. 1
      NEWS
  2. 31
      src/Makefile.am
  3. 4
      src/mod_cgi.c
  4. 4
      src/mod_dirlisting.c
  5. 4
      src/mod_fastcgi.c
  6. 4
      src/mod_scgi.c
  7. 3
      src/mod_ssi.c
  8. 3
      src/mod_status.c
  9. 3
      src/response.c
  10. 5
      src/server.c

1
NEWS

@ -19,6 +19,7 @@ NEWS
* Check for regular file in mod_cgi, so we don't try to start directories
* Include mmap.h from chunk.h to fix some problems with #define mmap mmap64 (fixes #1923)
* Add support for pipe logging for server.errorlog (fixes #296)
* Add revision number to package version for svn/git checkouts
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

31
src/Makefile.am

@ -8,14 +8,31 @@ lemon_SOURCES=lemon.c
lighttpd_angel_SOURCES=lighttpd-angel.c
#simple_fcgi_SOURCES=simple-fcgi.c
#simple_fcgi_LDADD=-lfcgi
.PHONY: versionstamp.h parsers
all: versionstamp.h
versionstamp.h:
@test -f versionstamp.h || touch versionstamp.h; \
REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
if test $$REVISION = "exported"; then \
REVISION="$$(LANG=C cd "$(top_srcdir)"; git describe --always 2>/dev/null)"; \
fi; \
if test -n "$$REVISION"; then \
echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
else \
echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
fi; \
if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
mv versionstamp.h.tmp versionstamp.h; \
else \
rm versionstamp.h.tmp; \
fi
if CROSS_COMPILING
configparser.c configparser.h:
mod_ssi_exprparser.c mod_ssi_exprparser.h:
.PHONY: parsers
parsers:
else
configparser.h: configparser.c
@ -28,12 +45,12 @@ mod_ssi_exprparser.c: $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c lemon$(E
rm -f mod_ssi_exprparser.h
$(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
.PHONY: parsers
parsers: configparser.c mod_ssi_exprparser.c
endif
BUILT_SOURCES = parsers
MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
CLEANFILES = versionstamp.h versionstamp.h.tmp
common_src=buffer.c log.c \
keyvalue.c chunk.c \
@ -256,9 +273,10 @@ hdr = server.h buffer.h network.h log.h keyvalue.h \
configparser.h mod_ssi_exprparser.h \
sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
splaytree.h proc_open.h status_counter.h \
mod_magnet_cache.h
mod_magnet_cache.h \
version.h
DEFS= @DEFS@ -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
lighttpd_SOURCES = $(src)
lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS)
@ -284,3 +302,4 @@ proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
noinst_HEADERS = $(hdr)
EXTRA_DIST = mod_skeleton.c configparser.y mod_ssi_exprparser.y lempar.c SConscript

4
src/mod_cgi.c

@ -37,6 +37,8 @@
# include <sys/filio.h>
#endif
#include "version.h"
enum {EOL_UNSET, EOL_N, EOL_RN};
typedef struct {
@ -782,7 +784,7 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
env.size = 0;
env.used = 0;
cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
if (!buffer_is_empty(con->server_name)) {
size_t len = con->server_name->used - 1;

4
src/mod_dirlisting.c

@ -31,6 +31,8 @@
#include <attr/attributes.h>
#endif
#include "version.h"
/* plugin config for all request/connections */
typedef struct {
@ -578,7 +580,7 @@ static void http_list_directory_footer(server *srv, connection *con, plugin_data
if (p->conf.set_footer->used > 1) {
buffer_append_string_buffer(out, p->conf.set_footer);
} else if (buffer_is_empty(con->conf.server_tag)) {
buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_NAME "/" PACKAGE_VERSION));
buffer_append_string_len(out, CONST_STR_LEN(PACKAGE_DESC));
} else {
buffer_append_string_buffer(out, con->conf.server_tag);
}

4
src/mod_fastcgi.c

@ -49,6 +49,8 @@
#include <sys/wait.h>
#endif
#include "version.h"
#define FCGI_ENV_ADD_CHECK(ret, con) \
if (ret == -1) { \
con->http_status = 400; \
@ -1882,7 +1884,7 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
buffer_prepare_copy(p->fcgi_env, 1024);
FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION)),con)
FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC)),con)
if (con->server_name->used) {
size_t len = con->server_name->used - 1;

4
src/mod_scgi.c

@ -38,6 +38,8 @@
#include <sys/wait.h>
#endif
#include "version.h"
enum {EOL_UNSET, EOL_N, EOL_RN};
/*
@ -1461,7 +1463,7 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
scgi_env_add(p->scgi_env, CONST_STR_LEN("SCGI"), CONST_STR_LEN("1"));
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_DESC));
if (con->server_name->used) {
size_t len = con->server_name->used - 1;

3
src/mod_ssi.c

@ -37,6 +37,7 @@
#endif
#include "etag.h"
#include "version.h"
/* The newest modified time of included files for include statement */
static volatile time_t include_file_last_mtime = 0;
@ -216,7 +217,7 @@ static int build_ssi_cgi_vars(server *srv, connection *con, plugin_data *p) {
array_reset(p->ssi_cgi_env);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_NAME"/"PACKAGE_VERSION);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_SOFTWARE"), PACKAGE_DESC);
ssi_env_add(p->ssi_cgi_env, CONST_STRING("SERVER_NAME"),
#ifdef HAVE_IPV6
inet_ntop(srv_sock->addr.plain.sa_family,

3
src/mod_status.c

@ -18,6 +18,7 @@
#include "plugin.h"
#include "inet_ntop_cache.h"
#include "version.h"
typedef struct {
buffer *config_url;
@ -701,7 +702,7 @@ static handler_t mod_status_handle_server_config(server *srv, connection *con, v
" <title>Status</title>\n"
" </head>\n"
" <body>\n"
" <h1>" PACKAGE_NAME " " PACKAGE_VERSION "</h1>\n"
" <h1>" PACKAGE_DESC "</h1>\n"
" <table summary=\"status\" border=\"1\">\n"));
mod_status_header_append(b, "Server-Features");

3
src/response.c

@ -25,6 +25,7 @@
#include "plugin.h"
#include "sys-socket.h"
#include "version.h"
int http_response_write_header(server *srv, connection *con) {
buffer *b;
@ -104,7 +105,7 @@ int http_response_write_header(server *srv, connection *con) {
if (!have_server) {
if (buffer_is_empty(con->conf.server_tag)) {
buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_NAME "/" PACKAGE_VERSION));
buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: " PACKAGE_DESC));
} else if (con->conf.server_tag->used > 1) {
buffer_append_string_len(b, CONST_STR_LEN("\r\nServer: "));
buffer_append_string_encoded(b, CONST_BUF_LEN(con->conf.server_tag), ENCODING_HTTP_HEADER);

5
src/server.c

@ -29,6 +29,7 @@
#include "plugin.h"
#include "joblist.h"
#include "network_backends.h"
#include "version.h"
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@ -336,7 +337,7 @@ static void show_version (void) {
#else
# define TEXT_SSL
#endif
char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL \
char *b = PACKAGE_DESC TEXT_SSL \
" - a light and fast webserver\n" \
"Build-Date: " __DATE__ " " __TIME__ "\n";
;
@ -473,7 +474,7 @@ static void show_help (void) {
#else
# define TEXT_SSL
#endif
char *b = PACKAGE_NAME "-" PACKAGE_VERSION TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
char *b = PACKAGE_DESC TEXT_SSL " ("__DATE__ " " __TIME__ ")" \
" - a light and fast webserver\n" \
"usage:\n" \
" -f <name> filename of the config-file\n" \

Loading…
Cancel
Save