1 |
RPM=$(HOME)/rpm |
2 |
NAME = drakwizard |
3 |
VERSION := 3.10 |
4 |
TAR = $(NAME)-$(VERSION).tar.bz2 |
5 |
prefix=/usr |
6 |
# TODO: get WIZ_HOME take care of usr prefix |
7 |
WIZ_HOME=/usr/share/wizards/ |
8 |
|
9 |
PERL_VENDORLIB=$(shell eval "`perl -V:installvendorlib`"; installvendorlib=$${installvendorlib\#/usr}; echo $$installvendorlib) |
10 |
|
11 |
WIZ = dhcp_wizard\ |
12 |
dns_wizard\ |
13 |
time_wizard\ |
14 |
web_wizard\ |
15 |
ftp_wizard\ |
16 |
proxy_wizard\ |
17 |
sshd_wizard |
18 |
|
19 |
OTHER = data\ |
20 |
po |
21 |
|
22 |
all: |
23 |
|
24 |
# installs all the wizards... |
25 |
|
26 |
install: |
27 |
mkdir -p ${prefix}/sbin |
28 |
mkdir -p ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/ |
29 |
install -p drakwizard.pl ${prefix}/sbin/drakwizard |
30 |
perl -i -pe "s,(__WIZ_HOME__|\\\$$ENV{__WIZ_HOME__}),$(WIZ_HOME),g" ${prefix}/sbin/drakwizard |
31 |
perl -i -pe "s|new IFCFG|new MDK::Wizard::IFCFG|g" common/Wizcommon.pm |
32 |
for l in $(OTHER); do \ |
33 |
$(MAKE) -C $$l $@; \ |
34 |
done |
35 |
install --mode=u=rw,g=r,o=r -p common/*.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/; \ |
36 |
for l in $(WIZ); do \ |
37 |
install --mode=u=rw,g=r,o=r -p $$l/*.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/; \ |
38 |
if ls $$l/scripts/*.default &> /dev/null ; then \ |
39 |
install --mode=u=rwx,g=rx,o=rx -d ${prefix}/share/wizards/$$l/scripts/; \ |
40 |
install --mode=a=r -p $$l/scripts/*.default ${prefix}/share/wizards/$$l/scripts; \ |
41 |
fi \ |
42 |
done |
43 |
for l in $(WIZ); do \ |
44 |
if ls $$l/images/*.png &> /dev/null ; then \ |
45 |
install --mode=u=rwx,g=rx,o=rx -d ${prefix}/share/wizards/$$l/images/; \ |
46 |
install --mode=a=r -p $$l/images/*.png ${prefix}/share/wizards/$$l/images/;\ |
47 |
fi \ |
48 |
done |
49 |
install --mode=a=r -p news_wizard/scripts/news.cron ${prefix}/share/wizards/news_wizard/scripts/; \ |
50 |
find ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard -type f -regex ".*.pm$$" \ |
51 |
-exec perl -i -pe "s,(\\\$$ENV{__WIZ_HOME__}|__WIZ_HOME__),$(WIZ_HOME),g" \{\} \; |
52 |
|
53 |
pitest: |
54 |
cp samba_wizard/Samba.pm . |
55 |
cp samba_wizard/Sambashare.pm . |
56 |
perl -i -pe "s,\\\$$ENV{__WIZ_HOME__},$(WIZ_HOME),g" Samba.pm |
57 |
grep defaultimage Samba.pm |
58 |
|
59 |
clean: |
60 |
$(MAKE) -C po $@ |
61 |
rm -f *~ |
62 |
|
63 |
dist: clean |
64 |
find . -maxdepth 2 -name '*.p[lm]' -print0 | xargs -t -0 -n1 perl -cw \ |
65 |
-I/usr/lib/libDrakX > /dev/null 2>&1 |
66 |
rm -rf ../$(NAME)-$(VERSION).tar* |
67 |
@if [ -e ".svn" ]; then \ |
68 |
$(MAKE) dist-svn; \ |
69 |
elif [ -e ".git" ]; then \ |
70 |
$(MAKE) dist-git; \ |
71 |
else \ |
72 |
echo "Unknown SCM (not SVN nor GIT)";\ |
73 |
exit 1; \ |
74 |
fi; |
75 |
$(info $(NAME)-$(VERSION).tar.xz is ready) |
76 |
|
77 |
dist-svn: |
78 |
rm -rf $(NAME)-$(VERSION) |
79 |
svn export -q -rBASE . $(NAME)-$(VERSION) |
80 |
tar cfa ../$(NAME)-$(VERSION).tar.xz $(NAME)-$(VERSION) |
81 |
rm -rf $(NAME)-$(VERSION) |
82 |
|
83 |
dist-git: |
84 |
@git archive --prefix=$(NAME)-$(VERSION)/ HEAD | xz >../$(NAME)-$(VERSION).tar.xz; |
85 |
|
86 |
log: changelog |
87 |
changelog: |
88 |
( svn2cl --authors=../../common/username --accum ; \ |
89 |
rm -f ChangeLog.bak ; \ |
90 |
svn commit -m "Generated by svn2cl the `date '+%c'`" ChangeLog ; \ |
91 |
) |
92 |
|
93 |
clean_test: |
94 |
rm -rf test |
95 |
|
96 |
test: clean_test |
97 |
@date |
98 |
mkdir test |
99 |
cp -r $(WIZ) test |
100 |
cp Wizard.dtd Makefile drakwizard.pl drakwizard.spec test.pl test |
101 |
find test -regex ".*\.wiz$$\|.*\.pm$$\|.*\.sh$$" -exec \ |
102 |
perl -i -pe "s|__WIZ_HOME__|$(PWD)/test|g" \{\} \; |
103 |
perl -i -pe "s|__WIZ_HOME__|$(PWD)/test|g" test/drakwizard.pl |