don't hardcode /usr/share paths

Add a defines.mk file defining the standard default layout
for installation (PREFIX, DATAROOTDIR, LIBDIR etc.).

Add a $(JSDIR) variable and use env!("JSDIR") in place of
the hardcoded /usr/share/javascript/proxmox-backup path.

Have defines.mk include an *optional* local.mak to override
JSDIR to www/ during local development.

Add `make install` targets and remove debian/install.

Note that service files are now in $libdir/proxmox-backup/
as there's usually no point in starting them from the
command line, so /usr/sbin makes no sense.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2019-01-31 13:43:09 +01:00
parent 9fa03fa2d3
commit 6285b251e7
12 changed files with 119 additions and 45 deletions

View File

@ -1,3 +1,9 @@
include ../defines.mk
IMAGES := \
images/logo-128.png \
images/proxmox_logo.png
JSSRC= \
Utils.js \
Logo.js \
@ -24,3 +30,11 @@ js/proxmox-backup-gui.js: js OnlineHelpInfo.js ${JSSRC}
clean:
find . -name '*~' -exec rm {} ';'
rm -rf js
install: js/proxmox-backup-gui.js
install -dm755 $(DESTDIR)$(JSDIR)
install -dm755 $(DESTDIR)$(JSDIR)/js
install -m644 js/proxmox-backup-gui.js $(DESTDIR)$(JSDIR)/js/
install -dm755 $(DESTDIR)$(JSDIR)/images
$(foreach i,$(IMAGES), \
install -m644 $(i) $(DESTDIR)$(JSDIR)/images/ ;)