1
2ACLOCAL_AMFLAGS = -I m4
3
4SUBDIRS = @HANDLERSOCKET_SUBDIRS@
5
6perl:
7	cd perl-Net-HandlerSocket && perl Makefile.PL && make
8
9install_perl:
10	cd perl-Net-HandlerSocket && make install
11
12rpms: rpm_cli rpm_perl rpm_c
13
14rpm_dir:
15	- mkdir dist
16	- mkdir dist/BUILD dist/RPMS dist/SOURCES dist/SPECS dist/SRPMS
17
18rpm_cli: clean_cli rpm_dir
19	sed -e "s/HANDLERSOCKET_VERSION/$(VERSION)/" \
20		libhsclient/libhsclient.spec.template \
21		> libhsclient/libhsclient.spec
22	tar cvfz dist/libhsclient.tar.gz libhsclient
23	rpmbuild --define "_topdir `pwd`/dist" -ta \
24		dist/libhsclient.tar.gz
25
26rpm_perl: clean_perl rpm_dir
27	sed -e "s/HANDLERSOCKET_VERSION/$(VERSION)/" \
28		perl-Net-HandlerSocket/perl-Net-HandlerSocket.spec.template \
29		> perl-Net-HandlerSocket/perl-Net-HandlerSocket.spec
30	cd perl-Net-HandlerSocket && perl Makefile.PL && make clean && \
31		rm -f Makefile.old
32	tar cvfz dist/perl-Net-HandlerSocket.tar.gz perl-Net-HandlerSocket
33	rpmbuild --define "_topdir `pwd`/dist" -ta \
34		dist/perl-Net-HandlerSocket.tar.gz
35
36rpm_c: clean_c rpm_dir
37	sed -e "s/HANDLERSOCKET_VERSION/$(VERSION)/" \
38		handlersocket/handlersocket.spec.template \
39		> handlersocket/handlersocket.spec
40	sed -e "s|HANDLERSOCKET_MYSQL_INC|$(MYSQL_CFLAGS) $(MYSQL_INC)|" \
41		-e "s|HANDLERSOCKET_MYSQL_LIB|$(MYSQL_LIB)|" \
42		handlersocket/Makefile.plain.template \
43		> handlersocket/Makefile.plain
44	tar cvfz dist/handlersocket.tar.gz handlersocket
45	rpmbuild --define "_topdir `pwd`/dist" -ta \
46		dist/handlersocket.tar.gz
47
48install_rpm_pl:
49	- sudo rpm -e perl-Net-HandlerSocket
50	- sudo rpm -e perl-Net-HandlerSocket-debuginfo
51	make clean
52	make rpm_perl
53	- sudo rpm -U dist/RPMS/*/perl*.rpm
54
55installrpms:
56	- sudo rpm -e handlersocket
57	- sudo rpm -e handlersocket-debuginfo
58	- sudo rpm -e perl-Net-HandlerSocket
59	- sudo rpm -e perl-Net-HandlerSocket-debuginfo
60	- sudo rpm -e libhsclient
61	- sudo rpm -e libhsclient-debuginfo
62	make clean
63	make rpm_cli
64	- sudo rpm -U dist/RPMS/*/libhsclient*.rpm
65	make clean
66	make rpm_perl
67	- sudo rpm -U dist/RPMS/*/perl*.rpm
68	make clean
69	make rpm_c
70	- sudo rpm -U dist/RPMS/*/handlersocket*.rpm
71
72clean_cli:
73	cd libhsclient && make clean
74	cd client && make clean
75
76clean_perl:
77	cd perl-Net-HandlerSocket && perl Makefile.PL && make clean && \
78                rm -f Makefile.old
79
80clean_c:
81	cd handlersocket && make clean
82
83clean_all: clean_cli clean_perl clean_c
84	cd regtest && make clean
85	rm -rf dist/*/*
86	rm -f dist/*.tar.gz
87
88