Makefile 2.24 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
VERSION		:= 2.11.1
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\
13 14
		setup-acf\
		setup-alpine\
Natanael Copa's avatar
Natanael Copa committed
15
		setup-apkcache\
16
		setup-apkrepos\
17
		setup-bootable\
Natanael Copa's avatar
Natanael Copa committed
18 19
		setup-disk\
		setup-dns\
20
		setup-gparted-desktop\
Natanael Copa's avatar
Natanael Copa committed
21 22 23
		setup-hostname\
		setup-interfaces\
		setup-keymap\
Natanael Copa's avatar
Natanael Copa committed
24
		setup-lbu\
Natanael Copa's avatar
Natanael Copa committed
25
		setup-mta\
26 27
		setup-ntp\
		setup-proxy\
28
		setup-sshd\
29
		setup-timezone\
30
		setup-xorg-base\
Natanael Copa's avatar
Natanael Copa committed
31 32
		update-conf

Natanael Copa's avatar
Natanael Copa committed
33
BIN_FILES	:= uniso
Natanael Copa's avatar
Natanael Copa committed
34

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

Natanael Copa's avatar
Natanael Copa committed
38

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

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

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

Natanael Copa's avatar
Natanael Copa committed
55 56 57 58

SED		:= sed
TAR		:= tar

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

.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
69 70

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

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

apk:	$(APKF)

Natanael Copa's avatar
Natanael Copa committed
78
dist:	$(TARBZ2)
Natanael Copa's avatar
Natanael Copa committed
79 80


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

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