-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (36 loc) · 1.38 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
sysconfdir = /etc
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
latest_commit_id = $(shell git rev-parse HEAD 2>/dev/null || echo NOGIT)
archive_filename = "opinsys-ktpapi-$(latest_commit_id).tar.gz"
remote_server = private-archive.opinsys.fi
remote_server_path = /srv/private-archive/.distfiles/abitti-ktpapi/
all:
installdirs:
mkdir -p $(DESTDIR)/lib/systemd/system
mkdir -p $(DESTDIR)/opt/ktpapu
mkdir -p $(DESTDIR)$(sysconfdir)/systemd/system/multi-user.target.wants
install: installdirs
$(INSTALL_PROGRAM) -t $(DESTDIR)/opt/ktpapu/ \
src/apiwatcher \
src/timertrigger
$(INSTALL_DATA) VERSION $(DESTDIR)/opt/ktpapu/version
$(INSTALL_DATA) -t $(DESTDIR)/lib/systemd/system/ \
src/systemd/opinsys-ktpapi-timer.service \
src/systemd/opinsys-ktpapi-timer.timer
ln -fs -t $(DESTDIR)$(sysconfdir)/systemd/system/multi-user.target.wants/ \
/lib/systemd/system/opinsys-ktpapi-timer.service
ln -fs -t $(DESTDIR)$(sysconfdir)/systemd/system/multi-user.target.wants/ \
/lib/systemd/system/opinsys-ktpapi-timer.timer
.PHONY: archive
archive: ${archive_filename}
${archive_filename}:
git archive --format=tar.gz --prefix=opinsys-ktpapi/ \
-o $(archive_filename) ${latest_commit_id}
.PHONY: update-remote-archive
update-remote-archive: ${archive_filename}
scp -p $< ${remote_server}:${remote_server_path}
.PHONY: clean
clean:
rm -rf opinsys-ktpapi-*.tar.gz