Merge pull request #53 from sq7lrx/destdir

Adds DESTDIR build variable
This commit is contained in:
Jonathan Naylor 2020-05-28 22:54:13 +01:00 committed by GitHub
commit 92fa97a07d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 62 additions and 57 deletions

View file

@ -14,7 +14,7 @@ aprstransmitd: $(OBJECTS) ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 aprstransmitd $(BINDIR) install -g root -o root -m 0755 aprstransmitd $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -69,6 +69,7 @@ You can optionally specify some make variables to alter the default behavior:
| LOGDIR | `/var/log` | location of log files | | LOGDIR | `/var/log` | location of log files |
| CONFDIR | `/etc` | location of configuration files | | CONFDIR | `/etc` | location of configuration files |
| BINDIR | `/usr/bin` | program binaries installed here | | BINDIR | `/usr/bin` | program binaries installed here |
| DESTDIR | _not set_ | destination for staged build |
### Example ### Example

View file

@ -1,37 +1,37 @@
.PHONY: install .PHONY: install
install: install:
install -d -g bin -o root -m 0775 $(DATADIR) install -d -g root -o root -m 0755 $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 CCS_Hosts.txt $(DATADIR) install -g root -o root -m 0644 CCS_Hosts.txt $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 DCS_Hosts.txt $(DATADIR) install -g root -o root -m 0644 DCS_Hosts.txt $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 DExtra_Hosts.txt $(DATADIR) install -g root -o root -m 0644 DExtra_Hosts.txt $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 DPlus_Hosts.txt $(DATADIR) install -g root -o root -m 0644 DPlus_Hosts.txt $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_de_DE.ambe $(DATADIR) install -g root -o root -m 0644 TIME_de_DE.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_de_DE.indx $(DATADIR) install -g root -o root -m 0644 TIME_de_DE.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_en_GB.ambe $(DATADIR) install -g root -o root -m 0644 TIME_en_GB.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_en_GB.indx $(DATADIR) install -g root -o root -m 0644 TIME_en_GB.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_en_US.ambe $(DATADIR) install -g root -o root -m 0644 TIME_en_US.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_en_US.indx $(DATADIR) install -g root -o root -m 0644 TIME_en_US.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_fr_FR.ambe $(DATADIR) install -g root -o root -m 0644 TIME_fr_FR.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_fr_FR.indx $(DATADIR) install -g root -o root -m 0644 TIME_fr_FR.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_se_SE.ambe $(DATADIR) install -g root -o root -m 0644 TIME_se_SE.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 TIME_se_SE.indx $(DATADIR) install -g root -o root -m 0644 TIME_se_SE.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 de_DE.ambe $(DATADIR) install -g root -o root -m 0644 de_DE.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 de_DE.indx $(DATADIR) install -g root -o root -m 0644 de_DE.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 dk_DK.ambe $(DATADIR) install -g root -o root -m 0644 dk_DK.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 dk_DK.indx $(DATADIR) install -g root -o root -m 0644 dk_DK.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 en_GB.ambe $(DATADIR) install -g root -o root -m 0644 en_GB.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 en_GB.indx $(DATADIR) install -g root -o root -m 0644 en_GB.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 en_US.ambe $(DATADIR) install -g root -o root -m 0644 en_US.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 en_US.indx $(DATADIR) install -g root -o root -m 0644 en_US.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 es_ES.ambe $(DATADIR) install -g root -o root -m 0644 es_ES.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 es_ES.indx $(DATADIR) install -g root -o root -m 0644 es_ES.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 fr_FR.ambe $(DATADIR) install -g root -o root -m 0644 fr_FR.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 fr_FR.indx $(DATADIR) install -g root -o root -m 0644 fr_FR.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 it_IT.ambe $(DATADIR) install -g root -o root -m 0644 it_IT.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 it_IT.indx $(DATADIR) install -g root -o root -m 0644 it_IT.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 no_NO.ambe $(DATADIR) install -g root -o root -m 0644 no_NO.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 no_NO.indx $(DATADIR) install -g root -o root -m 0644 no_NO.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 pl_PL.ambe $(DATADIR) install -g root -o root -m 0644 pl_PL.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 pl_PL.indx $(DATADIR) install -g root -o root -m 0644 pl_PL.indx $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 se_SE.ambe $(DATADIR) install -g root -o root -m 0644 se_SE.ambe $(DESTDIR)$(DATADIR)
install -g bin -o root -m 0664 se_SE.indx $(DATADIR) install -g root -o root -m 0644 se_SE.indx $(DESTDIR)$(DATADIR)

View file

@ -1,14 +1,14 @@
export BUILD?=debug export BUILD ?= debug
ifeq ($(TARGET), opendv) ifeq ($(TARGET), opendv)
export DATADIR ?= "/usr/share/opendv" export DATADIR ?= /usr/share/opendv
export LOGDIR ?= "/var/log/opendv" export LOGDIR ?= /var/log/opendv
export CONFDIR ?= "/etc" export CONFDIR ?= /etc
export BINDIR ?= "/usr/sbin" export BINDIR ?= /usr/sbin
else else
export DATADIR ?= "/usr/share/ircddbgateway" export DATADIR ?= /usr/share/ircddbgateway
export LOGDIR ?= "/var/log" export LOGDIR ?= /var/log
export CONFDIR ?= "/etc" export CONFDIR ?= /etc
export BINDIR ?= "/usr/bin" export BINDIR ?= /usr/bin
endif endif
# Add -DDCS_LINK to the end of the CFLAGS line below to add DCS linking to StarNet # Add -DDCS_LINK to the end of the CFLAGS line below to add DCS linking to StarNet
@ -20,7 +20,7 @@ export CXX := $(shell wx-config --cxx)
export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)'
ifeq ($(BUILD), debug) ifeq ($(BUILD), debug)
export CFLAGS := $(CFLAGS) $(DEBUGFLAGS) export CFLAGS := $(CFLAGS) $(DEBUGFLAGS)
else ($(BUILD), release) else ifeq ($(BUILD), release)
export CFLAGS := $(CFLAGS) $(RELEASEFLAGS) export CFLAGS := $(CFLAGS) $(RELEASEFLAGS)
endif endif
export GUILIBS := $(shell wx-config --libs adv,core,base) export GUILIBS := $(shell wx-config --libs adv,core,base)
@ -67,8 +67,12 @@ Common/Common.a: force
ircDDB/IRCDDB.a: force ircDDB/IRCDDB.a: force
$(MAKE) -C ircDDB $(MAKE) -C ircDDB
.PHONY: installdirs
installdirs: force
/bin/mkdir -p $(DESTDIR)$(DATADIR) $(DESTDIR)$(LOGDIR) $(DESTDIR)$(CONFDIR) $(DESTDIR)$(BINDIR)
.PHONY: install .PHONY: install
install: all install: all installdirs
ifeq ($(TARGET), opendv) ifeq ($(TARGET), opendv)
useradd --user-group -M --system opendv --shell /bin/false || true useradd --user-group -M --system opendv --shell /bin/false || true

View file

@ -15,7 +15,7 @@ remotecontrold: $(OBJECTS) ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 remotecontrold $(BINDIR) install -g root -o root -m 0755 remotecontrold $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -14,7 +14,7 @@ starnetserverd: $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 starnetserverd $(BINDIR) install -g root -o root -m 0755 starnetserverd $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -14,7 +14,7 @@ texttransmitd: $(OBJECTS) ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 texttransmitd $(BINDIR) install -g root -o root -m 0755 texttransmitd $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -14,7 +14,7 @@ timeserverd: $(OBJECTS) ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 timeserverd $(BINDIR) install -g root -o root -m 0755 timeserverd $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -15,7 +15,7 @@ timercontrold: $(OBJECTS) ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 timercontrold $(BINDIR) install -g root -o root -m 0755 timercontrold $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -14,7 +14,7 @@ voicetransmitd: $(OBJECTS) ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 voicetransmitd $(BINDIR) install -g root -o root -m 0755 voicetransmitd $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean:

View file

@ -14,10 +14,10 @@ ircddbgatewayd: $(OBJECTS) ../ircDDB/IRCDDB.a ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 ircddbgatewayd $(BINDIR) install -g root -o root -m 0755 ircddbgatewayd $(DESTDIR)$(BINDIR)
cp ircddbgateway-emptyconfig $(CONFDIR)/ircddbgateway cp ircddbgateway-emptyconfig $(DESTDIR)$(CONFDIR)/ircddbgateway
ifeq ($(TARGET), opendv) ifeq ($(TARGET), opendv)
cp ../debian/ircddbgatewayd.ircddbgatewayd.service /lib/systemd/system/ircddbgatewayd.service cp ../debian/ircddbgatewayd.ircddbgatewayd.service $(DESTDIR)/etc/systemd/system/ircddbgatewayd.service
endif endif
.PHONY: clean .PHONY: clean

View file

@ -15,7 +15,7 @@ ircddbgatewayconfig: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a
.PHONY: install .PHONY: install
install: install:
install -g bin -o root -m 0775 ircddbgatewayconfig $(BINDIR) install -g root -o root -m 0755 ircddbgatewayconfig $(DESTDIR)$(BINDIR)
.PHONY: clean .PHONY: clean
clean: clean: