chiark / gitweb /
rsync-backup.in, lib.sh.in: Move some definitions to a library.
[rsync-backup] / Makefile.am
1 ### -*-makefile-*-
2 ###
3 ### Build script for rsync-backup
4 ###
5 ### (c) 2012 Mark Wooding
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
10 ### This file is part of the `rsync-backup' program.
11 ###
12 ### rsync-backup is free software; you can redistribute it and/or modify
13 ### it under the terms of the GNU General Public License as published by
14 ### the Free Software Foundation; either version 2 of the License, or
15 ### (at your option) any later version.
16 ###
17 ### rsync-backup is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ### GNU General Public License for more details.
21 ###
22 ### You should have received a copy of the GNU General Public License
23 ### along with rsync-backup; if not, write to the Free Software Foundation,
24 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 bin_SCRIPTS              =
27 sbin_SCRIPTS             =
28 sbin_PROGRAMS            =
29 pkgdata_DATA             =
30 dist_noinst_SCRIPTS      =
31 dist_man_MANS            =
32 man_MANS                 =
33
34 EXTRA_DIST               =
35 EXTRA_PROGRAMS           =
36 CLEANFILES               =
37 DISTCLEANFILES           =
38
39 AM_CFLAGS                = $(mLib_CFLAGS)
40
41 ###--------------------------------------------------------------------------
42 ### Substitution of configuration data.
43
44 confsubst = $(top_srcdir)/config/confsubst
45 EXTRA_DIST              += config/confsubst
46
47 SUBSTVARS = \
48         PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \
49         BASH="$(BASH)" PYTHON="$(PYTHON)" \
50         sysconfdir="$(sysconfdir)" \
51         mntbkpdir="$(mntbkpdir)" \
52         fshashdir="$(fshashdir)" \
53         pkglocalstatedir="$(localstatedir)/lib/bkp" \
54         pkgdatadir="$(pkgdatadir)" \
55         logdir="$(logdir)"
56
57 V_SUBST = $(V_SUBST_$V)
58 V_SUBST_= $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
59 V_SUBST_0 = @printf "  SUBST  %s\n" $@;
60
61 SUBST = $(V_SUBST)$(confsubst)
62
63 ###--------------------------------------------------------------------------
64 ### Programs and scripts.
65
66 EXTRA_PROGRAMS          += rfreezefs
67 rfreezefs_SOURCES        = rfreezefs.c
68 rfreezefs_LDADD          = $(mLib_LIBS)
69 EXTRA_DIST              += rfreezefs.8
70 if HAVE_MLIB
71 sbin_PROGRAMS           += rfreezefs
72 man_MANS                += rfreezefs.8
73 endif
74
75 pkgdata_DATA            += lib.sh
76 CLEANFILES              += lib.sh
77 EXTRA_DIST              += lib.sh.in
78 lib.sh: lib.sh.in Makefile
79         $(SUBST) >lib.sh.new $(srcdir)/lib.sh.in $(SUBSTVARS) && \
80                 mv lib.sh.new lib.sh
81
82 sbin_SCRIPTS            += rsync-backup
83 dist_man_MANS           += rsync-backup.8
84 CLEANFILES              += rsync-backup
85 EXTRA_DIST              += rsync-backup.in
86 rsync-backup: rsync-backup.in Makefile
87         $(SUBST) >rsync-backup.new \
88                         $(srcdir)/rsync-backup.in $(SUBSTVARS) && \
89                 chmod +x rsync-backup.new && \
90                 mv rsync-backup.new rsync-backup
91
92 sbin_SCRIPTS            += update-bkp-index
93 dist_man_MANS           += update-bkp-index.8
94 CLEANFILES              += update-bkp-index
95 EXTRA_DIST              += update-bkp-index.in
96 update-bkp-index: update-bkp-index.in Makefile
97         $(SUBST) >update-bkp-index.new \
98                         $(srcdir)/update-bkp-index.in $(SUBSTVARS) && \
99                 chmod +x update-bkp-index.new && \
100                 mv update-bkp-index.new update-bkp-index
101
102 bin_SCRIPTS             += fshash
103 dist_man_MANS           += fshash.1
104 CLEANFILES              += fshash
105 EXTRA_DIST              += fshash.in
106 fshash: fshash.in Makefile
107         $(SUBST) >fshash.new \
108                         $(srcdir)/fshash.in $(SUBSTVARS) && \
109                 chmod +x fshash.new && \
110                 mv fshash.new fshash
111
112 ###--------------------------------------------------------------------------
113 ### Contributed scripts.
114
115 ## Some simple scripts showing how one might create and manage backup
116 ## volumes.  Assume the distorted.org.uk key management machinery.
117 dist_noinst_SCRIPTS     += create-backup-volume
118 dist_noinst_SCRIPTS     += mount-backup-volume
119 dist_noinst_SCRIPTS     += umount-backup-volume
120
121 ###--------------------------------------------------------------------------
122 ### Release machinery.
123
124 EXTRA_DIST              += config/auto-version
125
126 dist-hook:
127         echo $(VERSION) >$(distdir)/RELEASE
128
129 ###--------------------------------------------------------------------------
130 ### Debian packaging.
131
132 EXTRA_DIST              += debian/copyright debian/changelog
133 EXTRA_DIST              += debian/control debian/rules
134 EXTRA_DIST              += debian/compat
135
136 ## fshash
137 EXTRA_DIST              += debian/fshash.install
138
139 ## rfreezefs
140 EXTRA_DIST              += debian/rfreezefs.install
141
142 ## rsync-backup
143 EXTRA_DIST              += debian/rsync-backup.install
144 EXTRA_DIST              += debian/rsync-backup.examples
145
146 ###----- That's all, folks --------------------------------------------------