diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..7c634647 --- /dev/null +++ b/Makefile @@ -0,0 +1,88 @@ +RPM=$(HOME)/rpm +NAME = drakwizard +VERSION := 3.7.5 +TAR = $(NAME)-$(VERSION).tar.bz2 +prefix=/usr +# TODO: get WIZ_HOME take care of usr prefix +WIZ_HOME=/usr/share/wizards/ + +PERL_VENDORLIB=$(shell eval "`perl -V:installvendorlib`"; installvendorlib=$${installvendorlib\#/usr}; echo $$installvendorlib) + +WIZ = dhcp_wizard\ + dns_wizard\ + time_wizard\ + web_wizard\ + ftp_wizard\ + proxy_wizard\ + sshd_wizard + +OTHER = data\ + po + +all: + +# installs all the wizards... + +install: + mkdir -p ${prefix}/sbin + mkdir -p ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/ + install -p drakwizard.pl ${prefix}/sbin/drakwizard + perl -i -pe "s,(__WIZ_HOME__|\\\$$ENV{__WIZ_HOME__}),$(WIZ_HOME),g" ${prefix}/sbin/drakwizard + perl -i -pe "s|new IFCFG|new MDK::Wizard::IFCFG|g" common/Wizcommon.pm + for l in $(OTHER); do \ + $(MAKE) -C $$l $@; \ + done + install --mode=u=rw,g=r,o=r -p common/*.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/; \ + for l in $(WIZ); do \ + install --mode=u=rw,g=r,o=r -p $$l/*.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/; \ + if ls $$l/scripts/*.default &> /dev/null ; then \ + install --mode=u=rwx,g=rx,o=rx -d ${prefix}/share/wizards/$$l/scripts/; \ + install --mode=a=r -p $$l/scripts/*.default ${prefix}/share/wizards/$$l/scripts; \ + fi \ + done + for l in $(WIZ); do \ + if ls $$l/images/*.png &> /dev/null ; then \ + install --mode=u=rwx,g=rx,o=rx -d ${prefix}/share/wizards/$$l/images/; \ + install --mode=a=r -p $$l/images/*.png ${prefix}/share/wizards/$$l/images/;\ + fi \ + done + install --mode=a=r -p news_wizard/scripts/news.cron ${prefix}/share/wizards/news_wizard/scripts/; \ + find ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard -type f -regex ".*.pm$$" \ + -exec perl -i -pe "s,(\\\$$ENV{__WIZ_HOME__}|__WIZ_HOME__),$(WIZ_HOME),g" \{\} \; + +pitest: + cp samba_wizard/Samba.pm . + cp samba_wizard/Sambashare.pm . + perl -i -pe "s,\\\$$ENV{__WIZ_HOME__},$(WIZ_HOME),g" Samba.pm + grep defaultimage Samba.pm + +clean: + $(MAKE) -C po $@ + rm -f *~ + +dis: clean + find . -maxdepth 2 -name '*.p[lm]' -print0 | xargs -t -0 -n1 perl -cw \ + -I/usr/lib/libDrakX > /dev/null 2>&1 + rm -rf $(NAME)-$(VERSION) + svn export -q -rBASE . $(NAME)-$(VERSION) + tar cfY ../$(NAME)-$(VERSION).tar.lzma $(NAME)-$(VERSION) + rm -rf $(NAME)-$(VERSION) + +log: changelog +changelog: + ( svn2cl --authors=../../common/username --accum ; \ + rm -f ChangeLog.bak ; \ + svn commit -m "Generated by svn2cl the `date '+%c'`" ChangeLog ; \ + ) + +clean_test: + rm -rf test + +test: clean_test + @date + mkdir test + cp -r $(WIZ) test + cp Wizard.dtd Makefile drakwizard.pl drakwizard.spec test.pl test + find test -regex ".*\.wiz$$\|.*\.pm$$\|.*\.sh$$" -exec \ + perl -i -pe "s|__WIZ_HOME__|$(PWD)/test|g" \{\} \; + perl -i -pe "s|__WIZ_HOME__|$(PWD)/test|g" test/drakwizard.pl |