From 2be5074721ed724cf1fb2856e5ffb00f96a7231a Mon Sep 17 00:00:00 2001 From: Karl Lehenbauer Date: Mon, 29 Sep 2014 15:44:01 -0500 Subject: [PATCH] Install dump1090 support files in a reasonable place * Install dump1090 and faup1090 to /usr/bin (It's Linux-standard, not my first choice.) * Build dump1090 to expect HTML and Javascript files in /usr/share/dump1090/public_html * Make 'make -f makefaup1090 install' install the dump1090 HTML and Javscript files in the above directory. * With this build style dump1090 can be invoked from anywhere and it will find its files. --- Makefile | 5 ++++- makefaup1090 | 15 +++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 46a91ad..878eed0 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,13 @@ PROGNAME=dump1090 include /usr/share/dpkg/buildflags.mk +PREFIX=/usr + ifdef PREFIX BINDIR=$(PREFIX)/bin SHAREDIR=$(PREFIX)/share/$(PROGNAME) -EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\" +HTMLDIR=$(SHAREDIR)/public_html +EXTRACFLAGS=-DHTMLPATH=\"$(HTMLDIR)\" endif #CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr` diff --git a/makefaup1090 b/makefaup1090 index bddf71e..84f5007 100644 --- a/makefaup1090 +++ b/makefaup1090 @@ -3,13 +3,17 @@ # sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local # PROGNAME=faup1090 +DUMP1090=dump1090 include /usr/share/dpkg/buildflags.mk +PREFIX=/usr + ifdef PREFIX BINDIR=$(PREFIX)/bin -SHAREDIR=$(PREFIX)/share/$(PROGNAME) -EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\" +SHAREDIR=$(PREFIX)/share/$(DUMP1090) +HTMLDIR=$(SHAREDIR)/public_html +EXTRACFLAGS=-DHTMLPATH=\"$(HTMLDIR)\" endif #CFLAGS=-O2 -g -Wall -W `pkg-config --cflags librtlsdr` @@ -32,7 +36,10 @@ faup1090: faup1090.o faup1090: faup1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(CC) $(LDFLAGS) -g -o faup1090 faup1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o $(LIBS) -install: faup1090 - install faup1090 /usr/bin/faup1090 clean: rm -f *.o faup1090 + +install: + install $(PROGNAME) $(DUMP1090) $(BINDIR) + mkdir -p $(HTMLDIR) + cp -R public_html $(SHAREDIR)