From: Mark Wooding Date: Thu, 16 Jan 2014 09:55:53 +0000 (+0000) Subject: rsync-backup.in, lib.sh.in: Move some definitions to a library. X-Git-Tag: 1.0.1~2 X-Git-Url: https://git.distorted.org.uk/~mdw/rsync-backup/commitdiff_plain/e0ff797b44481f8e84a16ce7af0ab5be2a4b244e rsync-backup.in, lib.sh.in: Move some definitions to a library. We'll want these for another program, coming soon. --- diff --git a/Makefile.am b/Makefile.am index f943ad4..413d541 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,7 @@ bin_SCRIPTS = sbin_SCRIPTS = sbin_PROGRAMS = +pkgdata_DATA = dist_noinst_SCRIPTS = dist_man_MANS = man_MANS = @@ -50,6 +51,7 @@ SUBSTVARS = \ mntbkpdir="$(mntbkpdir)" \ fshashdir="$(fshashdir)" \ pkglocalstatedir="$(localstatedir)/lib/bkp" \ + pkgdatadir="$(pkgdatadir)" \ logdir="$(logdir)" V_SUBST = $(V_SUBST_$V) @@ -70,6 +72,13 @@ sbin_PROGRAMS += rfreezefs man_MANS += rfreezefs.8 endif +pkgdata_DATA += lib.sh +CLEANFILES += lib.sh +EXTRA_DIST += lib.sh.in +lib.sh: lib.sh.in Makefile + $(SUBST) >lib.sh.new $(srcdir)/lib.sh.in $(SUBSTVARS) && \ + mv lib.sh.new lib.sh + sbin_SCRIPTS += rsync-backup dist_man_MANS += rsync-backup.8 CLEANFILES += rsync-backup diff --git a/debian/rsync-backup.install b/debian/rsync-backup.install index 9156279..99ef749 100644 --- a/debian/rsync-backup.install +++ b/debian/rsync-backup.install @@ -1,4 +1,5 @@ /usr/sbin/rsync-backup /usr/sbin/update-bkp-index +/usr/share/rsync-backup/lib.sh /usr/share/man/man8/rsync-backup.8 /usr/share/man/man8/update-bkp-index.8 diff --git a/lib.sh.in b/lib.sh.in new file mode 100644 index 0000000..269cef6 --- /dev/null +++ b/lib.sh.in @@ -0,0 +1,102 @@ +### -*-bash-*- +### +### Common utilities for rsync-backup scripts +### +### (c) 2014 Mark Wooding +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the `rsync-backup' program. +### +### rsync-backup is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### rsync-backup is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with rsync-backup; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +###-------------------------------------------------------------------------- +### Configuration. + +VERSION=@VERSION@ +pkgdatadir=@pkgdatadir@ +mntbkpdir=@mntbkpdir@ +logdir=@logdir@ +fshashdir=@fshashdir@ +conf=@sysconfdir@/rsync-backup.conf + +INDEXDB=@pkglocalstatedir@/index.db + +SNAPDIR=$mntbkpdir/snap +STOREDIR=$mntbkpdir/store +METADIR=$mntbkpdir/meta + +config () { + echo + cat <&8 "$@"; } while getopts "hVvc:n" opt; do