1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
VERSION=$(shell cat VERSION) |
VERSION = $(shell cat VERSION) |
4 |
|
SYSTEMDUNITDIR = $(shell pkg-config --variable=systemdsystemunitdir systemd) |
5 |
|
INSTALLER_TTY = tty1 |
6 |
|
|
7 |
PREFIX = /usr |
PREFIX = /usr |
8 |
LIBDIR = $(PREFIX)/lib/installer |
LIBDIR = $(PREFIX)/lib/installer |
9 |
BINDIR = $(PREFIX)/bin |
BINDIR = $(PREFIX)/bin |
10 |
|
|
11 |
all: install |
SED = sed |
12 |
|
INSTALL = install |
13 |
|
LN_S = ln -snf |
14 |
|
RM = rm |
15 |
|
|
16 |
|
all: |
17 |
|
$(SED) 's:%VERSIONTAG%:$(VERSION):' \ |
18 |
|
bin/installer.sh.in \ |
19 |
|
> bin/installer.sh |
20 |
|
$(SED) -e 's:%INSTALLER_TTY%:$(INSTALLER_TTY):g' \ |
21 |
|
-e 's:%BINDIR%:$(BINDIR):g' \ |
22 |
|
systemd/installer.service.in \ |
23 |
|
> systemd/installer.service |
24 |
|
|
25 |
create-dirs: |
create-dirs: |
26 |
install -d -m 0755 $(DESTDIR)/$(LIBDIR)/functions |
$(INSTALL) -d -m 0755 $(DESTDIR)/$(LIBDIR)/functions |
27 |
install -d -m 0755 $(DESTDIR)/$(BINDIR) |
$(INSTALL) -d -m 0755 $(DESTDIR)/$(BINDIR) |
28 |
|
|
29 |
install-files: |
install-files: |
30 |
sed 's:%VERSIONTAG%:$(VERSION):' < bin/installer.sh.in > bin/installer.sh |
$(INSTALL) -m 0755 bin/installer.sh $(DESTDIR)$(BINDIR)/installer |
31 |
install -m 0755 bin/installer.sh $(DESTDIR)$(BINDIR)/installer |
$(INSTALL) -m 0644 functions/findhdd.sh $(DESTDIR)$(LIBDIR)/functions/ |
|
install -m 0644 functions/findhdd.sh $(DESTDIR)$(LIBDIR)/functions/ |
|
32 |
|
|
33 |
install: create-dirs \ |
install-systemd |
34 |
install-files \ |
$(INSTALL) -d $(DESTDIR)/$(SYSTEMDUNITDIR) |
35 |
|
$(INSTALL) -d $(DESTDIR)/$(SYSTEMDUNITDIR)/local-fs.target.wants |
36 |
|
$(INSTALL) -m 0644 systemd/mnt-cdrom.mount $(DESTDIR)/$(SYSTEMDUNITDIR) |
37 |
|
$(LN_S) ../mnt-cdrom.mount $(DESTDIR)/$(SYSTEMDUNITDIR)/local-fs.target.wants/mnt-cdrom.mount |
38 |
|
|
39 |
|
install: create-dirs install-files install-systemd |
40 |
|
|
41 |
clean: |
clean: |
42 |
rm -f bin/installer.sh |
$(RM) -f bin/installer.sh |
43 |
|
$(RM) -f systemd/installer.service |
44 |
|
|
45 |
.PHONY: all install |
.PHONY: all install |