summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: a4de634865e34409fbf2071d16f03d406582c3b8 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
RPM=$(HOME)/rpm
NAME = drakwizard
TAR = $(NAME).tar.bz2

# 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\
	client_wizard\
	server_wizard\
	dns_wizard\
	postfix_wizard\
	samba_wizard\
	time_wizard\
	web_wizard\
	ftp_wizard\
	news_wizard\
	proxy_wizard\
	nfs_wizard

OTHER = data\
        po

all:

# installs all the wizards...

install:
	mkdir -p ${prefix}/sbin
	mkdir -p --mode=u=rwx,g=rx,o=rx  ${prefix}/share/wizards/client_wizard/images
	mkdir -p ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/
	install -p drakwizard.pl ${prefix}/sbin/drakwizard
	perl -i -pe "s|__WIZ_HOME__|$(WIZ_HOME)/|g; s|$$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/; \
	        install --mode=a=r -p $$l/images/*.png ${prefix}/share/wizards/client_wizard/images; \
	done
	find ${prefix}/share/wizards -type f -regex ".*\.wiz$$\|.*.pm$$\|.*\.sh$$" -exec \
		perl -i -pe "s|__WIZ_HOME__|$(WIZ_HOME)|g; s|$$ENV{__WIZ_HOME__}|$(WIZ_HOME)/|g" \{\} \;

clean:
	$(MAKE) -C po $@
	rm -f *~

dis: clean
	cd ..; cp -rf wizard_perl $(NAME)
	cd ..; tar cf - $(NAME) | bzip2 -9 > $(TAR)
	cd ..; rm -rf $(NAME)

changelog: ../common/username
	( cvs2cl -U ../common/username -I ChangeLog -I tmp/ ; \
	rm -f ChangeLog.bak ; \
	cvs commit -m "Generated by cvs2cl the `date '+%c'`" ChangeLog ; \
	)

cvstag:
	cvs commit
	cvs tag $(RELTAG)

rpm: changelog cvstag dis ../$(NAME)-$(VERSION).tar.bz2 $(RPM)
	cp -f ../$(NAME)-$(VERSION).tar.bz2 $(RPM)/SOURCES
	-rpm -ba --clean $(NAME).spec
	rm -f ../$(NAME)-$(VERSION).tar.bz2

localrpm: dis
	cp -f ../$(TAR) $(RPM)/SOURCES
	cp -f $(NAME).spec $(RPM)/SPECS/
	-rpm -ba $(NAME).spec
	rm -f ../$(TAR)

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