Commit ec0c7a74 authored by Natanael Copa's avatar Natanael Copa

move to .in files

parent f5905639
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)
......@@ -2,7 +2,7 @@
# bootstrap an alpine installation
VERSION=1.0
VERSION=2.0_alpha7
usage() {
echo "usage: $(basename $0) TARGETDIR"
......
......@@ -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
......
#!/bin/sh
PREFIX=
PREFIX=@PREFIX@
PROGRAM=`basename $0`
......
......@@ -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
......
#!/bin/sh
PROGRAM=setup-alpine
VERSION=0.1
VERSION=2.0_alpha7
PREFIX=
. $PREFIX/lib/libalpine.sh
......
#!/bin/sh
PROGRAM=setup-acf
VERSION=0.1
VERSION=2.0_alpha7
PREFIX=
. $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