chiark / gitweb /
4fa8227936a75667b60b38ba7a3dffad8c1641f0
[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 dist_noinst_SCRIPTS      =
30 dist_man_MANS            =
31
32 EXTRA_DIST               =
33 CLEANFILES               =
34 DISTCLEANFILES           =
35
36 AM_CFLAGS                = $(mLib_CFLAGS)
37
38 ###--------------------------------------------------------------------------
39 ### Substitution of configuration data.
40
41 confsubst = $(top_srcdir)/config/confsubst
42 EXTRA_DIST              += config/confsubst
43
44 SUBSTVARS = \
45         PACKAGE="$(PACKAGE)" VERSION="$(VERSION)" \
46         BASH="$(BASH)" PYTHON="$(PYTHON)" \
47         sysconfdir="$(sysconfdir)" \
48         mntbkpdir="$(mntbkpdir)" \
49         fshashdir="$(fshashdir)" \
50         pkglocalstatedir="$(localstatedir)/lib/bkp" \
51         logdir="$(logdir)"
52
53 V_SUBST = $(V_SUBST_$V)
54 V_SUBST_= $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
55 V_SUBST_0 = @printf "  SUBST  %s\n" $@;
56
57 SUBST = $(V_SUBST)$(confsubst)
58
59 ###--------------------------------------------------------------------------
60 ### Programs and scripts.
61
62 sbin_PROGRAMS           += rfreezefs
63 dist_man_MANS           += rfreezefs.8
64 rfreezefs_SOURCES        = rfreezefs.c
65 rfreezefs_LDADD          = $(mLib_LIBS)
66
67 sbin_SCRIPTS            += rsync-backup
68 dist_man_MANS           += rsync-backup.8
69 CLEANFILES              += rsync-backup
70 EXTRA_DIST              += rsync-backup.in
71 rsync-backup: rsync-backup.in Makefile
72         $(SUBST) >rsync-backup.new \
73                         $(srcdir)/rsync-backup.in $(SUBSTVARS) && \
74                 chmod +x rsync-backup.new && \
75                 mv rsync-backup.new rsync-backup
76
77 sbin_SCRIPTS            += update-bkp-index
78 dist_man_MANS           += update-bkp-index.8
79 CLEANFILES              += update-bkp-index
80 EXTRA_DIST              += update-bkp-index.in
81 update-bkp-index: update-bkp-index.in Makefile
82         $(SUBST) >update-bkp-index.new \
83                         $(srcdir)/update-bkp-index.in $(SUBSTVARS) && \
84                 chmod +x update-bkp-index.new && \
85                 mv update-bkp-index.new update-bkp-index
86
87 bin_SCRIPTS             += fshash
88 dist_man_MANS           += fshash.1
89 CLEANFILES              += fshash
90 EXTRA_DIST              += fshash.in
91 fshash: fshash.in Makefile
92         $(SUBST) >fshash.new \
93                         $(srcdir)/fshash.in $(SUBSTVARS) && \
94                 chmod +x fshash.new && \
95                 mv fshash.new fshash
96
97 ###--------------------------------------------------------------------------
98 ### Contributed scripts.
99
100 ## Some simple scripts showing how one might create and manage backup
101 ## volumes.  Assume the distorted.org.uk key management machinery.
102 dist_noinst_SCRIPTS     += create-backup-volume
103 dist_noinst_SCRIPTS     += mount-backup-volume
104 dist_noinst_SCRIPTS     += umount-backup-volume
105
106 ###--------------------------------------------------------------------------
107 ### Release machinery.
108
109 EXTRA_DIST              += config/auto-version
110
111 dist-hook:
112         echo $(VERSION) >$(distdir)/RELEASE
113
114 ###--------------------------------------------------------------------------
115 ### Debian packaging.
116
117 EXTRA_DIST              += debian/copyright debian/changelog
118 EXTRA_DIST              += debian/control debian/rules
119 EXTRA_DIST              += debian/compat
120
121 ###----- That's all, folks --------------------------------------------------