Imported Upstream version 2.4.4p3
[debian/amanda] / client-src / Makefile.am
1 # Makefile for Amanda client programs.
2
3 INCLUDES =              -I$(top_srcdir)/common-src
4
5 lib_LTLIBRARIES =       libamclient.la
6 LIB_EXTENSION = la
7
8 libexec_PROGRAMS =      amandad calcsize killpgrp rundump runtar amqde selfcheck sendbackup sendsize versionsuffix
9
10 sbin_SCRIPTS =          @CLIENT_SCRIPTS_OPT@
11
12 libexec_SCRIPTS =       patch-system
13
14 if WANT_SAMBA
15 samba_sources = findpass.c
16 endif
17
18 if WANT_RUNTIME_PSEUDO_RELOC
19 AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
20 endif
21
22 libamclient_la_SOURCES= amandates.c             getfsent.c      \
23                         unctime.c               client_util.c   \
24                         $(samba_sources)
25
26 libamclient_la_LDFLAGS = -release $(VERSION)
27
28 ###
29 # Because libamanda includes routines (e.g. regex) provided by some system
30 # libraries, and because of the way libtool sets up the command line, we
31 # need to list libamanda twice here, first to override the system library
32 # routines, and second to pick up any references in the other libraries.
33 ###
34
35 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
36         libamclient.$(LIB_EXTENSION) \
37         ../common-src/libamanda.$(LIB_EXTENSION)
38
39 SUFFIXES =              .sh .pl
40
41 .pl:
42                         cat $< > $@
43                         chmod a+x $@
44                         -test -z "$(PERL)" || $(PERL) -c $@
45
46 .sh:
47                         cat $< > $@
48                         chmod a+x $@
49
50 # these are used for testing only:
51 TEST_PROGS = getfsent
52
53 EXTRA_PROGRAMS =        $(TEST_PROGS)
54
55 CLEANFILES = *.test.c
56
57 EXTRA_SCRIPTS =         amhpfixdevs             amsinixfixdevs
58
59 DISTCLEANFILES =        $(EXTRA_SCRIPTS)
60
61 EXTRA_DIST =            amhpfixdevs.sh          amsinixfixdevs.sh       \
62                         amandad-krb4.c          sendbackup-krb4.c       \
63                         sendbackup-krb4.h
64
65 sendbackup_SOURCES =    sendbackup.c            sendbackup.h    \
66                         sendbackup-dump.c       sendbackup-gnutar.c
67
68 noinst_HEADERS  =       amandates.h     getfsent.h      findpass.h      \
69                         client_util.h
70
71 install-exec-hook:
72         @list="$(sbin_SCRIPTS)"; \
73         for p in $$list; do \
74                 pa=$(DESTDIR)$(sbindir)/`echo $$p|sed '$(transform)'`; \
75                 echo chown $(BINARY_OWNER) $$pa; \
76                 chown $(BINARY_OWNER) $$pa; \
77                 echo chgrp $(SETUID_GROUP) $$pa; \
78                 chgrp $(SETUID_GROUP) $$pa; \
79         done
80         @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
81         for p in $$list; do \
82                 pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed '$(transform)'`; \
83                 echo chown $(BINARY_OWNER) $$pa; \
84                 chown $(BINARY_OWNER) $$pa; \
85                 echo chgrp $(SETUID_GROUP) $$pa; \
86                 chgrp $(SETUID_GROUP) $$pa; \
87         done
88 if WANT_SETUID_CLIENT
89         @list="calcsize killpgrp rundump runtar amqde"; \
90         for p in $$list; do \
91                 if echo "$(libexec_PROGRAMS)" | grep $$p >/dev/null 2>&1; then \
92                         pa=$(DESTDIR)$(libexecdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
93                         echo chown root $$pa; \
94                         chown root $$pa; \
95                         echo chmod u+s,o-rwx $$pa; \
96                         chmod u+s,o-rwx $$pa; \
97                 else true; \
98                 fi; \
99         done
100 endif
101
102 getfsent_SOURCES = getfsent.test.c
103
104 %.test.c: $(srcdir)/%.c
105         echo '#define TEST' >$@
106         echo '#include "$<"' >>$@