Makefile 1.89 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
VERSION		:= 3.6.0
Natanael Copa's avatar
Natanael Copa committed
2

3
sysconfdir	?= /etc/lbu
Natanael Copa's avatar
Natanael Copa committed
4 5 6 7

PREFIX		?=

LIB_FILES	:= libalpine.sh
Natanael Copa's avatar
Natanael Copa committed
8
SBIN_FILES	:= lbu\
9 10
		setup-acf\
		setup-alpine\
11
		setup-apkcache\
12
		setup-apkrepos\
13
		setup-bootable\
Natanael Copa's avatar
Natanael Copa committed
14 15
		setup-disk\
		setup-dns\
16
		setup-gparted-desktop\
Natanael Copa's avatar
Natanael Copa committed
17 18 19
		setup-hostname\
		setup-interfaces\
		setup-keymap\
Natanael Copa's avatar
Natanael Copa committed
20
		setup-lbu\
Natanael Copa's avatar
Natanael Copa committed
21
		setup-mta\
22 23
		setup-ntp\
		setup-proxy\
24
		setup-sshd\
25
		setup-timezone\
26
		setup-xen-dom0\
27
		setup-xorg-base\
28 29
		update-conf\
		update-kernel
Natanael Copa's avatar
Natanael Copa committed
30

Natanael Copa's avatar
Natanael Copa committed
31
BIN_FILES	:= uniso
Natanael Copa's avatar
Natanael Copa committed
32

Natanael Copa's avatar
Natanael Copa committed
33
SCRIPTS		:= $(LIB_FILES) $(SBIN_FILES)
Natanael Copa's avatar
Natanael Copa committed
34

Natanael Copa's avatar
Natanael Copa committed
35 36
ETC_LBU_FILES	:= lbu.conf

37
GIT_REV		:= $(shell test -d .git && git describe || echo exported)
Natanael Copa's avatar
Natanael Copa committed
38
ifneq ($(GIT_REV), exported)
39 40
FULL_VERSION	:= $(patsubst $(PACKAGE)-%,%,$(GIT_REV))
FULL_VERSION	:= $(patsubst v%,%,$(FULL_VERSION))
Natanael Copa's avatar
Natanael Copa committed
41
else
42
FULL_VERSION	:= $(VERSION)
Natanael Copa's avatar
Natanael Copa committed
43 44
endif

45 46

DESC="Alpine configuration scripts"
47
WWW="http://git.alpinelinux.org/cgit/alpine-conf/"
48

Natanael Copa's avatar
Natanael Copa committed
49 50 51

SED		:= sed

52 53 54
SED_REPLACE	:= -e 's:@VERSION@:$(FULL_VERSION):g' \
			-e 's:@PREFIX@:$(PREFIX):g' \
			-e 's:@sysconfdir@:$(sysconfdir):g'
Natanael Copa's avatar
Natanael Copa committed
55 56

.SUFFIXES:	.sh.in .in
57
%.sh: %.sh.in
Natanael Copa's avatar
Natanael Copa committed
58 59
	${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@

60
%: %.in
Natanael Copa's avatar
Natanael Copa committed
61
	${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
62

63
.PHONY:	all apk clean install uninstall
Natanael Copa's avatar
Natanael Copa committed
64 65 66 67
all:	$(SCRIPTS) $(BIN_FILES)

uniso:	uniso.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
68 69

apk:	$(APKF)
Natanael Copa's avatar
Natanael Copa committed
70

Natanael Copa's avatar
Natanael Copa committed
71 72 73
install: $(BIN_FILES) $(SBIN_FILES) $(LIB_FILES) $(ETC_LBU_FILES)
	install -m 755 -d $(DESTDIR)/$(PREFIX)/bin
	install -m 755 $(BIN_FILES) $(DESTDIR)$(PREFIX)/bin
74 75
	install -m 755 -d $(DESTDIR)/$(PREFIX)/sbin
	install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin
76 77
	install -m 755 -d $(DESTDIR)/$(PREFIX)/lib
	install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/lib
Natanael Copa's avatar
Natanael Copa committed
78
	install -m 755 -d $(DESTDIR)/$(sysconfdir)
79
	install -m 644 $(ETC_LBU_FILES) $(DESTDIR)/$(sysconfdir)
80 81 82 83 84 85 86 87

uninstall:
	for i in $(SBIN_FILES); do \
		rm -f "$(DESTDIR)/$(PREFIX)/sbin/$$i";\
	done
	for i in $(LIB_FILES); do \
		rm -f "$(DESTDIR)/$(PREFIX)/lib/$$i";\
	done
88

89
clean:
90
	rm -rf $(SCRIPTS) $(BIN_FILES)