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.
42 snaplibexecdir = $(libexecdir)/snap
45 bkplibexecdir = $(libexecdir)/bkp
48 AM_CFLAGS = $(mLib_CFLAGS) $(nettle_CFLAGS)
50 ###--------------------------------------------------------------------------
51 ### Substitution of configuration data.
53 confsubst = $(top_srcdir)/config/confsubst
54 EXTRA_DIST += config/confsubst
57 PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \
59 prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
60 sbindir="$(sbindir)" \
61 sysconfdir="$(sysconfdir)" \
62 pkglibdir="$(pkglibdir)" \
63 bkplibexecdir="$(bkplibexecdir)" \
64 snaplibexecdir="$(snaplibexecdir)" \
65 pkglibexecdir="$(pkglibexecdir)"
67 SUBST = $(AM_V_GEN)$(confsubst)
69 ###--------------------------------------------------------------------------
72 ## Remote filesystem freezing tool.
73 sbin_PROGRAMS += rfreezefs
74 dist_man_MANS += rfreezefs.8
75 rfreezefs_SOURCES = rfreezefs.c
76 rfreezefs_LDADD = $(mLib_LIBS)
78 ## LVM snapshot removal nanny.
79 sbin_SCRIPTS += lvm-rmsnap
80 dist_man_MANS += lvm-rmsnap.8
81 EXTRA_DIST += lvm-rmsnap.in
82 CLEANFILES += lvm-rmsnap
83 lvm-rmsnap: lvm-rmsnap.in Makefile
84 $(SUBST) $(srcdir)/lvm-rmsnap.in $(SUBSTVARS) >lvm-rmsnap.new && \
85 chmod +x lvm-rmsnap.new && mv lvm-rmsnap.new lvm-rmsnap
91 snap: snap.in Makefile
92 $(SUBST) $(srcdir)/snap.in $(SUBSTVARS) >snap.new && \
93 chmod +x snap.new && mv snap.new snap
96 EXTRA_DIST += snap.8.in
98 snap.8: snap.8.in Makefile
99 $(SUBST) $(srcdir)/snap.8.in $(SUBSTVARS) >snap.8.new && \
102 man_MANS += snaptab.5
103 EXTRA_DIST += snaptab.5.in
104 CLEANFILES += snaptab.5
105 snaptab.5: snaptab.5.in Makefile
106 $(SUBST) $(srcdir)/snaptab.5.in $(SUBSTVARS) >snaptab.5.new && \
107 mv snaptab.5.new snaptab.5
109 ## Snapshot handlers.
110 snaplibexec_SCRIPTS += snap.lvm
111 dist_man_MANS += snap.lvm.8
112 EXTRA_DIST += snap.lvm
114 snaplibexec_SCRIPTS += snap.ro
115 dist_man_MANS += snap.ro.8
116 EXTRA_DIST += snap.ro
118 snaplibexec_SCRIPTS += snap.trivial
119 dist_man_MANS += snap.trivial.8
120 EXTRA_DIST += snap.trivial
122 snaplibexec_SCRIPTS += snap.rfreezefs
123 dist_man_MANS += snap.rfreezefs.8
124 EXTRA_DIST += snap.rfreezefs.in
125 CLEANFILES += snap.rfreezefs
126 snap.rfreezefs: snap.rfreezefs.in Makefile
127 $(SUBST) $(srcdir)/snap.rfreezefs.in $(SUBSTVARS) \
128 >snap.rfreezefs.new && \
129 chmod +x snap.rfreezefs.new && \
130 mv snap.rfreezefs.new snap.rfreezefs
132 ###--------------------------------------------------------------------------
133 ### Backup utilities.
135 ## Hashing rmt clone.
136 pkglibexec_PROGRAMS += rmt
138 rmt_LDADD = $(mLib_LIBS) $(nettle_LIBS)
140 ## Backup archive administration tool.
141 sbin_SCRIPTS += bkpadmin
142 ##dist_man_MANS += bkpadmin.8
143 EXTRA_DIST += bkpadmin.in
144 CLEANFILES += bkpadmin
145 bkpadmin: bkpadmin.in Makefile
146 $(SUBST) $(srcdir)/bkpadmin.in $(SUBSTVARS) >bkpadmin.new && \
147 chmod +x bkpadmin.new && mv bkpadmin.new bkpadmin
149 ## Backup client driver.
151 ##dist_man_MANS += bkp.8
155 $(SUBST) $(srcdir)/bkp.in $(SUBSTVARS) >bkp.new && \
156 chmod +x bkp.new && mv bkp.new bkp
158 ## Type handler utility library.
159 pkglib_DATA += bkpfunc.sh
160 EXTRA_DIST += bkpfunc.sh
162 ## Backup type handlers.
163 bkplibexec_SCRIPTS += bkp.dump
164 ##dist_man_MANS += bkp.dump.8
165 EXTRA_DIST += bkp.dump.in
166 CLEANFILES += bkp.dump
167 bkp.dump: bkp.dump.in Makefile
168 $(SUBST) $(srcdir)/bkp.dump.in $(SUBSTVARS) >bkp.dump.new && \
169 chmod +x bkp.dump.new && mv bkp.dump.new bkp.dump
171 ###--------------------------------------------------------------------------
174 EXTRA_DIST += config/auto-version
177 echo $(VERSION) >$(distdir)/RELEASE
179 ###----- That's all, folks --------------------------------------------------