~ubuntu-branches/ubuntu/maverick/slony1/maverick

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
# ----------
# Makefile
#
#	Copyright (c) 2003-200, PostgreSQL Global Development Group
#       $Id: Makefile,v 1.14.2.2 2009-08-17 17:39:58 devrim Exp $
#
# ----------

slony_subdir = tools/altperl
slony_top_builddir = ../..
include $(slony_top_builddir)/Makefile.global

DISTFILES = Makefile ToDo README $(wildcard *.pl) $(wildcard *.pm) slon_tools.conf-sample

all:
ifdef toolsbin
ifndef PERL
	@echo "The altperl tools require that Perl be installed."
	exit 1;
endif
ifndef SED
	@echo "sed is required to build the altperl tools."
	exit 1;
endif
	@for file in $(wildcard *.pl) $(wildcard *.pm); do \
		tmpname=`echo $$file | $(SED) "s#\.p[lm]##"` && \
		$(SED) -e "s#@@PERL@@#$(PERL)#;" \
                       -e "s#@@SYSCONFDIR@@#$(sysconfdir)#;" \
                       -e "s#@@PGLIBDIR@@#$(pglibdir)#;" \
                       -e "s#@@PGBINDIR@@#$(pgbindir)#;" \
                       -e "s#@@SLONBINDIR@@#$(slonbindir)#;" \
                       -e "s#@@TOOLSBIN@@#$(toolsbin)#;" \
                       $$file > $$tmpname && \
		chmod 755 $$tmpname \
		|| exit; \
	done
endif

install: installdirs
ifndef toolsbin
	@echo "The altperl tools won't be installed unless --with-perltools is specified in configure"
else
	$(INSTALL_DATA)   slon_tools.conf-sample $(DESTDIR)$(sysconfdir)
	$(INSTALL_DATA)   slon-tools             $(DESTDIR)$(perlsharedir)/slon-tools.pm
	for file in $(wildcard *.pl) ; do \
		tmpname=`echo $$file | $(SED) "s#\.pl##"` && \
		$(INSTALL_SCRIPT) $$tmpname $(DESTDIR)$(toolsbin) \
		|| exit; \
	done
endif

installdirs:
	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
	$(mkinstalldirs) $(DESTDIR)$(pglibdir)
	$(mkinstalldirs) $(DESTDIR)$(toolsbin)

distdir: $(DISTFILES)
	mkdir $(distdir)/$(subdir)
	-chmod 777 $(distdir)/$(subdir)
	for file in $(DISTFILES) ; do \
		cp $$file $(distdir)/$(subdir)/$$file || exit; \
	done

clean distclean maintainer-clean:
	@for file in $(wildcard *.pl) $(wildcard *.pm); do \
		tmpname=`echo $$file | $(SED) "s#\.p[lm]##"` && \
		rm -f $$tmpname \
		|| exit; \
	done