3 ### Build script for distorted.org.uk backup system
5 ### (c) 2011 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of the distorted.org.uk backup suite.
12 ### distorted-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.
17 ### distorted-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.
22 ### You should have received a copy of the GNU General Public License along
23 ### with distorted-backup; if not, write to the Free Software Foundation,
24 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 npkglibdir = $(pkglibdir)
43 snaplibexecdir = $(libexecdir)/snap
46 bkplibexecdir = $(libexecdir)/bkp
49 AM_CFLAGS = $(mLib_CFLAGS) $(nettle_CFLAGS)
51 ###--------------------------------------------------------------------------
52 ### Substitution of configuration data.
54 confsubst = $(top_srcdir)/config/confsubst
55 EXTRA_DIST += config/confsubst
58 PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \
60 prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
61 sbindir="$(sbindir)" \
62 sysconfdir="$(sysconfdir)" \
63 pkglibdir="$(pkglibdir)" \
64 bkplibexecdir="$(bkplibexecdir)" \
65 snaplibexecdir="$(snaplibexecdir)" \
66 pkglibexecdir="$(pkglibexecdir)"
68 SUBST = $(AM_V_GEN)$(confsubst)
70 ###--------------------------------------------------------------------------
73 ## Remote filesystem freezing tool.
74 sbin_PROGRAMS += rfreezefs
75 dist_man_MANS += rfreezefs.8
76 rfreezefs_SOURCES = rfreezefs.c
77 rfreezefs_LDADD = $(mLib_LIBS)
79 ## LVM snapshot removal nanny.
80 sbin_SCRIPTS += lvm-rmsnap
81 dist_man_MANS += lvm-rmsnap.8
82 EXTRA_DIST += lvm-rmsnap.in
83 CLEANFILES += lvm-rmsnap
84 lvm-rmsnap: lvm-rmsnap.in Makefile
85 $(SUBST) $(srcdir)/lvm-rmsnap.in $(SUBSTVARS) >lvm-rmsnap.new && \
86 chmod +x lvm-rmsnap.new && mv lvm-rmsnap.new lvm-rmsnap
92 snap: snap.in Makefile
93 $(SUBST) $(srcdir)/snap.in $(SUBSTVARS) >snap.new && \
94 chmod +x snap.new && mv snap.new snap
97 EXTRA_DIST += snap.8.in
99 snap.8: snap.8.in Makefile
100 $(SUBST) $(srcdir)/snap.8.in $(SUBSTVARS) >snap.8.new && \
103 man_MANS += snaptab.5
104 EXTRA_DIST += snaptab.5.in
105 CLEANFILES += snaptab.5
106 snaptab.5: snaptab.5.in Makefile
107 $(SUBST) $(srcdir)/snaptab.5.in $(SUBSTVARS) >snaptab.5.new && \
108 mv snaptab.5.new snaptab.5
110 ## Snapshot handlers.
111 snaplibexec_SCRIPTS += snap.lvm
112 dist_man_MANS += snap.lvm.8
113 EXTRA_DIST += snap.lvm
115 snaplibexec_SCRIPTS += snap.ro
116 dist_man_MANS += snap.ro.8
117 EXTRA_DIST += snap.ro
119 snaplibexec_SCRIPTS += snap.trivial
120 dist_man_MANS += snap.trivial.8
121 EXTRA_DIST += snap.trivial
123 snaplibexec_SCRIPTS += snap.rfreezefs
124 dist_man_MANS += snap.rfreezefs.8
125 EXTRA_DIST += snap.rfreezefs.in
126 CLEANFILES += snap.rfreezefs
127 snap.rfreezefs: snap.rfreezefs.in Makefile
128 $(SUBST) $(srcdir)/snap.rfreezefs.in $(SUBSTVARS) \
129 >snap.rfreezefs.new && \
130 chmod +x snap.rfreezefs.new && \
131 mv snap.rfreezefs.new snap.rfreezefs
133 ###--------------------------------------------------------------------------
134 ### Backup utilities.
136 ## Hashing rmt clone.
137 pkglibexec_PROGRAMS += rmt
139 rmt_LDADD = $(mLib_LIBS) $(nettle_LIBS)
141 ## Backup archive administration tool.
142 sbin_SCRIPTS += bkpadmin
143 ##dist_man_MANS += bkpadmin.8
144 EXTRA_DIST += bkpadmin.in
145 CLEANFILES += bkpadmin
146 bkpadmin: bkpadmin.in Makefile
147 $(SUBST) $(srcdir)/bkpadmin.in $(SUBSTVARS) >bkpadmin.new && \
148 chmod +x bkpadmin.new && mv bkpadmin.new bkpadmin
150 ## Backup client driver.
152 ##dist_man_MANS += bkp.8
156 $(SUBST) $(srcdir)/bkp.in $(SUBSTVARS) >bkp.new && \
157 chmod +x bkp.new && mv bkp.new bkp
159 ## Type handler utility library.
160 npkglib_DATA += bkpfunc.sh
161 EXTRA_DIST += bkpfunc.sh
163 ## Backup type handlers.
164 bkplibexec_SCRIPTS += bkp.dump
165 ##dist_man_MANS += bkp.dump.8
166 EXTRA_DIST += bkp.dump.in
167 CLEANFILES += bkp.dump
168 bkp.dump: bkp.dump.in Makefile
169 $(SUBST) $(srcdir)/bkp.dump.in $(SUBSTVARS) >bkp.dump.new && \
170 chmod +x bkp.dump.new && mv bkp.dump.new bkp.dump
172 ###--------------------------------------------------------------------------
175 EXTRA_DIST += config/auto-version
178 echo $(VERSION) >$(distdir)/RELEASE
180 ###----- That's all, folks --------------------------------------------------