Makefile 1.88 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
VERSION		:= 2.13.0
Natanael Copa's avatar
Natanael Copa committed
2 3 4 5 6 7

sysconfdir      ?= /etc/lbu

PREFIX		?=

LIB_FILES	:= libalpine.sh
Natanael Copa's avatar
Natanael Copa committed
8
SBIN_FILES	:= lbu\
9 10
		setup-acf\
		setup-alpine\
Natanael Copa's avatar
Natanael Copa committed
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\
Natanael Copa's avatar
Natanael Copa committed
28 29
		update-conf

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

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

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

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

Natanael Copa's avatar
Natanael Copa committed
44 45 46 47

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

Natanael Copa's avatar
Natanael Copa committed
48 49 50

SED		:= sed

51 52 53
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
54 55

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

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

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

uniso:	uniso.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
Natanael Copa's avatar
Natanael Copa committed
67 68 69

apk:	$(APKF)
	
Natanael Copa's avatar
Natanael Copa committed
70 71 72
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
Natanael Copa's avatar
Natanael Copa committed
73 74
	install -m 755 -d $(DESTDIR)/$(PREFIX)/sbin
	install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin
75 76
	install -m 755 -d $(DESTDIR)/$(PREFIX)/lib
	install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/lib
Natanael Copa's avatar
Natanael Copa committed
77 78
	install -m 755 -d $(DESTDIR)/$(sysconfdir)
	install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/$(sysconfdir)
Natanael Copa's avatar
Natanael Copa committed
79 80 81 82 83 84 85 86 87 88

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:
89
	rm -rf $(SCRIPTS) $(BIN_FILES)
Natanael Copa's avatar
Natanael Copa committed
90