Makefile 2.28 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
VERSION		:= 2.10.0
Natanael Copa's avatar
Natanael Copa committed
2 3 4 5 6 7 8 9 10 11

sysconfdir      ?= /etc/lbu

P		:= alpine-conf
PV		:= $(P)-$(VERSION)
TARBZ2		:= $(PV).tar.bz2
PREFIX		?=
TMP		:= $(PV)

LIB_FILES	:= libalpine.sh
Natanael Copa's avatar
Natanael Copa committed
12
SBIN_FILES	:= lbu\
Natanael Copa's avatar
Natanael Copa committed
13 14 15
		setup-ads\
		setup-alpine\
		setup-alpine-web\
Natanael Copa's avatar
Natanael Copa committed
16
		setup-apkcache\
17
		setup-apkrepos\
18
		setup-ntp\
Natanael Copa's avatar
Natanael Copa committed
19 20 21 22 23 24
		setup-cryptswap\
		setup-disk\
		setup-dns\
		setup-hostname\
		setup-interfaces\
		setup-keymap\
Natanael Copa's avatar
Natanael Copa committed
25
		setup-lbu\
Natanael Copa's avatar
Natanael Copa committed
26
		setup-mta\
27
		setup-acf\
28
		setup-bootable\
29
		setup-sshd\
30
		setup-timezone\
31
		setup-xorg-base\
32
		setup-gparted-desktop\
Natanael Copa's avatar
Natanael Copa committed
33 34
		update-conf

Natanael Copa's avatar
Natanael Copa committed
35
BIN_FILES	:= uniso
Natanael Copa's avatar
Natanael Copa committed
36

Natanael Copa's avatar
Natanael Copa committed
37 38 39
SCRIPTS		:= $(LIB_FILES) $(SBIN_FILES)
SCRIPT_SOURCES	:= $(addsuffix .in,$(SCRIPTS))

Natanael Copa's avatar
Natanael Copa committed
40

Natanael Copa's avatar
Natanael Copa committed
41 42 43 44
ETC_LBU_FILES	:= lbu.conf
EXTRA_DIST	:= Makefile README
DIST_FILES	:= $(SCRIPT_SOURCES) $(ETC_LBU_FILES) $(EXTRA_DIST)

45
GIT_REV		:= $(shell test -d .git && git describe || echo exported)
Natanael Copa's avatar
Natanael Copa committed
46 47 48 49 50 51 52
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
53 54 55 56

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

Natanael Copa's avatar
Natanael Copa committed
57 58 59 60

SED		:= sed
TAR		:= tar

61 62 63
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
64 65 66 67 68 69 70

.SUFFIXES:	.sh.in .in
.sh.in.sh:
	${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@

.in:
	${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
Natanael Copa's avatar
Natanael Copa committed
71 72

.PHONY:	all apk clean dist install uninstall
Natanael Copa's avatar
Natanael Copa committed
73 74 75 76
all:	$(SCRIPTS) $(BIN_FILES)

uniso:	uniso.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
Natanael Copa's avatar
Natanael Copa committed
77 78 79

apk:	$(APKF)

Natanael Copa's avatar
Natanael Copa committed
80
dist:	$(TARBZ2)
Natanael Copa's avatar
Natanael Copa committed
81 82


Natanael Copa's avatar
Natanael Copa committed
83
$(TARBZ2): $(DIST_FILES)
Natanael Copa's avatar
Natanael Copa committed
84 85 86
	rm -rf $(TMP)
	mkdir -p $(TMP)
	cp $(DIST_FILES) $(TMP)
Natanael Copa's avatar
Natanael Copa committed
87
	$(TAR) -cjf $@ $(TMP)
88
	rm -rf $(TMP)
Natanael Copa's avatar
Natanael Copa committed
89
	
Natanael Copa's avatar
Natanael Copa committed
90 91 92
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
93 94
	install -m 755 -d $(DESTDIR)/$(PREFIX)/sbin
	install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin
95 96
	install -m 755 -d $(DESTDIR)/$(PREFIX)/lib
	install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/lib
Natanael Copa's avatar
Natanael Copa committed
97 98
	install -m 755 -d $(DESTDIR)/$(sysconfdir)
	install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/$(sysconfdir)
Natanael Copa's avatar
Natanael Copa committed
99 100 101 102 103 104 105 106 107 108

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
109
	rm -rf $(SCRIPTS) $(BIN_FILES) $(TMP) $(TARBZ2)
Natanael Copa's avatar
Natanael Copa committed
110