aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile103
-rw-r--r--albootstrap.in (renamed from albootstrap)2
-rw-r--r--lbu.in (renamed from lbu)13
-rwxr-xr-xlibalpine.sh.in (renamed from libalpine.sh)2
-rw-r--r--setup-ads.in (renamed from setup-ads)2
-rw-r--r--setup-alpine-web.in (renamed from setup-alpine-web)0
-rw-r--r--setup-alpine.in (renamed from setup-alpine)2
-rwxr-xr-xsetup-cryptswap.in (renamed from setup-cryptswap)0
-rw-r--r--setup-disk.in (renamed from setup-disk)0
-rwxr-xr-xsetup-dns.in (renamed from setup-dns)0
-rwxr-xr-xsetup-hostname.in (renamed from setup-hostname)0
-rwxr-xr-xsetup-interfaces.in (renamed from setup-interfaces)0
-rw-r--r--setup-keymap.in (renamed from setup-keymap)0
-rwxr-xr-xsetup-mta.in (renamed from setup-mta)0
-rwxr-xr-xsetup-sendbug.in (renamed from setup-sendbug)0
-rw-r--r--setup-webconf.in (renamed from setup-webconf)2
-rw-r--r--update-conf.in (renamed from update-conf)0
17 files changed, 71 insertions, 55 deletions
diff --git a/Makefile b/Makefile
index 36fe4c6..65e118b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,55 +1,70 @@
-V=2.0_alpha7
-P=alpine-conf
-PV=$(P)-$(V)
-APKF=$(PV).apk
-TARBZ2=$(PV).tar.bz2
-PREFIX?=
-TMP=$(PV)
-
-LIB_FILES=libalpine.sh
-SBIN_FILES=albootstrap\
- lbu\
- setup-ads\
- setup-alpine\
- setup-alpine-web\
- setup-cryptswap\
- setup-disk\
- setup-dns\
- setup-hostname\
- setup-interfaces\
- setup-keymap\
- setup-mta\
- setup-sendbug\
- setup-webconf\
- update-conf
-
-ETC_LBU_FILES=lbu.conf
-EXTRA_DIST=Makefile README
-
-DIST_FILES=$(LIB_FILES) $(SBIN_FILES) $(ETC_LBU_FILES) $(EXTRA_DIST)
+VERSION := 2.0_alpha7
+
+sysconfdir ?= /etc/lbu
+
+P := alpine-conf
+PV := $(P)-$(VERSION)
+TARBZ2 := $(PV).tar.bz2
+PREFIX ?=
+TMP := $(PV)
+
+LIB_FILES := libalpine.sh
+SBIN_FILES := albootstrap\
+ lbu\
+ setup-ads\
+ setup-alpine\
+ setup-alpine-web\
+ setup-cryptswap\
+ setup-disk\
+ setup-dns\
+ setup-hostname\
+ setup-interfaces\
+ setup-keymap\
+ setup-mta\
+ setup-sendbug\
+ setup-webconf\
+ update-conf
+
+SCRIPTS := $(LIB_FILES) $(SBIN_FILES)
+SCRIPT_SOURCES := $(addsuffix .in,$(SCRIPTS))
+
+ETC_LBU_FILES := lbu.conf
+EXTRA_DIST := Makefile README
+DIST_FILES := $(SCRIPT_SOURCES) $(ETC_LBU_FILES) $(EXTRA_DIST)
+
+GIT_REV := $(shell git describe || echo exported)
+ifneq ($(GIT_REV), exported)
+FULL_VERSION := $(patsubst $(PACKAGE)-%,%,$(GIT_REV))
+FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION))
+else
+FULL_VERSION := $(VERSION)
+endif
+
DESC="Alpine configuration scripts"
WWW="http://alpinelinux.org/alpine-conf"
-TAR=tar
-DB=$(TMP)/var/db/apk/$(PV)
+
+SED := sed
+TAR := tar
+
+SED_REPLACE := -i -e 's:@VERSION@:$(VERSION):g' \
+ -e 's:@PREFIX@:$(PREFIX):g'
+
+.SUFFIXES: .sh.in .in
+.sh.in.sh:
+ ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
+
+.in:
+ ${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@
.PHONY: all apk clean dist install uninstall
-all:
- sed -i 's|^PREFIX=.*|PREFIX=$(PREFIX)|' $(SBIN_FILES)
+all: $(SCRIPTS)
apk: $(APKF)
dist: $(TARBZ2)
-$(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)
$(TARBZ2): $(DIST_FILES)
rm -rf $(TMP)
@@ -63,8 +78,8 @@ install:
install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin
install -m 755 -d $(DESTDIR)/$(PREFIX)/lib
install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/lib
- install -m 755 -d $(DESTDIR)/etc/lbu
- install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/etc/lbu
+ install -m 755 -d $(DESTDIR)/$(sysconfdir)
+ install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/$(sysconfdir)
uninstall:
for i in $(SBIN_FILES); do \
@@ -75,5 +90,5 @@ uninstall:
done
clean:
- rm -rf $(APKF) $(TMP) $(TARBZ2)
+ rm -rf $(SCRIPTS) $(TMP) $(TARBZ2)
diff --git a/albootstrap b/albootstrap.in
index 2538fa3..fe3df60 100644
--- a/albootstrap
+++ b/albootstrap.in
@@ -2,7 +2,7 @@
# bootstrap an alpine installation
-VERSION=1.0
+VERSION=2.0_alpha7
usage() {
echo "usage: $(basename $0) TARGETDIR"
diff --git a/lbu b/lbu.in
index e26094f..69770e2 100644
--- a/lbu
+++ b/lbu.in
@@ -4,7 +4,8 @@
# Copyright (c) 2006 Natanael Copa
# May be distributed under GPL2
-VERSION=1.2
+VERSION=2.0_alpha7
+sysconfdir=@sysconfdir@
if [ ! -f ${libalpine:="./libalpine.sh"} ]; then
libalpine=/usr/share/lbu/libalpine.sh
@@ -14,12 +15,12 @@ if [ ! -f ${libalpine:="./libalpine.sh"} ]; then
fi
. $libalpine || exit 1
-EXCLUDE_LIST=/etc/lbu/exclude
-INCLUDE_LIST=/etc/lbu/include
+EXCLUDE_LIST="$sysconfdir"/exclude
+INCLUDE_LIST="$sysconfdir"/include
DEFAULT_CIPHER="aes-256-cbc"
-LBU_CONF=/etc/lbu/lbu.conf
+LBU_CONF="$sysconfdir"/lbu.conf
if [ -f "$LBU_CONF" ]; then
. "$LBU_CONF"
fi
@@ -126,7 +127,7 @@ list_delete() {
#
usage_include() {
echo "$PROGRAM $VERSION
-Add filename(s) to include list (/etc/lbu/include)
+Add filename(s) to include list ($sysconfdir/include)
usage: $PROGRAM include|inc|add [-rv] <file> ...
$PROGRAM include|inc|add [-v] -l
@@ -386,7 +387,7 @@ cmd_commit() {
usage_exclude() {
echo "$PROGRAM $VERSION
-Add filename(s) to exclude list (/etc/lbu/exclude)
+Add filename(s) to exclude list ($sysconfdir/exclude)
usage: $PROGRAM exclude|ex|delete [-rv] <file> ...
$PROGRAM exclude|ex|delete [-v] -l
diff --git a/libalpine.sh b/libalpine.sh.in
index 005d595..add5798 100755
--- a/libalpine.sh
+++ b/libalpine.sh.in
@@ -1,6 +1,6 @@
#!/bin/sh
-PREFIX=
+PREFIX=@PREFIX@
PROGRAM=`basename $0`
diff --git a/setup-ads b/setup-ads.in
index f538557..863028a 100644
--- a/setup-ads
+++ b/setup-ads.in
@@ -11,7 +11,7 @@
# * suggest DC server(s) based on
# $(dig _kerberos._tcp.dc._msdcs.$DOMAIN SRV +short)
-VERSION=0.1
+VERSION=2.0_alpha7
PROGRAM=setup-ads
. $PREFIX/lib/libalpine.sh
diff --git a/setup-alpine-web b/setup-alpine-web.in
index ca98d1f..ca98d1f 100644
--- a/setup-alpine-web
+++ b/setup-alpine-web.in
diff --git a/setup-alpine b/setup-alpine.in
index 504f850..418b7f4 100644
--- a/setup-alpine
+++ b/setup-alpine.in
@@ -1,7 +1,7 @@
#!/bin/sh
PROGRAM=setup-alpine
-VERSION=0.1
+VERSION=2.0_alpha7
PREFIX=
. $PREFIX/lib/libalpine.sh
diff --git a/setup-cryptswap b/setup-cryptswap.in
index 0ec11fc..0ec11fc 100755
--- a/setup-cryptswap
+++ b/setup-cryptswap.in
diff --git a/setup-disk b/setup-disk.in
index b7d8323..b7d8323 100644
--- a/setup-disk
+++ b/setup-disk.in
diff --git a/setup-dns b/setup-dns.in
index fd6b04e..fd6b04e 100755
--- a/setup-dns
+++ b/setup-dns.in
diff --git a/setup-hostname b/setup-hostname.in
index b1c2379..b1c2379 100755
--- a/setup-hostname
+++ b/setup-hostname.in
diff --git a/setup-interfaces b/setup-interfaces.in
index cfb4ad0..cfb4ad0 100755
--- a/setup-interfaces
+++ b/setup-interfaces.in
diff --git a/setup-keymap b/setup-keymap.in
index 5f53dc1..5f53dc1 100644
--- a/setup-keymap
+++ b/setup-keymap.in
diff --git a/setup-mta b/setup-mta.in
index 03af6bc..03af6bc 100755
--- a/setup-mta
+++ b/setup-mta.in
diff --git a/setup-sendbug b/setup-sendbug.in
index 9ce94d8..9ce94d8 100755
--- a/setup-sendbug
+++ b/setup-sendbug.in
diff --git a/setup-webconf b/setup-webconf.in
index 6a4ca84..9e11e99 100644
--- a/setup-webconf
+++ b/setup-webconf.in
@@ -1,7 +1,7 @@
#!/bin/sh
PROGRAM=setup-acf
-VERSION=0.1
+VERSION=2.0_alpha7
PREFIX=
. $PREFIX/lib/libalpine.sh
diff --git a/update-conf b/update-conf.in
index 6a8ab16..6a8ab16 100644
--- a/update-conf
+++ b/update-conf.in