Skip to content

Commit 2eb0a59

Browse files
committed
add manpage to package
1 parent 1520836 commit 2eb0a59

File tree

7 files changed

+37
-4
lines changed

7 files changed

+37
-4
lines changed

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RELEASE_ARCHIVE_FILE = $(RELEASE_DIR)/$(RELEASE_PREFIX)$(VERSION).tar.gz
1313
RELEASE_SIGNATURE_FILE = $(RELEASE_ARCHIVE_FILE).sig
1414
UPLOAD_TARGET = $(UPLOAD_USER)@dl.sv.nongnu.org:/releases/bdsync-manager
1515
PYTHON_BUILD_DIRS = bdsync_manager.egg-info build dist
16+
MANPAGE = $(DIR_BUILD)/bdsync-manager.1
1617

1718
SETUPTOOLS ?= python3 setup.py
1819

@@ -36,6 +37,15 @@ sign: $(RELEASE_SIGNATURE_FILE)
3637

3738
release: $(RELEASE_ARCHIVE_FILE)
3839

40+
build: manpages
41+
42+
.PHONY: manpages
43+
manpages: $(MANPAGE)
44+
45+
$(MANPAGE): Makefile bdsync-manager.help2man.include
46+
help2man --no-info --include bdsync-manager.help2man.include ./bdsync-manager >"$@.new"
47+
mv "$@.new" "$@"
48+
3949
upload: sign release
4050
@[ -z "$(UPLOAD_USER)" ] && { echo >&2 "ERROR: Missing savannah user name for upload:\n make upload UPLOAD_USER=foobar"; exit 1; } || true
4151
rsync -a "$(RELEASE_ARCHIVE_FILE)" "$(UPLOAD_TARGET)/"

TODO

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* add a man page
44
* add tests
5-
* seaparate "bsync_args" for local and remote execution
5+
* seaparate "bdsync_args" for local and remote execution
66
** e.g. "--blocksize" is allowed only for the local client
77
* synchronize all volumes of an LVM volume group
88
* use a template syntax for simplifiying repetitive source/target definitions

bdsync-manager.help2man.include

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[FILES]
2+
.TP
3+
\fB/etc/bdsync-manager.conf\fR
4+
default location of the configuration file describing one or more tasks to be executed
5+
6+
[AUTHOR]
7+
Written by Lars Kruse <[email protected]>
8+
9+
[REPORTING BUGS]
10+
Report bugs via https://savannah.nongnu.org/support/?group=bdsync-manager&func=additem
11+
12+
[SEE ALSO]
13+
bdsync-manager uses bdsync (https://github.com/TargetHolding/bdsync) for all low-level operations.

bdsync_manager/cmdline.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@
3535

3636

3737
def parse_arguments():
38-
parser = argparse.ArgumentParser(description="Manage one or more bdsync transfers.")
38+
parser = argparse.ArgumentParser(description="Manage one or more blockdevice transfers.")
3939
parser.add_argument("--log-level", dest="log_level", default="warning",
4040
choices=("debug", "info", "warning", "error"), help="Output verbosity")
41+
parser.add_argument("--version", action="version",
42+
version="%(prog)s {}".format(bdsync_manager.VERSION))
4143
parser.add_argument("--config", metavar="CONFIG_FILE", dest="config_file",
4244
default="/etc/bdsync-manager.conf", type=argparse.FileType('r'),
4345
help="Location of the config file")
44-
parser.add_argument("--task", metavar="TASK_NAME", dest="tasks", action="append")
46+
parser.add_argument("--task", metavar="TASK_NAME", dest="tasks", action="append",
47+
help="Optionally execute only one of the tasks described in the "
48+
"configuration")
4549
args = parser.parse_args()
4650
log_levels = {"debug": logging.DEBUG,
4751
"info": logging.INFO,

debian/bdsync-manager.manpages

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/bdsync-manager.1

debian/control

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ Source: bdsync-manager
22
Section: utils
33
Priority: optional
44
Maintainer: Lars Kruse <[email protected]>
5-
Build-Depends: debhelper (>= 9), dh-python, python3-all, python3-setuptools
5+
Build-Depends: debhelper (>= 9), help2man, dh-python, python3-all,
6+
python3-plumbum, python3-setuptools
67
Standards-Version: 4.1.1
78
Homepage: https://savannah.nongnu.org/projects/bdsync-manager/
89

debian/rules

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ export PYBUILD_NAME=bdsync-manager
44

55
%:
66
dh $@ --with python3 --buildsystem=pybuild
7+
8+
override_dh_auto_build:
9+
$(MAKE) manpages
10+
dh_auto_build

0 commit comments

Comments
 (0)