blob: e42ff2eb60932e4ba12c2fe13a8a8c1a410681f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# $Id$
# Variables
PATH = /usr/local/lib/bcfg2/bin:/usr/local/bin:/usr/bin:/bin
CHEETAH = /usr/local/lib/bcfg2/bin/cheetah
# Main
.PHONY : all clean fill copy fix encap test cheetah
.SUFFIXES :
BD = /usr/local
ED = ${BD}/encap
export ED
all : encap
clean :
for DIR in `find . -type d | grep -v "\.svn"`; do \
for GLOB in \#\* \*\~ \*.out\*; do \
(rm $${DIR}/$${GLOB} 2>/dev/null || true); \
done; \
done
fill : clean
$(CHEETAH) fill -R --oext out
copy : fill
EN=`cat bcfg2-site-RENAME/encapname.out` && \
( test ! -d $$ED/bcfg2-site-$${EN} || rm -rf $$ED/bcfg2-site-$${EN} ) && \
for SRC in `find bcfg2-site-RENAME | grep -v svn | grep -v tmpl`; do \
DEST=$$ED/`printf "$$SRC" | sed s/RENAME/$$EN/g | sed s/\.out//g`; \
if [ -d $$SRC ]; then mkdir $$DEST; else cp $$SRC $$DEST; fi; \
done
fix : copy
EN="$$ED/bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \
chown -R 0 $$EN && chgrp -R 0 $$EN && \
find $$EN -type d | xargs -n1 chmod 0755 && \
find $$EN -type f | xargs -n1 chmod 0644 && \
chmod 0600 $$EN/etc/ostiary.cfg && \
chmod 0600 $$EN/etc/bcfg2.conf && \
chmod 0755 $$EN/sbin/ost-bcfg2.sh && \
chmod 0755 $$EN/postinstall && \
chmod 0755 $$EN/preinstall
encap : fix
EN="bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \
cd $$ED && \
( test ! -f $${EN}-encap-*.tar.gz || rm $${EN}-encap-*.tar.gz ) && \
mkencap -c $$EN
EN="bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \
mv $$ED/$${EN}-encap-*.tar.gz .
test :
: $(PATH)
$(CHEETAH) test
cheetah :
$(CHEETAH) $(ARGS)
|