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

« back to all changes in this revision

Viewing changes to .pc/perlsharedir.patch/tools/altperl/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2010-04-17 23:06:42 UTC
  • mfrom: (1.1.12 upstream) (2.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20100417230642-fhld39orcligbnm4
Tags: 1.2.21-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ----------
 
2
# Makefile
 
3
#
 
4
#       Copyright (c) 2003-200, PostgreSQL Global Development Group
 
5
#       $Id: Makefile,v 1.14.2.2 2009-08-17 17:39:58 devrim Exp $
 
6
#
 
7
# ----------
 
8
 
 
9
slony_subdir = tools/altperl
 
10
slony_top_builddir = ../..
 
11
include $(slony_top_builddir)/Makefile.global
 
12
 
 
13
DISTFILES = Makefile ToDo README $(wildcard *.pl) $(wildcard *.pm) slon_tools.conf-sample
 
14
 
 
15
all:
 
16
ifdef toolsbin
 
17
ifndef PERL
 
18
        @echo "The altperl tools require that Perl be installed."
 
19
        exit 1;
 
20
endif
 
21
ifndef SED
 
22
        @echo "sed is required to build the altperl tools."
 
23
        exit 1;
 
24
endif
 
25
        @for file in $(wildcard *.pl) $(wildcard *.pm); do \
 
26
                tmpname=`echo $$file | $(SED) "s#\.p[lm]##"` && \
 
27
                $(SED) -e "s#@@PERL@@#$(PERL)#;" \
 
28
                       -e "s#@@SYSCONFDIR@@#$(sysconfdir)#;" \
 
29
                       -e "s#@@PGLIBDIR@@#$(pglibdir)#;" \
 
30
                       -e "s#@@PGBINDIR@@#$(pgbindir)#;" \
 
31
                       -e "s#@@SLONBINDIR@@#$(slonbindir)#;" \
 
32
                       -e "s#@@TOOLSBIN@@#$(toolsbin)#;" \
 
33
                       $$file > $$tmpname && \
 
34
                chmod 755 $$tmpname \
 
35
                || exit; \
 
36
        done
 
37
endif
 
38
 
 
39
install: installdirs
 
40
ifndef toolsbin
 
41
        @echo "The altperl tools won't be installed unless --with-perltools is specified in configure"
 
42
else
 
43
        $(INSTALL_DATA)   slon_tools.conf-sample $(DESTDIR)$(sysconfdir)
 
44
        $(INSTALL_DATA)   slon-tools             $(DESTDIR)$(perlsharedir)/slon-tools.pm
 
45
        for file in $(wildcard *.pl) ; do \
 
46
                tmpname=`echo $$file | $(SED) "s#\.pl##"` && \
 
47
                $(INSTALL_SCRIPT) $$tmpname $(DESTDIR)$(toolsbin) \
 
48
                || exit; \
 
49
        done
 
50
endif
 
51
 
 
52
installdirs:
 
53
        $(mkinstalldirs) $(DESTDIR)$(sysconfdir)
 
54
        $(mkinstalldirs) $(DESTDIR)$(pglibdir)
 
55
        $(mkinstalldirs) $(DESTDIR)$(toolsbin)
 
56
 
 
57
distdir: $(DISTFILES)
 
58
        mkdir $(distdir)/$(subdir)
 
59
        -chmod 777 $(distdir)/$(subdir)
 
60
        for file in $(DISTFILES) ; do \
 
61
                cp $$file $(distdir)/$(subdir)/$$file || exit; \
 
62
        done
 
63
 
 
64
clean distclean maintainer-clean:
 
65
        @for file in $(wildcard *.pl) $(wildcard *.pm); do \
 
66
                tmpname=`echo $$file | $(SED) "s#\.p[lm]##"` && \
 
67
                rm -f $$tmpname \
 
68
                || exit; \
 
69
        done