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:
18
etc/Makefile
Normal file
18
etc/Makefile
Normal file
@ -0,0 +1,18 @@
|
||||
include ../defines.mk
|
||||
|
||||
UNITS := \
|
||||
proxmox-backup.service \
|
||||
proxmox-backup-proxy.service
|
||||
|
||||
all: $(UNITS)
|
||||
|
||||
clean:
|
||||
rm -f $(UNITS)
|
||||
|
||||
.SUFFIXES: .service.in .service
|
||||
.service.in.service:
|
||||
sed \
|
||||
-e 's!%LIBDIR%!$(LIBDIR)!g' \
|
||||
-e 's!%PROXY_USER%!$(PROXY_USER)!g' \
|
||||
$< >$@.tmp
|
||||
mv $@.tmp $@
|
15
etc/proxmox-backup-proxy.service.in
Normal file
15
etc/proxmox-backup-proxy.service.in
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Proxmox Backup API Proxy Server
|
||||
Wants=network-online.target
|
||||
After=network.target syslog.service
|
||||
Requires=proxmox-backup.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%LIBDIR%/proxmox-backup/proxmox-backup-proxy
|
||||
Restart=on-failure
|
||||
User=%PROXY_USER%
|
||||
Group=%PROXY_USER%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
12
etc/proxmox-backup.service.in
Normal file
12
etc/proxmox-backup.service.in
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Proxmox Backup API Server
|
||||
Wants=network-online.target
|
||||
After=network.target syslog.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%LIBDIR%/proxmox-backup/proxmox-backup-api
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user