Browse Source

compile debian package version into all 3 components at build time

git.mgm/mediaproxy-ng/2.0
Richard Fuchs 14 years ago
parent
commit
534f4be7e6
7 changed files with 17 additions and 16 deletions
  1. +6
    -8
      daemon/Makefile
  2. +1
    -2
      daemon/control.c
  3. +1
    -2
      daemon/main.c
  4. +4
    -1
      iptables-extension/Makefile
  5. +3
    -2
      iptables-extension/libxt_MEDIAPROXY.c
  6. +1
    -0
      kernel-module/Makefile
  7. +1
    -1
      kernel-module/xt_MEDIAPROXY.c

+ 6
- 8
daemon/Makefile View File

@ -6,6 +6,7 @@ CC= gcc
CFLAGS= -g -Wall `pkg-config --cflags glib-2.0` `pcre-config --cflags` -fno-strict-aliasing
CFLAGS+= -I/lib/modules/`uname -r`/build/include/ -I../kernel-module/
CFLAGS+= -D_GNU_SOURCE
CFLAGS+= -DMEDIAPROXY_VERSION="\"$(shell dpkg-parsechangelog -l../debian/changelog | awk '/^Version: / {print $$2}')\""
ifeq ($(REDIS),yes)
CFLAGS+= -I$(LIBREDISDIR)
@ -53,22 +54,19 @@ tests:
dep: .depend
clean:
rm -f $(OBJS) mediaproxy-ng aux-test poller-test aux-test.o poller-test.o .depend build_time.h core
rm -f $(OBJS) mediaproxy-ng aux-test poller-test aux-test.o poller-test.o .depend core
$(MAKE) -C $(LIBREDISDIR) clean
.depend: $(SRCS) Makefile build_time.h
.depend: $(SRCS) Makefile
$(CC) $(CFLAGS) -M $(SRCS) | sed -e 's/:/ .depend:/' > .depend
build_time.h: $(SRCS) Makefile
echo "#define BUILD_TIME \"$(shell dpkg-parsechangelog -l../debian/changelog | awk '/^Version: / {print $$2}')\"" > build_time.h
mediaproxy-ng: $(OBJS) .depend build_time.h
mediaproxy-ng: $(OBJS) .depend
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
aux-test: aux.o aux-test.o .depend build_time.h
aux-test: aux.o aux-test.o .depend
$(CC) $(CFLAGS) -o $@ aux-test.o aux.o $(LDFLAGS)
poller-test: poller.o poller-test.o aux.o .depend build_time.h
poller-test: poller.o poller-test.o aux.o .depend
$(CC) $(CFLAGS) -o $@ poller-test.o poller.o aux.o $(LDFLAGS)


+ 1
- 2
daemon/control.c View File

@ -10,7 +10,6 @@
#include "aux.h"
#include "streambuf.h"
#include "log.h"
#include "build_time.h"
#include "call.h"
@ -88,7 +87,7 @@ static int control_stream_parse(struct control_stream *s, char *line) {
else if (!strcmp(out[14], "status"))
calls_status(c->callmaster, s);
else if (!strcmp(out[14], "build") | !strcmp(out[14], "version"))
streambuf_printf(s->outbuf, "Build: %s\n", BUILD_TIME);
streambuf_printf(s->outbuf, "Version: %s\n", MEDIAPROXY_VERSION);
else if (!strcmp(out[14], "controls"))
control_list(c, s);
else if (!strcmp(out[14], "quit") || !strcmp(out[14], "exit"))


+ 1
- 2
daemon/main.c View File

@ -17,7 +17,6 @@
#ifndef NO_REDIS
#include "redis.h"
#endif
#include "build_time.h"
@ -185,7 +184,7 @@ static void options(int *argc, char ***argv) {
die("Bad command line: %s\n", er->message);
if (version)
die("Build time: %s\n", BUILD_TIME);
die("%s\n", MEDIAPROXY_VERSION);
if (!ipv4s)
die("Missing option --ip\n");


+ 4
- 1
iptables-extension/Makefile View File

@ -1,9 +1,12 @@
CFLAGS = -O2 -Wall -shared -fPIC
CFLAGS += -DMEDIAPROXY_VERSION="\"$(shell dpkg-parsechangelog -l../debian/changelog | awk '/^Version: / {print $$2}')\""
.PHONY: all clean
all: libxt_MEDIAPROXY.so
libxt_MEDIAPROXY.so: libxt_MEDIAPROXY.c
gcc -O2 -Wall -shared -fPIC -o libxt_MEDIAPROXY.so libxt_MEDIAPROXY.c
gcc $(CFLAGS) -o libxt_MEDIAPROXY.so libxt_MEDIAPROXY.c
clean:
rm -f libxt_MEDIAPROXY.so

+ 3
- 2
iptables-extension/libxt_MEDIAPROXY.c View File

@ -12,9 +12,10 @@
static void help(void) {
printf(
"MEDIAPROXY target options:\n"
"MEDIAPROXY (version %s) target options:\n"
" --id <id>\n"
" Unique ID for this instance\n"
" Unique ID for this instance\n",
MEDIAPROXY_VERSION
);
}


+ 1
- 0
kernel-module/Makefile View File

@ -1,6 +1,7 @@
PWD := $(shell pwd)
KSRC ?= /lib/modules/$(shell uname -r)/build
KBUILD := $(KSRC)
EXTRA_CFLAGS += -DMEDIAPROXY_VERSION="\"$(shell dpkg-parsechangelog -l$(M)/../debian/changelog | awk '/^Version: / {print $$2}')\""
obj-m += xt_MEDIAPROXY.o


+ 1
- 1
kernel-module/xt_MEDIAPROXY.c View File

@ -1370,7 +1370,7 @@ static struct xt_target xt_mediaproxy_regs[] = {
static int __init init(void) {
int ret;
printk(KERN_NOTICE "Registering xt_MEDIAPROXY module\n");
printk(KERN_NOTICE "Registering xt_MEDIAPROXY module - version %s\n", MEDIAPROXY_VERSION);
rwlock_init(&table_lock);


Loading…
Cancel
Save