From 05860653b0e37abbc144f43b48dc86b9ab71f156 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sun, 13 Sep 2015 22:57:00 +0200 Subject: Move man pages for section 1 to man1/ directory. As a bonus you can install out-of-tree now via make -f. Fixes #22. --- Makefile | 19 +++++++++----- man1/metastore.1 | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ metastore.1 | 80 -------------------------------------------------------- 3 files changed, 92 insertions(+), 87 deletions(-) create mode 100644 man1/metastore.1 delete mode 100644 metastore.1 diff --git a/Makefile b/Makefile index 96acb88..7442935 100644 --- a/Makefile +++ b/Makefile @@ -22,16 +22,18 @@ CFLAGS += -g -Wall -pedantic -std=c99 -D_FILE_OFFSET_BITS=64 -O2 LDFLAGS += LIBS += -lbsd INCLUDES = -INSTALL = install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 +INSTALL = install +INSTALL_PROGRAM = ${INSTALL} -c +INSTALL_DATA = ${INSTALL} -c -m 644 COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) OBJECTS = utils.o metastore.o metaentry.o HEADERS = utils.h metastore.h metaentry.h +MANPAGES = man1/metastore.1 PROJ_DIR := $(dir $(lastword $(MAKEFILE_LIST))) SRCS_DIR := $(PROJ_DIR)src/ +MANS_DIR := $(PROJ_DIR) DESTDIR ?= prefix = /usr @@ -40,6 +42,7 @@ mandir = ${prefix}/share/man vpath %.c $(SRCS_DIR) vpath %.h $(SRCS_DIR) +vpath %.1 $(MANS_DIR) # # Targets @@ -57,13 +60,15 @@ metastore: $(OBJECTS) $(LINK) -o $@ $^ $(LIBS) -install: all - $(INSTALL_DATA) -D metastore.1 $(DESTDIR)$(mandir)/man1/metastore.1 - $(INSTALL_PROGRAM) -D metastore $(DESTDIR)$(usrbindir)/metastore +install: all $(MANPAGES) + $(INSTALL) -d $(DESTDIR)$(mandir)/man1/ + $(INSTALL_DATA) $(filter %.1,$^) $(DESTDIR)$(mandir)/man1/ + $(INSTALL) -d $(DESTDIR)$(usrbindir)/ + $(INSTALL_PROGRAM) metastore $(DESTDIR)$(usrbindir)/ uninstall: - - rm -f $(DESTDIR)$(mandir)/man1/metastore.1 + - rm -f $(addprefix $(DESTDIR)$(mandir)/,$(MANPAGES)) - rm -f $(DESTDIR)$(usrbindir)/metastore diff --git a/man1/metastore.1 b/man1/metastore.1 new file mode 100644 index 0000000..950360c --- /dev/null +++ b/man1/metastore.1 @@ -0,0 +1,80 @@ +.TH metastore "1" "September 2015" +.\" +.SH NAME +metastore \- stores and restores filesystem metadata +.\" +.SH SYNOPSIS +\fBmetastore\fR \fIACTION\fR [\fIOPTION...\fR] [\fIPATH...\fR] +.\" +.SH DESCRIPTION +Stores or restores metadata (owner, group, permissions, xattrs and optionally +mtime) for a filesystem tree. This can be used to preserve the metadata in +situations where it is usually not stored (git and tar for example) or as +a tripwire like mechanism to detect any changes to metadata. Note that e.g. +SELinux stores its labels in xattrs so care should be taken when applying +stored metadata to make sure that system security is not compromised. +.\" +.SH ACTIONS +.TP +.B \-c, \-\-compare +Shows the difference between the stored and real metadata. +.TP +.B \-s, \-\-save +Saves the current metadata to ./.metadata or to the specified file +(see \-\-file option below). +.TP +.B \-a, \-\-apply +Attempts to apply the stored metadata to the file system. +.TP +.B \-d, \-\-dump +Dumps stored (if no \fIPATH\fR is given) or real metadata (if \fIPATH\fR is +present, e.g. \fB./\fR) in human-readable form. + +This action is meant only as a helpful debugging facility or merge conflict +helper. Do not ever compare its output generated using different metastore +version. Do not rely on current output format (especially in batch scripts), +because it may change in future without prior notice. +.TP +.B \-h, \-\-help +Prints a help message and exits. +.\" +.SH OPTIONS +.TP +.B \-v, \-\-verbose +Causes metastore to print more verbose messages. Can be repeated more than +once for even more verbosity. +.TP +.B \-q, \-\-quiet +Causes metastore to print less verbose messages. Can be repeated more than +once for even less verbosity. +.TP +.B \-m, \-\-mtime +Causes metastore to also take mtime into account for the compare or apply actions. +.TP +.B \-e, \-\-empty\-dirs +Also attempts to recreate missing empty directories. May be useful where +empty directories are not tracked (e.g. by git or cvs). +Only works in combination with the \fBapply\fR option. +.TP +.B -E, --remove-empty-dirs +Also attempts to remove empty directories missing from the metadata. May be +useful where empty directories are not tracked (e.g. by git or cvs). Only +works in combination with the \fBapply\fR option. +.TP +.B \-g, \-\-git +Prevents metastore from omitting .git directories. +.TP +.B \-f , \-\-file +Causes the metadata to be saved, read from the specified file rather +than ./.metadata. +.\" +.SH PATHS +If no path is specified, metastore will use the current directory as the basis +for the actions. This is the recommended way of executing metastore. +Alternatively, one or more paths can be specified and they will each be +examined. Later invocations should be made using the exact same paths to +ensure that the stored metadata is interpreted correctly. +.\" +.SH AUTHOR +Written by David Härdeman + diff --git a/metastore.1 b/metastore.1 deleted file mode 100644 index 950360c..0000000 --- a/metastore.1 +++ /dev/null @@ -1,80 +0,0 @@ -.TH metastore "1" "September 2015" -.\" -.SH NAME -metastore \- stores and restores filesystem metadata -.\" -.SH SYNOPSIS -\fBmetastore\fR \fIACTION\fR [\fIOPTION...\fR] [\fIPATH...\fR] -.\" -.SH DESCRIPTION -Stores or restores metadata (owner, group, permissions, xattrs and optionally -mtime) for a filesystem tree. This can be used to preserve the metadata in -situations where it is usually not stored (git and tar for example) or as -a tripwire like mechanism to detect any changes to metadata. Note that e.g. -SELinux stores its labels in xattrs so care should be taken when applying -stored metadata to make sure that system security is not compromised. -.\" -.SH ACTIONS -.TP -.B \-c, \-\-compare -Shows the difference between the stored and real metadata. -.TP -.B \-s, \-\-save -Saves the current metadata to ./.metadata or to the specified file -(see \-\-file option below). -.TP -.B \-a, \-\-apply -Attempts to apply the stored metadata to the file system. -.TP -.B \-d, \-\-dump -Dumps stored (if no \fIPATH\fR is given) or real metadata (if \fIPATH\fR is -present, e.g. \fB./\fR) in human-readable form. - -This action is meant only as a helpful debugging facility or merge conflict -helper. Do not ever compare its output generated using different metastore -version. Do not rely on current output format (especially in batch scripts), -because it may change in future without prior notice. -.TP -.B \-h, \-\-help -Prints a help message and exits. -.\" -.SH OPTIONS -.TP -.B \-v, \-\-verbose -Causes metastore to print more verbose messages. Can be repeated more than -once for even more verbosity. -.TP -.B \-q, \-\-quiet -Causes metastore to print less verbose messages. Can be repeated more than -once for even less verbosity. -.TP -.B \-m, \-\-mtime -Causes metastore to also take mtime into account for the compare or apply actions. -.TP -.B \-e, \-\-empty\-dirs -Also attempts to recreate missing empty directories. May be useful where -empty directories are not tracked (e.g. by git or cvs). -Only works in combination with the \fBapply\fR option. -.TP -.B -E, --remove-empty-dirs -Also attempts to remove empty directories missing from the metadata. May be -useful where empty directories are not tracked (e.g. by git or cvs). Only -works in combination with the \fBapply\fR option. -.TP -.B \-g, \-\-git -Prevents metastore from omitting .git directories. -.TP -.B \-f , \-\-file -Causes the metadata to be saved, read from the specified file rather -than ./.metadata. -.\" -.SH PATHS -If no path is specified, metastore will use the current directory as the basis -for the actions. This is the recommended way of executing metastore. -Alternatively, one or more paths can be specified and they will each be -examined. Later invocations should be made using the exact same paths to -ensure that the stored metadata is interpreted correctly. -.\" -.SH AUTHOR -Written by David Härdeman - -- cgit v1.2.1