Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add ability to specify custom install prefix, for packaging purposes
  • Loading branch information
anish committed Apr 24, 2015
1 parent 43ca50a commit 9e854fb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
14 changes: 13 additions & 1 deletion Makefile
Expand Up @@ -5,6 +5,18 @@
# locate the config directory of the init system
SYSTEMD := $(shell ls -d /etc/systemd/system/ 2>/dev/null)
SYSVINIT := $(shell ls -d /etc/init.d/ 2>/dev/null)
TCLSH=$(shell which tclsh || which tclsh8.5 || which tclsh8.6)
USR_DIR := /usr

ifeq ($(PREFIX),)
PREFIX_DIR := $(USR_DIR)
else
PREFIX_DIR := $(PREFIX)/$(USR_DIR)
$(warning Installing to $(PREFIX))
endif

export TCLSH
export PREFIX_DIR

all:
@echo "'make install' as root to install client package and program"
Expand All @@ -21,7 +33,7 @@ ifdef SYSVINIT
install scripts/piaware-rc-script $(SYSVINIT)piaware
else
ifdef SYSTEMD
install scripts/piaware.service $(SYSTEMD)
install scripts/piaware.service $(PREFIX)/$(SYSTEMD)
else
@echo "No init service found"
endif
Expand Down
3 changes: 2 additions & 1 deletion doc/Makefile
Expand Up @@ -2,7 +2,7 @@
# makefile for piaware doc files
#

DOCDIR=/usr/share/man/man1
DOCDIR=$(PREFIX_DIR)/share/man/man1

MANPAGES= faup1090.1 piaware.1 piaware-config.1 piaware-status.1

Expand All @@ -11,6 +11,7 @@ all:

install:
@echo ---- installing docs
install -d $(DOCDIR)
cp $(MANPAGES) $(DOCDIR)
@echo --- compressing docs
cd $(DOCDIR); gzip --force -9 $(MANPAGES)
Expand Down
4 changes: 2 additions & 2 deletions package/Makefile
@@ -1,7 +1,7 @@

LIB=/usr/lib/fa_adept_packages

TCLSH=$(shell which tclsh || which tclsh8.5 || which tclsh8.6)

LIB=$(PREFIX_DIR)/lib/fa_adept_packages

FILES=fa_adept_config.tcl fa_adept_client.tcl piaware.tcl ca/DigiCertCA.crt

Expand Down
5 changes: 2 additions & 3 deletions programs/piaware-config/Makefile
Expand Up @@ -3,9 +3,8 @@
# configure and do other stuff as a FlightAware adept client
#

LIB=/usr/lib
BIN=/usr/bin
TCLSH=tclsh8.5
LIB=$(PREFIX_DIR)/lib
BIN=$(PREFIX_DIR)/bin

CLIENT_INSTALLFILES= *.tcl

Expand Down
5 changes: 2 additions & 3 deletions programs/piaware-status/Makefile
Expand Up @@ -3,9 +3,8 @@
# get the status of the piaware toolchain
#

LIB=/usr/lib
BIN=/usr/bin
TCLSH=tclsh8.5
LIB=$(PREFIX_DIR)/lib
BIN=$(PREFIX_DIR)/bin

CLIENT_INSTALLFILES= *.tcl

Expand Down
5 changes: 2 additions & 3 deletions programs/piaware/Makefile
Expand Up @@ -3,9 +3,8 @@
# FA's simple aviation data exchange protocol
#

LIB=/usr/lib
BIN=/usr/bin
TCLSH=tclsh8.5
LIB=$(PREFIX_DIR)/lib
BIN=$(PREFIX_DIR)/bin

CLIENT_INSTALLFILES= *.tcl

Expand Down

0 comments on commit 9e854fb

Please sign in to comment.