Commit ec0c7a74 authored by Natanael Copa's avatar Natanael Copa
Browse files

move to .in files

parent f5905639
V=2.0_alpha7 VERSION := 2.0_alpha7
P=alpine-conf
PV=$(P)-$(V) sysconfdir ?= /etc/lbu
APKF=$(PV).apk
TARBZ2=$(PV).tar.bz2 P := alpine-conf
PREFIX?= PV := $(P)-$(VERSION)
TMP=$(PV) TARBZ2 := $(PV).tar.bz2
PREFIX ?=
LIB_FILES=libalpine.sh TMP := $(PV)
SBIN_FILES=albootstrap\
lbu\ LIB_FILES := libalpine.sh
setup-ads\ SBIN_FILES := albootstrap\
setup-alpine\ lbu\
setup-alpine-web\ setup-ads\
setup-cryptswap\ setup-alpine\
setup-disk\ setup-alpine-web\
setup-dns\ setup-cryptswap\
setup-hostname\ setup-disk\
setup-interfaces\ setup-dns\
setup-keymap\ setup-hostname\
setup-mta\ setup-interfaces\
setup-sendbug\ setup-keymap\
setup-webconf\ setup-mta\
update-conf setup-sendbug\
setup-webconf\
ETC_LBU_FILES=lbu.conf update-conf
EXTRA_DIST=Makefile README
SCRIPTS := $(LIB_FILES) $(SBIN_FILES)
DIST_FILES=$(LIB_FILES) $(SBIN_FILES) $(ETC_LBU_FILES) $(EXTRA_DIST) 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" DESC="Alpine configuration scripts"
WWW="http://alpinelinux.org/alpine-conf" 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 .PHONY: all apk clean dist install uninstall
all: all: $(SCRIPTS)
sed -i 's|^PREFIX=.*|PREFIX=$(PREFIX)|' $(SBIN_FILES)
apk: $(APKF) apk: $(APKF)
dist: $(TARBZ2) 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) $(TARBZ2): $(DIST_FILES)
rm -rf $(TMP) rm -rf $(TMP)
...@@ -63,8 +78,8 @@ install: ...@@ -63,8 +78,8 @@ install:
install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin install -m 755 $(SBIN_FILES) $(DESTDIR)/$(PREFIX)/sbin
install -m 755 -d $(DESTDIR)/$(PREFIX)/lib install -m 755 -d $(DESTDIR)/$(PREFIX)/lib
install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/lib install -m 755 $(LIB_FILES) $(DESTDIR)/$(PREFIX)/lib
install -m 755 -d $(DESTDIR)/etc/lbu install -m 755 -d $(DESTDIR)/$(sysconfdir)
install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/etc/lbu install -m 755 $(ETC_LBU_FILES) $(DESTDIR)/$(sysconfdir)
uninstall: uninstall:
for i in $(SBIN_FILES); do \ for i in $(SBIN_FILES); do \
...@@ -75,5 +90,5 @@ uninstall: ...@@ -75,5 +90,5 @@ uninstall:
done done
clean: clean:
rm -rf $(APKF) $(TMP) $(TARBZ2) rm -rf $(SCRIPTS) $(TMP) $(TARBZ2)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# bootstrap an alpine installation # bootstrap an alpine installation
VERSION=1.0 VERSION=2.0_alpha7
usage() { usage() {
echo "usage: $(basename $0) TARGETDIR" echo "usage: $(basename $0) TARGETDIR"
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
# Copyright (c) 2006 Natanael Copa # Copyright (c) 2006 Natanael Copa
# May be distributed under GPL2 # May be distributed under GPL2
VERSION=1.2 VERSION=2.0_alpha7
sysconfdir=@sysconfdir@
if [ ! -f ${libalpine:="./libalpine.sh"} ]; then if [ ! -f ${libalpine:="./libalpine.sh"} ]; then
libalpine=/usr/share/lbu/libalpine.sh libalpine=/usr/share/lbu/libalpine.sh
...@@ -14,12 +15,12 @@ if [ ! -f ${libalpine:="./libalpine.sh"} ]; then ...@@ -14,12 +15,12 @@ if [ ! -f ${libalpine:="./libalpine.sh"} ]; then
fi fi
. $libalpine || exit 1 . $libalpine || exit 1
EXCLUDE_LIST=/etc/lbu/exclude EXCLUDE_LIST="$sysconfdir"/exclude
INCLUDE_LIST=/etc/lbu/include INCLUDE_LIST="$sysconfdir"/include
DEFAULT_CIPHER="aes-256-cbc" DEFAULT_CIPHER="aes-256-cbc"
LBU_CONF=/etc/lbu/lbu.conf LBU_CONF="$sysconfdir"/lbu.conf
if [ -f "$LBU_CONF" ]; then if [ -f "$LBU_CONF" ]; then
. "$LBU_CONF" . "$LBU_CONF"
fi fi
...@@ -126,7 +127,7 @@ list_delete() { ...@@ -126,7 +127,7 @@ list_delete() {
# #
usage_include() { usage_include() {
echo "$PROGRAM $VERSION 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> ... usage: $PROGRAM include|inc|add [-rv] <file> ...
$PROGRAM include|inc|add [-v] -l $PROGRAM include|inc|add [-v] -l
...@@ -386,7 +387,7 @@ cmd_commit() { ...@@ -386,7 +387,7 @@ cmd_commit() {
usage_exclude() { usage_exclude() {
echo "$PROGRAM $VERSION 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> ... usage: $PROGRAM exclude|ex|delete [-rv] <file> ...
$PROGRAM exclude|ex|delete [-v] -l $PROGRAM exclude|ex|delete [-v] -l
......
#!/bin/sh #!/bin/sh
PREFIX= PREFIX=@PREFIX@
PROGRAM=`basename $0` PROGRAM=`basename $0`
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# * suggest DC server(s) based on # * suggest DC server(s) based on
# $(dig _kerberos._tcp.dc._msdcs.$DOMAIN SRV +short) # $(dig _kerberos._tcp.dc._msdcs.$DOMAIN SRV +short)
VERSION=0.1 VERSION=2.0_alpha7
PROGRAM=setup-ads PROGRAM=setup-ads
. $PREFIX/lib/libalpine.sh . $PREFIX/lib/libalpine.sh
......
#!/bin/sh #!/bin/sh
PROGRAM=setup-alpine PROGRAM=setup-alpine
VERSION=0.1 VERSION=2.0_alpha7
PREFIX= PREFIX=
. $PREFIX/lib/libalpine.sh . $PREFIX/lib/libalpine.sh
......
#!/bin/sh #!/bin/sh
PROGRAM=setup-acf PROGRAM=setup-acf
VERSION=0.1 VERSION=2.0_alpha7
PREFIX= PREFIX=
. $PREFIX/lib/libalpine.sh . $PREFIX/lib/libalpine.sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment