3 ### Build script for distorted.org.uk backup system
5 ### (c) 2011 Mark Wooding
8 ###----- Licensing notice ---------------------------------------------------
10 ### This program is free software; you can redistribute it and/or modify
11 ### it under the terms of the GNU General Public License as published by
12 ### the Free Software Foundation; either version 2 of the License, or
13 ### (at your option) any later version.
15 ### This program is distributed in the hope that it will be useful,
16 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ### GNU General Public License for more details.
20 ### You should have received a copy of the GNU General Public License
21 ### along with this program; if not, write to the Free Software Foundation,
22 ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 snaplibexecdir = $(libexecdir)/snap
43 bkplibexecdir = $(libexecdir)/bkp
46 AM_CFLAGS = $(mLib_CFLAGS) $(nettle_CFLAGS)
48 ###--------------------------------------------------------------------------
49 ### Substitution of configuration data.
51 confsubst = $(top_srcdir)/config/confsubst
52 EXTRA_DIST += config/confsubst
55 PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \
57 prefix="$(prefix)" exec_prefix="$(exec_prefix)" \
58 sbindir="$(sbindir)" \
59 sysconfdir="$(sysconfdir)" \
60 pkglibdir="$(pkglibdir)" \
61 bkplibexecdir="$(bkplibexecdir)" \
62 snaplibexecdir="$(snaplibexecdir)" \
63 pkglibexecdir="$(pkglibexecdir)"
65 SUBST = $(AM_V_GEN)$(confsubst)
67 ###--------------------------------------------------------------------------
70 ## Remote filesystem freezing tool.
71 sbin_PROGRAMS += rfreezefs
72 dist_man_MANS += rfreezefs.8
73 rfreezefs_SOURCES = rfreezefs.c
74 rfreezefs_LDADD = $(mLib_LIBS)
76 ## LVM snapshot removal nanny.
77 sbin_SCRIPTS += lvm-rmsnap
78 dist_man_MANS += lvm-rmsnap.8
79 EXTRA_DIST += lvm-rmsnap.in
80 CLEANFILES += lvm-rmsnap
81 lvm-rmsnap: lvm-rmsnap.in Makefile
82 $(SUBST) $(srcdir)/lvm-rmsnap.in $(SUBSTVARS) >lvm-rmsnap.new && \
83 chmod +x lvm-rmsnap.new && mv lvm-rmsnap.new lvm-rmsnap
89 snap: snap.in Makefile
90 $(SUBST) $(srcdir)/snap.in $(SUBSTVARS) >snap.new && \
91 chmod +x snap.new && mv snap.new snap
94 EXTRA_DIST += snap.8.in
96 snap.8: snap.8.in Makefile
97 $(SUBST) $(srcdir)/snap.8.in $(SUBSTVARS) >snap.8.new && \
100 man_MANS += snaptab.5
101 EXTRA_DIST += snaptab.5.in
102 CLEANFILES += snaptab.5
103 snaptab.5: snaptab.5.in Makefile
104 $(SUBST) $(srcdir)/snaptab.5.in $(SUBSTVARS) >snaptab.5.new && \
105 mv snaptab.5.new snaptab.5
107 ## Snapshot handlers.
108 snaplibexec_SCRIPTS += snap.lvm
109 dist_man_MANS += snap.lvm.8
110 EXTRA_DIST += snap.lvm
112 snaplibexec_SCRIPTS += snap.ro
113 dist_man_MANS += snap.ro.8
114 EXTRA_DIST += snap.ro
116 snaplibexec_SCRIPTS += snap.trivial
117 dist_man_MANS += snap.trivial.8
118 EXTRA_DIST += snap.trivial
120 snaplibexec_SCRIPTS += snap.rfreezefs
121 dist_man_MANS += snap.rfreezefs.8
122 EXTRA_DIST += snap.rfreezefs.in
123 CLEANFILES += snap.rfreezefs
124 snap.rfreezefs: snap.rfreezefs.in Makefile
125 $(SUBST) $(srcdir)/snap.rfreezefs.in $(SUBSTVARS) \
126 >snap.rfreezefs.new && \
127 chmod +x snap.rfreezefs.new && \
128 mv snap.rfreezefs.new snap.rfreezefs
130 ###--------------------------------------------------------------------------
131 ### Backup utilities.
133 ## Hashing rmt clone.
134 pkglibexec_PROGRAMS += rmt
136 rmt_LDADD = $(mLib_LIBS) $(nettle_LIBS)
138 ## Backup archive administration tool.
139 sbin_SCRIPTS += bkpadmin
140 ##dist_man_MANS += bkpadmin.8
141 EXTRA_DIST += bkpadmin.in
142 CLEANFILES += bkpadmin
143 bkpadmin: bkpadmin.in Makefile
144 $(SUBST) $(srcdir)/bkpadmin.in $(SUBSTVARS) >bkpadmin.new && \
145 chmod +x bkpadmin.new && mv bkpadmin.new bkpadmin
147 ## Backup client driver.
149 ##dist_man_MANS += bkp.8
153 $(SUBST) $(srcdir)/bkp.in $(SUBSTVARS) >bkp.new && \
154 chmod +x bkp.new && mv bkp.new bkp
156 ## Type handler utility library.
157 pkglib_DATA += bkpfunc.sh
158 EXTRA_DIST += bkpfunc.sh
160 ## Backup type handlers.
161 bkplibexec_SCRIPTS += bkp.dump
162 ##dist_man_MANS += bkp.dump.8
163 EXTRA_DIST += bkp.dump.in
164 CLEANFILES += bkp.dump
165 bkp.dump: bkp.dump.in Makefile
166 $(SUBST) $(srcdir)/bkp.dump.in $(SUBSTVARS) >bkp.dump.new && \
167 chmod +x bkp.dump.new && mv bkp.dump.new bkp.dump
169 ###--------------------------------------------------------------------------
172 EXTRA_DIST += config/auto-version
175 echo $(VERSION) >$(distdir)/RELEASE
177 ###----- That's all, folks --------------------------------------------------