Makefile 1.53 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
V=2.0_alpha2
Natanael Copa's avatar
Natanael Copa committed
2
3
4
P=alpine-conf
PV=$(P)-$(V)
APKF=$(PV).apk
Natanael Copa's avatar
Natanael Copa committed
5
TARBZ2=$(PV).tar.bz2
6
PREFIX?=/usr
Natanael Copa's avatar
Natanael Copa committed
7
8
9
TMP=$(PV)

LIB_FILES=libalpine.sh
10
11
SBIN_FILES=albootstrap\
	lbu\
12
13
	setup-ads\
	setup-alpine\
14
	setup-alpine-web\
15
	setup-cryptswap\
Natanael Copa's avatar
Natanael Copa committed
16
17
	setup-dns\
	setup-hostname\
18
	setup-interfaces\
19
	setup-keymap\
20
	setup-mta\
21
	setup-sendbug\
Natanael Copa's avatar
Natanael Copa committed
22
23
	setup-webconf\
	update-conf
24
25

ETC_LBU_FILES=lbu.conf
Natanael Copa's avatar
Natanael Copa committed
26
27
EXTRA_DIST=Makefile README

28
DIST_FILES=$(LIB_FILES) $(SBIN_FILES) $(ETC_LBU_FILES) $(EXTRA_DIST)
Natanael Copa's avatar
Natanael Copa committed
29
30
31
32

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

Natanael Copa's avatar
Natanael Copa committed
33
SHARE_DIR := share/lbu
Natanael Copa's avatar
Natanael Copa committed
34
35
36
37
38
39
40
41
42
43

TAR=tar
DB=$(TMP)/var/db/apk/$(PV)

.PHONY:	all apk clean dist install uninstall
all:	
	sed -i 's|^PREFIX=.*|PREFIX=$(PREFIX)|' $(SBIN_FILES)

apk:	$(APKF)

Natanael Copa's avatar
Natanael Copa committed
44
dist:	$(TARBZ2)
Natanael Copa's avatar
Natanael Copa committed
45
46
47
48
49
50
51
52
53
54

$(APKF): $(SBIN_FILES)
	rm -rf $(TMP)
	make all PREFIX=
	make install DESTDIR=$(TMP) PREFIX=
	mkdir -p $(DB)
	echo $(DESC) > $(DB)/DESC
	cd $(TMP) && $(TAR) -czf ../$@ .
	rm -rf $(TMP)

Natanael Copa's avatar
Natanael Copa committed
55
$(TARBZ2): $(DIST_FILES)
Natanael Copa's avatar
Natanael Copa committed
56
57
58
	rm -rf $(TMP)
	mkdir -p $(TMP)
	cp $(DIST_FILES) $(TMP)
Natanael Copa's avatar
Natanael Copa committed
59
	$(TAR) -cjf $@ $(TMP)
60
	rm -rf $(TMP)
Natanael Copa's avatar
Natanael Copa committed
61
62
63
64
	
install:
	install -m 755 -d $(DESTDIR)/$(PREFIX)/sbin
	install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin
65
66
	install -m 755 -d $(DESTDIR)/$(PREFIX)/$(SHARE_DIR)
	install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/$(SHARE_DIR)
67
68
	install -m 755 -d $(DESTDIR)/etc/lbu
	install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/etc/lbu
Natanael Copa's avatar
Natanael Copa committed
69
70
71
72
73
74
75
76
77
78

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
	
clean:
Natanael Copa's avatar
Natanael Copa committed
79
	rm -rf $(APKF) $(TMP) $(TARBZ2)
Natanael Copa's avatar
Natanael Copa committed
80